amazon-ecs-cli icon indicating copy to clipboard operation
amazon-ecs-cli copied to clipboard

Launch Templates vs Launch Configurations

Open NevRA opened this issue 1 year ago • 3 comments

Summary

I received a message from AWS We have identified that one or more of your accounts uses Amazon EC2 Auto Scaling launch configurations. After December 31, 2022 no new Amazon Elastic Compute Cloud (Amazon EC2) instance types will be added to launch configurations. After this date, existing launch configurations will continue to work, but new EC2 instances will only be supported through launch templates. In 2021, through email notifications, console banners, documentation updates, re:Post banners, and a blog post [1], AWS announced that Amazon EC2 Auto Scaling would stop adding new EC2 instance types to launch configurations [2] by the end of 2022. Launch templates [3] exceed launch configurations in functionality. In addition to supporting all new EC2 instance types, launch templates provides a simple way to combine multiple instance types and purchase options, configure instance networking settings, use these settings with other AWS services, and maintain versions of these settings. You can convert your launch configurations to launch templates using the AWS Management Console

Is it possible to configure Launch Templates using AWS ECS cli?

Description

I'm using below commands:

ecs-cli configure profile --access-key $AWS_ACCESS_KEY_ID --secret-key $AWS_SECRET_ACCESS_KEY --profile-name $ECS_PROFILE

ecs-cli configure --cluster $ECS_CLUSTER --default-launch-type EC2 --config-name $ECS_CLUSTER_CONFIG --region $AWS_REGION

ecs-cli up --keypair pair-key --capability-iam --size 1 --instance-type t2.xlarge --cluster-config $ECS_CLUSTER_CONFIG --ecs-profile $ECS_PROFILE

ecs-cli compose create --create-log-groups --cluster-config $ECS_CLUSTER_CONFIG --ecs-profile $ECS_PROFILE

Expected Behavior

To create Launch Templates instead of Launch Configurations

Observed Behavior

Deprecated Launch Configuration created

NevRA avatar Nov 30 '22 08:11 NevRA

Hi. My understanding is this tool and repo are deprecated. I doubt we will see AWS make an official code update. Still, there is some good news...

When one follows these conditions:

  • continue to use the same AWS account to create/destroy clusters using ECS-CLI
  • AND
  • don't need the newest ECS instance types

...then I think the tool will continue to work with no changes. The official blog post on this, sdk docs, and yesterday's email you received all suggest this to me. Definitely check independent for your own projects.

Next, a quick look at the code shows the embedded CloudFormation template https://github.com/aws/amazon-ecs-cli/blob/6d2b2a62dde166269e6d540133581a8842929ccd/ecs-cli/modules/clients/aws/cloudformation/cluster_template.go#L596 uses launch configurations. It is technically possible to update this and the other parts of ECS-CLI code to use the newer launch template. If someone knew the ECS-CLI codebase well, I suspect it is less than a week's work.

diablodale avatar Dec 01 '22 17:12 diablodale

@diablodale, thanks for the reply. I'm using it because I need EC2 & docker compose support (AWS Copilot CLI doesn't support it yet). Maybe you know an alternative to ECS CLI?

NevRA avatar Dec 01 '22 17:12 NevRA

Docker themselves added an ability to push to ECS using their native docker-compose. Perhaps that has enough features to meet your needs.

https://www.docker.com/blog/docker-compose-from-local-to-amazon-ecs/ https://docs.docker.com/cloud/ecs-integration/ https://aws.amazon.com/blogs/containers/deploy-applications-on-amazon-ecs-using-docker-compose/

or 3rd party https://github.com/compose-x/ecs_composex/

diablodale avatar Dec 01 '22 18:12 diablodale