In this 3-part series on Create and Deploy applications using CodeDeploy and CodePipeline with Amazon S3 bucket versioning enabled -
In the 3rd article, we will create a CodePipeline pipeline and deploy the application on the instance
1st article
- As a reference, please read my 3-part series - (1) Launch an EC2 Instance, Install CodeDeploy Agent and upload App_Linux.zip file to version enabled S3 bucket
2nd article
- As a reference, please read my 3-part series - (2) Create a CodeDeploy application and Deployment group
Let’s get started!
Please visit my GitHub Repository for CI-CD/Docker/ECS/ECR articles on various topics being updated on constant basis.
Objectives:
1. Create a CodePipeline pipeline and deploy the application on the instance
2. Test the application using EC2 Instance Public IPv4 DNS
3. Delete all the following services
Pre-requisites:
- AWS user account with admin access, not a root account.
- AWS CLI.
Resources Used:
Steps for implementation to this project
1. Create a CodePipeline pipeline and deploy the application on the instance
on CodePipeline under Developer Tools, Pipelines, Create pipeline, my_codepipeline, Service role: New service role, AWSCodePipelineServiceRole-us-east-1-my_codepipeline, Next
Add S3 policy to the role created by Codepipeline
On the IAM console, Roles, search and click for the role starting with AWSCodePipelineServiceRole-us-east-1-my-codepipeline which was created with the codepipeline, On the Permissions tab, Add permissions, Attach policies, Search and select AmazonS3FullAccess, Attach policies
Expand the option of Advanced settings, Artifact store: Custom location, Bucket: codecommit-bucket12
Next
1. Add Source stage
Source provider : Choose Source provider: Amazon S3, Bucket: codecommit-bucket12, S3 object key: App_Linux.zip
Next
2. Add build stage
Skip build stage
- Next
Skip
3. Add deploy stage
Deploy provider : AWS CodeDeploy, Region: US East (N. Virginia), Application name: my-codedeployapp, Deployment group: my-codedeploy-grp
- Next
Review and Create Pipeline.
CodePipeline has started to run and will succeed.
Wait for 4-5 minutes to succeed
2. Test the application using EC2 Instance Public IPv4 DNS
- Copy the Public IPv4 DNS of the Instance.
3. Delete all the following services
EC2 Instance
CodeDeploy Application
CodePipeline
AWSCodePipelineServiceRole-us-east-1-my_codepipeline
S3 Bucket
HTTPS Git credentials for AWS CodeCommit
What we have done so far
- We have successfully created and deployed applications using CodeDeploy and CodePipeline with Amazon S3 bucket versioning enabled
Top comments (0)