gofaas
gofaas copied to clipboard
Change Sets
It might be nice to display the CloudFormation deploy change set:
Something like this but it needs to wait for the change set execute like cloudformation deploy
does.
deploy: BUCKET = pkgs-$(shell aws sts get-caller-identity --output text --query 'Account')-$(AWS_REGION)
deploy:
@aws s3api head-bucket --bucket $(BUCKET) || aws s3 mb s3://$(BUCKET) --region $(AWS_REGION)
@aws cloudformation package --output-template-file out.yml --s3-bucket $(BUCKET) --template-file template.yml
@aws cloudformation deploy --capabilities CAPABILITY_NAMED_IAM --no-execute-changeset --template-file out.yml --stack-name $(APP)
@aws cloudformation describe-change-set \
--change-set-name $$(aws cloudformation list-change-sets --stack-name gofaas --output text --query 'Summaries[0].ChangeSetName') \
--output table \
--query 'Changes[*].{Action:ResourceChange.Action,Resource:ResourceChange.LogicalResourceId,Type:ResourceChange.ResourceType,Replacement:ResourceChange.Replacement,Target:ResourceChange.Details[0].Target.Name}' \
--stack-name $(APP)
@aws cloudformation execute-change-set \
--change-set-name $$(aws cloudformation list-change-sets --stack-name gofaas --output text --query 'Summaries[0].ChangeSetName') \
--stack-name $(APP)
@aws cloudformation describe-stacks --output table --query 'Stacks[*].Outputs' --stack-name $(APP)