CloudFormation Quickstart
Prepare the project directory. See Repo Structure for more details.
$ mkdir my-app && cd my-app $ git init && git checkout -b ENV-dev
Download/install Runway. To see available install methods, see Installation.
Use Runway to generate a sample CloudFormation module<runway-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/onicagroup/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/onicagroup/runway deployments: - modules: - sampleapp.cfn regions: - us-east-1 "@ $RunwayTemplate | Out-File -FilePath runway.yml -Encoding ASCII
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