Skip to content

Commit e7231b0

Browse files
author
Daniel Graves
committed
Add support for Bottlerocket AMI in ECS deployment
1 parent b78ab34 commit e7231b0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

master_deploy.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ TEMPLATE_SKELETON_FILE="base_template_v2.json"
4646
APP_IMAGE_NAME=""
4747
DEPLOYCATEGORY=""
4848
ECSCLI_ENVFILE="api.env"
49+
bottlerocket_ami_id=$(fetch_bottlerocket_ami_id $AWS_REGION)
4950

5051
# Variables specific to EBS
5152

@@ -131,6 +132,22 @@ configure_docker_private_login() {
131132
aws s3 cp "s3://appirio-platform-$ENV_CONFIG/services/common/dockercfg" ~/.dockercfg
132133
}
133134

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+
134151
# ECS Deployment Functions
135152
ECS_push_ecr_image() {
136153
echo "\n\n"

0 commit comments

Comments
 (0)