Browse Source

Remove pre built AMI option for single node

Anuj Bansal 3 years ago
parent
commit
ba21713c49

+ 1 - 1
devops/infrastructure/bash-config.sample.cfg

@@ -11,7 +11,7 @@ BUILD_EC2_INSTANCE_TYPE=t2.xlarge
 RPC_EC2_INSTANCE_TYPE=t2.micro
 
 # Set a prebuilt AMI if required
-EC2_AMI_ID="ami-064f99551235fb1ac"
+EC2_AMI_ID="ami-08ffec5991ca99db9"
 
 ACCOUNT_ID=$(aws sts get-caller-identity --profile $CLI_PROFILE --query Account --output text)
 

+ 3 - 2
devops/infrastructure/deploy-single-node.sh

@@ -2,6 +2,8 @@
 
 set -e
 
+source common.sh
+
 if [ -z "$1" ]; then
   echo "ERROR: Configuration file not passed"
   echo "Please use ./deploy-infra.sh PATH/TO/CONFIG to run this script"
@@ -32,8 +34,7 @@ aws cloudformation deploy \
   --capabilities CAPABILITY_NAMED_IAM \
   --parameter-overrides \
     EC2InstanceType=$DEFAULT_EC2_INSTANCE_TYPE \
-    KeyName=$AWS_KEY_PAIR_NAME \
-    EC2AMI=$EC2_AMI_ID
+    KeyName=$AWS_KEY_PAIR_NAME
 
 # If the deploy succeeded, get the IP and configure the created instance
 if [ $? -eq 0 ]; then

+ 1 - 7
devops/infrastructure/single-instance.yml

@@ -7,18 +7,12 @@ Parameters:
   EC2AMI:
     Type: String
     Default: 'ami-09e67e426f25ce0d7'
-  DefaultAMI:
-    Type: String
-    Default: 'ami-09e67e426f25ce0d7'
   KeyName:
     Description: Name of an existing EC2 KeyPair to enable SSH access to the instance
     Type: 'AWS::EC2::KeyPair::KeyName'
     Default: 'joystream-key'
     ConstraintDescription: must be the name of an existing EC2 KeyPair.
 
-Conditions:
-  HasAMIId: !Not [!Equals [!Ref EC2AMI, ""]]
-
 Resources:
   SecurityGroup:
     Type: AWS::EC2::SecurityGroup
@@ -46,7 +40,7 @@ Resources:
     Properties:
       LaunchTemplateName: !Sub 'LaunchTemplate_${AWS::StackName}'
       LaunchTemplateData:
-        ImageId: !If [HasAMIId, !Ref EC2AMI, !Ref DefaultAMI]
+        ImageId: !Ref EC2AMI
         InstanceType: !Ref EC2InstanceType
         KeyName: !Ref KeyName
         SecurityGroupIds: