CloudFormation QuickstartΒΆ

  1. Prepare the project directory. See Repo Structure for more details.

    $ mkdir my-app && cd my-app
    $ git init && git checkout -b ENV-dev
    
  2. Download/install Runway. To see available install methods, see Installation.

  3. Use Runway to generate a sample CloudFormation Module, edit the values in the environment file, and create a Runway Config File to use the Module.

    $ runway gen-sample cfn
    $ sed -i -e "s/CUSTOMERNAMEHERE/mydemo/g; s/ENVIRONMENTNAMEHERE/dev/g; s/cfngin-/cfngin-$(uuidgen|tr "[:upper:]" "[:lower:]")-/g" sampleapp.cfn/dev-us-east-1.env
    $ cat <<EOF >> runway.yml
    ---
    # Full syntax at https://github.com/rackspace/runway
    deployments:
      - modules:
          - sampleapp.cfn
        regions:
          - us-east-1
    EOF
    
    $ runway gen-sample cfn
    $ (Get-Content sampleapp.cfn\dev-us-east-1.env).replace('CUSTOMERNAMEHERE', 'mydemo') | Set-Content sampleapp.cfn\dev-us-east-1.env
    $ (Get-Content sampleapp.cfn\dev-us-east-1.env).replace('ENVIRONMENTNAMEHERE', 'dev') | Set-Content sampleapp.cfn\dev-us-east-1.env
    $ (Get-Content sampleapp.cfn\dev-us-east-1.env).replace('cfngin-', 'cfngin-' + [guid]::NewGuid() + '-') | Set-Content sampleapp.cfn\dev-us-east-1.env
    $ $RunwayTemplate = @"
    ---
    # Full syntax at https://github.com/rackspace/runway
    deployments:
      - modules:
          - sampleapp.cfn
        regions:
          - us-east-1
    "@
    $RunwayTemplate | Out-File -FilePath runway.yml -Encoding ASCII
    
  4. Deploy the stack.

    $ runway deploy
    

Now our stack is available at mydemo-dev-sampleapp, e.g.:

$ aws cloudformation describe-stack-resources --region us-east-1 --stack-name mydemo-dev-sampleapp