File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ TEMPLATE_SKELETON_FILE="base_template_v2.json"
46
46
APP_IMAGE_NAME=" "
47
47
DEPLOYCATEGORY=" "
48
48
ECSCLI_ENVFILE=" api.env"
49
+ bottlerocket_ami_id=$( fetch_bottlerocket_ami_id $AWS_REGION )
49
50
50
51
# Variables specific to EBS
51
52
@@ -131,6 +132,22 @@ configure_docker_private_login() {
131
132
aws s3 cp " s3://appirio-platform-$ENV_CONFIG /services/common/dockercfg" ~ /.dockercfg
132
133
}
133
134
135
+ # Function to fetch the latest Bottlerocket AMI ID
136
+ fetch_bottlerocket_ami_id () {
137
+ local region=${1:- us-east-1} # Default to us-east-1 if no region is provided
138
+
139
+ BOTTLE_ROCKET_AMI_ID=$( aws ssm get-parameters --names /aws/service/bottlerocket/aws-ecs-1/latest/amazon-linux-2/recommended/image_id --region $region --query ' Parameters[0].[Value]' --output text)
140
+
141
+ if [ -z " $BOTTLE_ROCKET_AMI_ID " ]; then
142
+ log " Failed to fetch Bottlerocket AMI ID for region $region "
143
+ return 1
144
+ else
145
+ log " Fetched Bottlerocket AMI ID for region $region : $BOTTLE_ROCKET_AMI_ID "
146
+ echo $BOTTLE_ROCKET_AMI_ID
147
+ fi
148
+ }
149
+
150
+
134
151
# ECS Deployment Functions
135
152
ECS_push_ecr_image () {
136
153
echo " \n\n"
You can’t perform that action at this time.
0 commit comments