create-stack.sh
A compact CLI script for provisioning infrastructure with CloudFormation stacks.
- Uploads a CloudFormation template to S3
- Creates a stack with the uploaded template
- Uses stack parameters from a JSON file
Example usage in Bash:
stack_name=test-vpc \
region=eu-west-1 \
profile=ttc-dev \
stack_template=vpc.yml \
s3_bucket_name=ttc-releases-aws-dev \
s3_key=myproject/mystack \
stack_parameters=file://params.json \
./create-stack.sh
JSON parameter file example:
Parameter JSON file should be formatted as per AWS CLI documentation:
[
{
"ParameterKey": "Project",
"ParameterValue": "TestVPC"
},
{
"ParameterKey": "Environment",
"ParameterValue": "Dev"
}
]