This blog will show you how to install WordPress with AWS Codepipeline.
Let’s first briefly describe the services that will be used before we start the demo.
Amazon Web Services (AWS), which provides three services, CodeCommit CodeDeploy CodePipeline, and CodeDeploy CodeDeploy as Developer Tools, allows developers to focus on their application, rather than deployment.

CodeCommit hosts private Git repositories that allow us to securely store code. You can store any file, anywhere and integrate with third-party services and AWS. Files can easily be moved from any Git-based repository into AWS CodeComit.
CodeDeploy allows developers to deploy applications (contains code, web, scripts and more). It facilitates automated deployments, reduces downtime and is easy to use.
CodePipeline allows you to automate your release process with your favorite tools like AWS CodeDeploy, AWS Elastic Beanstalk and AWS CodeCommit. The progress can be viewed at a glance. It speeds up delivery and improves quality. It has many stages that allow you to test your code before it is released.
Let’s start with the pre-requisites
Working knowledge of Linux, Amazon EC2, SNS and IAM, RDS & Git
Region : N.Virginia
Two IAM roles are required: a Service Role, and an Instance Profile role.
You can create a service role and then paste the policy below.

“Version”: “2012-10-17”, “Statement”: [ “Action”: [ “autoscaling:PutLifecycleHook”, “autoscaling:DeleteLifecycleHook”, “autoscaling:RecordLifecycleActionHeartbeat”, “autoscaling:CompleteLifecycleAction”, “autoscaling:DescribeAutoscalingGroups”, “autoscaling:PutInstanceInStandby”, “autoscaling:PutInstanceInService”, “ec2:Describe*”, “sns:*”, “codecommit:*”, “codedeploy:*”, “codepipeline:*”, “codecommit:GetBranch”, “codecommit:GetCommit”, “codecommit:UploadArchive”, “codecommit:GetUploadArchiveStatus”, “codecommit:CancelUploadArchive”, “s3:*” ], “Effect”: “Allow”, “Resource”: “*” ]1234567891011121314151617181920212223242526272829″Version”: “2012-10-17″,”Statement”: [“Action”: [“autoscaling:PutLifecycleHook”,”autoscaling:DeleteLifecycleHook”,”autoscaling:RecordLifecycleActionHeartbeat”,”autoscaling:CompleteLifecycleAction”,”autoscaling:DescribeAutoscalingGroups”,”autoscaling:PutInstanceInStandby”,”autoscaling:PutInstanceInService”,”ec2:Describe*”,”sns:*”,”codecommit:*”,”codedeploy:*”,”codepipeline:*”,”codecommit:GetBranch”,”codecommit:GetCommit”,”codecommit:UploadArchive”,”codecommit:GetUploadArchiveStatus”,”codecommit:CancelUploadArchive”,”s3:*”],”Effect”: “Allow”,”Resource”: “*”]Once the IAM role is created, we need to establish a trusted relationship for this role with AWSCodeDeploy. Modify the trust relationship policy for this role and change it to the below-mentioned policy:
“Version”: “2012-10-17”, “Statement”: [ “Sid”: “”, “Effect”: “Allow”, “Principal”: “Service”: [ “”, “” ] , “Action”: “sts:AssumeRole” ] 12345678910111213141516 “Version”: “2012-10-17”, “Statement”: [“Sid”: “”,”Effect”: “Allow”,”Principal”: “Service”: [“”,””],”Action”: “sts:AssumeRole”] Instance Profile Role: EC2 instances needs to be launched with proper permissions to access files from S3 buckets.