Giter Club home page Giter Club logo

codedeploy-terraform's Introduction

CodeDeploy with Terraform Demo

  1. Generate an SSH key pair:
$ ssh-keygen -t rsa -f ~/.ssh/code-deploy-demo -C cd-demo -P ""
  1. Run terraform:
$ terraform init
$ terraform apply

Resources will be created in eu-west-1 region by default. Change region var if you want another region.

  1. From the output get the name of the s3 bucket created. If you get an output like this:
codedeploydemo-734.s3.amazonaws.com

then the name of the created bucket is codedeploydemo-734. Save this bucket name, you will upload the sample application revision to that bucket.

  1. Change directory into sample-app. And run the following command to create application revision and upload it to S3 bucket (make sure to change the name of the bucket [and region if you changed it in terraform]).
$ cd sample-app
$ aws --region eu-west-1 deploy push \
    --application-name Sample_App \
    --s3-location s3://codedeploydemo-734/SampleApp.zip

This command bundles the files from the current directory into a single archive file named SampleApp.zip, uploads the revision to the codedeploydemo-734 bucket, and registers information with AWS CodeDeploy about the uploaded revision.

  1. Create a deployment (make sure to change the name of the bucket [and region if you changed it in terraform]):
$ aws --region eu-west-1 deploy create-deployment \
    --application-name Sample_App \
    --deployment-config-name CodeDeployDefault.OneAtATime \
    --deployment-group-name Sample_DepGroup \
    --s3-location bucket=codedeploydemo-734,bundleType=zip,key=SampleApp.zip
  1. Access the Sample application by instace's public IP. Get the instance's public IP from terraform output and put it in your browser.

codedeploy-terraform's People

Contributors

artemmkin 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.