Skip to content

CICD Setup for EC2

Juhi edited this page May 25, 2020 · 14 revisions

Below is the process to setup continuous deployment to AWS EC2 instance with source code in github.

  1. Create IAM roles (if not already created)
    • CodeDeploy Service Role -- This role gives codedeploy access to target instances (EC2 / lambda). It also provides cloudwatch, SNS access for alerts & notification
      • Go to IAM roles and click on create role
      • Select CodeDeploy service and CodeDeploy use case for deployment to EC2
      • Add tags if required, give appropriate name and create the role
    • EC2 Role -- This role gives code deploy agent installed on EC2 instance, access to read S3 srtifacts
      • To understand where S3 came into picture, we need to understand how codedeploy works. Check this page for a short brief. <>
      • Create a new role selecting EC2 service with AmazonS3ReadOnlyAccess policy
      • Add tags if required, give appropriate name and create the role

Clone this wiki locally