Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Eucrow/150f120094f93215ffa03ffe77179656 to your computer and use it in GitHub Desktop.

Select an option

Save Eucrow/150f120094f93215ffa03ffe77179656 to your computer and use it in GitHub Desktop.
Steps to deploy application from Git Hub in EC3 with CodeDeploy

Steps to deploy application (or a revision of an application) from Git Hub in EC3 with CodeDeploy

Brief summary created from and adapted to my own experience.

  1. Create instance readdy to work with Code Deploy: https://docs.aws.amazon.com/codedeploy/latest/userguide/instances-ec2-create.html
  2. Create two IAM roles:
  • IAM role for Code Deploy to comunicate with with the EC2 instance: In AWS IAM Console create new role with the "AWSCodeDeployRole" policy.
  • IAm role for EC2 to access S3 (and Git Hub): In AWS IAM Console create new role with the "AmazonS3ReadOnlyAccess" policy.
  1. Attach the role with the "AmazonS3ReadOnlyAccess" policy to the instance.
  2. Create the appspec.yml file in the application (and upload to Git Hub as the rest of the files of the application). This file describes to AWS CodeDeploy how to manage the lifecycle of your application. More info about appspec.yml in https://docs.aws.amazon.com/codedeploy/latest/userguide/application-revisions-appspec-file.html
  3. In AWS Code Deploye, create an Application and a Deployment Group, using the instance previously created and the role with the "AWSCodeDeployRole" policy. More info in: https://docs.aws.amazon.com/codedeploy/latest/userguide/tutorials-github-create-application.html
  4. Deploy the applicatión: in Code Deploy, on the Deployment group details page, choose Create deployment and deploy the previous application, using the Git Hub repository. More info in: https://docs.aws.amazon.com/codedeploy/latest/userguide/tutorials-github-deploy-application.html
  5. Check if the application has been updated :D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment