GithubHelp home page GithubHelp logo

widdix / parameter-store-cloudformation-codepipeline Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 12.0 6 KB

Configure your CloudFormation managed infrastructure with Parameter Store and CodePipeline

Home Page: https://cloudonaut.io/configure-your-cloudformation-managed-infrastructure-with-parameter-store-and-codepipeline/

cloudformation aws-cloudformation parameter-store ssm-parameter-store codepipeline aws-codepipeline

parameter-store-cloudformation-codepipeline's Introduction

Configure your CloudFormation managed infrastructure with Parameter Store and CodePipeline

Code for my blog post: Configure your CloudFormation managed infrastructure with Parameter Store and CodePipeline

Setup instructions

Have you installed and configured the AWS CLI?

  1. Clone this repository git clone https://github.com/widdix/parameter-store-cloudformation-codepipeline.git download the ZIP file](https://github.com/widdix/parameter-store-cloudformation-codepipeline/archive/master.zip)
  2. cd parameter-store-cloudformation-codepipeline/
  3. Create parameter in Parameter Store: aws ssm put-parameter --name '/application/stage/instancetype' --value 't2.micro' --type String
  4. Create pipeline stack with CloudFormation: aws cloudformation create-stack --stack-name cloudonaut --template-body file://pipeline.yaml --capabilities CAPABILITY_IAM
  5. Wait until CloudFormation stack is created: aws cloudformation wait stack-create-complete --stack-name cloudonaut
  6. Push files to the CodeCommit repository created by the pipeline stack (I don't use git push here to skip the git configuration):
    1. COMMIT_ID="$(aws codecommit put-file --repository-name cloudonaut --branch-name master --file-content file://infrastructure.yaml --file-path infrastructure.yaml --query commitId --output text)"
    2. COMMIT_ID="$(aws codecommit put-file --repository-name cloudonaut --branch-name master --parent-commit-id $COMMIT_ID --file-content file://infrastructure.json --file-path infrastructure.json --query commitId --output text)"
    3. COMMIT_ID="$(aws codecommit put-file --repository-name cloudonaut --branch-name master --parent-commit-id $COMMIT_ID --file-content file://vpc-2azs.yaml --file-path vpc-2azs.yaml --query commitId --output text)"
  7. Wait until the first pipeline run is finished: open 'https://console.aws.amazon.com/codepipeline/home#/view/cloudonaut'
  8. Visit the website exposed by the EC2 instance: open "http://$(aws cloudformation describe-stacks --stack-name cloudonaut-infrastructure --query "Stacks[0].Outputs[0].OutputValue" --output text)"
  9. Update the parameter value: aws ssm put-parameter --name '/application/stage/instancetype' --value 't2.nano' --type String --overwrite (t2.nano is outside th Free Tier, expect charges of a few cents)
  10. Wait until the second pipeline run is finished: open 'https://console.aws.amazon.com/codepipeline/home#/view/cloudonaut'
  11. Visit the website exposed by the EC2 instance: open "http://$(aws cloudformation describe-stacks --stack-name cloudonaut-infrastructure --query "Stacks[0].Outputs[0].OutputValue" --output text)"

Clean up instructions

  1. Remove CloudFormation stacks
    1. aws cloudformation delete-stack --stack-name cloudonaut-infrastructure
    2. aws cloudformation wait stack-delete-complete --stack-name cloudonaut-infrastructure
    3. aws cloudformation delete-stack --stack-name cloudonaut-vpc
    4. aws cloudformation wait stack-delete-complete --stack-name cloudonaut-vpc
    5. aws cloudformation delete-stack --stack-name cloudonaut
    6. aws cloudformation wait stack-delete-complete --stack-name cloudonaut
  2. Remove S3 bucket prefixed with cloudonaut-artifactsbucket- including all files: open "https://s3.console.aws.amazon.com/s3/home"
  3. Remove Parameter Store parameter: aws ssm delete-parameter --name '/application/stage/instancetype'

parameter-store-cloudformation-codepipeline's People

Contributors

michaelwittig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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