Coder Social home page Coder Social logo

aws-code-deploy-ec2's Introduction

create openId connect

  • create identity provider (OpenId connect)
  • create web identity role to give access to S3 and code deploy
    • assign it to identity provider
  • You need to add role's arn to GitHub repository in secret section

Prepare the Aws environment (You can do this by CloudFormation but for this project we are doing it manually)

create roles

  • Create service role for EC2 to access the S3
  • Create service role for CodeDeploy to have permission to be able to deploy the application.

Create EC2 instance

  • create EC2
    • assign role to access the s3.
    • Give tag to it(we need this in our code deployment process)
    • add Security group to access the service using http
  • install necessary software on ec2 by ssh
    • Install CodeDeploy agent (You can do this step when you create deployment group)
    • Install java
    • you can use the file inside the documentation folder.

Create bucket

CodeDeploy

  • Create Application
  • Create Deployment group
    • assign created role to it
    • we can select environment config -> ASG or using tags
    • type of deployment in place or blue/green
    • You can select to install code deploy agent on instance, but we don't select it because we installed it ourselves
    • you can select load balancer or not
    • you can use deployment group to create new deployment with different source GitHub or bucket. You can do this step manually but in this project we are using GitHub actions to create deployment using aws deploy create-deployment --application-name ${{ env.CODE_DEPLOY_APPLICATION_NAME }} --deployment-group-name ${{ env.CODE_DEPLOY_GROUP_NAME }} --s3-location bucket=${{ env.CODE_DEPLOY_BUCKET_NAME }},bundleType=zip,key=${{ env.CODE_DEPLOY_BUCKET_KEY }} --ignore-application-stop-failures

Clean up

  • remove bucket
  • remove CodeDeply application
  • remove EC2 instance
  • remove roles
  • remove identity provider
  • Delete the GitHub Secret

Links

aws-code-deploy-ec2's People

Contributors

behnam-khoshsafar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.