This lab walks you through how to deploy sample containerized applications on ECS using AWS CodeDeploy.
Duration: 120 minutes
AWS Region: US East (N. Virginia) us-east-1
AWS CodeDeploy helps you automate your application deployment of a variety of computing services such as Amazon EC2, AWS Lambda, AWS Fargate, and on-premise servers.
Using CodeDeploy, we can deploy the following types of content:
Serverless AWS Lambda functions
Web and configuration files
The source code of the application can be stored in S3 Bucket. CodeCommit is a git-based repository such as GitHub or BitBucket.
CodeDeploy helps us in rapidly releasing new features, updating AWS Lambda functions version, to avoid downtime during application deployments and handle the complexity of applications deployments where manual deployments are error-prone.
To work with various systems for configuration management, source control, continuous integration (CI) and continuous delivery (CD), you can use CodeDeploy.
CodeDeploy can be used for the following types of deployment:
Applications that require servers like Amazon EC2, On-premise server.
Applications that are serverless, using AWS Lambda.
Containerized applications deployed on Amazon ECS.
AWS CodeDeploy supports two types of deployment:
In-place deployment: For this method, you stop the deployment of applications present on every instance and install a revised application. Once the newer version of the application is deployed the application starts and gets validated.
Note: AWS Lambda and Amazon ECS deployments, do not support in-place deployments.
Blue-green deployment: For this deployment type, the characteristics of deployment depend on the type of computing platform used for deployment.
EC2 or On-premise platform
Log in to the AWS Management Console.
Create a Security Group for the load balancer.
Create the Load balancer.
Create the second listener, required during deployment in CodeDeploy.
Create an Environment in CloudShell.
Create an ECS Cluster, register task definition, and create an ECS service.
Create a new revision of the task definition and add tags.
Update the appspec.yml files and upload it back to the S3 bucket.
Create a CodeDeploy application and deployment group.
Update the ECS task definition by adding another tag.
Create a listener for the new port.
Create a Lambda function for the AfterAllowTestTraffic event.
Update the appspec.yml file.
Modify the deployment group and add test listeners port.
Check your final output in the CloudWatch log.
Deleting AWS Resources.