# ./template.yaml
AWSTemplateFormatVersion: 2010-09-09
Parameters:
BucketName:
Type: String
Resources:
Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Ref BucketName
# ./params.yaml
BucketName: my-bucket-xyz
#!/bin/bash
# ./deploy.sh
stack_name=my-stack
template_path=./template.yaml
parameter_values_path=./params.yaml
aws cloudformation deploy \
--stack-name $stack_name \
--template-file $template_path \
--parameter-overrides $(yq -r 'to_entries | .[] | "\(.key)=\(.value)"' $parameter_values_path) \
--no-fail-on-empty-changeset