Skip to content

Instantly share code, notes, and snippets.

@irgeek
Last active September 12, 2019 14:40
Show Gist options
  • Save irgeek/457802bd7ceea5170c8007e45fbac879 to your computer and use it in GitHub Desktop.
Save irgeek/457802bd7ceea5170c8007e45fbac879 to your computer and use it in GitHub Desktop.
Minimal test case to show aws-cli cloudformation package regression.
---
Resources:
GrandChild:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: grandchild.pyaml
---
Resources:
Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: grandchild-stack-bucket
S3_BUCKET := cf-templates-1wwumiwcx5krz-ap-southeast-2
S3_PREFIX := 8b87ca7b-869e-4401-baa0-ad0522e32f21
AWSCLI := .venv/bin/aws
all: parent.pyaml
parent.pyaml: child.pyaml
child.pyaml: grandchild.pyaml
grandchild.pyaml:
%.pyaml: %.yaml .venv
$(AWSCLI) cloudformation package \
--template-file $< \
--s3-bucket $(S3_BUCKET) \
--s3-prefix $(S3_PREFIX) \
--output-template-file $@
.venv:
@python3 -mvenv .venv
@.venv/bin/pip --quiet install --upgrade pip
ifneq ($(VERSION),)
@.venv/bin/pip --quiet install awscli==$(VERSION)
else
@.venv/bin/pip --quiet install awscli
endif
@$(AWSCLI) --version
@echo
.PHONY: clean
clean:
@find * -type f -name '*.pyaml' -delete
@rm -rf .venv
---
Resources:
Child:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: child.pyaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment