Closed andrewoh531 closed 7 years ago
Stackup's Ruby API does supports a :template_url
option, which can be used to reference templates stored in S3.
But I'm afraid the stackup
CLI and Rake tasks don't support external templates right now. It wouldn't be hard to add; I'll consider this a feature-request.
@andrewoh531: I've just released stackup v1.1.0
, which allows templates (and other things) to be specified as HTTP URLs, rather than local files. e.g.
stackup mystack up -t https://s3-ap-southeast-2.amazonaws.com/some-bucket/template.json
It even works for diff
, as well:
stackup mystack diff -t https://s3-ap-southeast-2.amazonaws.com/some-bucket/template.json
When the template URL refers to an object in S3, stackup
will just pass the reference to CloudFormation. In other cases, it will actually download the template itself, and pass it along; this means you could even pull a template from GitHub, or any other website.
Please give it a try, and let me know if it works for you.
@mdub thanks for the quick turn around. Tried testing it but got a ERROR: 403 Forbidden: "https://s3-ap-southeast-2.amazonaws.com/andrewoh-cloudformation-templates/ecs-service.yml"
.
I'm able to retrieve the object running an aws cp
command though.
Try making the object public, @andrewoh531.
I'm pretty sure this is a CloudFormation API constraint - the URL must be an HTTPS one, and is downloaded (by CF) over HTTPS, not the S3 protocol.
I think you'd hit the same limitation if you were using the AWS CLI.
Ah right. AWS CLI doesn't have that limitation. I'm able to run aws cloudformation create-stack
or update-stack
with the --template-url
parameter that references a non-public template in S3. It seems to be using the credentials used to execute the cfn
command.
If it's too much work that's ok. I'm using a workaround which pulls the template down first and references it locally.
Oh, you're quite right. I stuffed it up; fix coming soon.
Give v1.1.1
a try. I've been able to make it work with a non-public template in S3.
I'm calling this done. The feature is there now; raise another issue if it turns out to be buggy.
Thanks! Tested it out and it worked. Thanks for the quick turnaround!
Can templates existing in either S3 or Github be referenced? Can't see anything in the documentation and tried referencing a template in S3 but got a
ERROR: no such file
response.