Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws cloudformation package generates invalid TemplateURL #2314

Closed
jkit opened this issue Dec 9, 2016 · 3 comments
Closed

aws cloudformation package generates invalid TemplateURL #2314

jkit opened this issue Dec 9, 2016 · 3 comments
Labels
bug This issue is a bug. cloudformation package-deploy customization Issues related to CLI customizations (located in /awscli/customizations)

Comments

@jkit
Copy link

jkit commented Dec 9, 2016

Description

The aws cloudformation package replaces local paths with an s3:// URL, however, nested stacks in a CloudFormation template require that the TemplateURL is specified as a https://s3.amazonaws.com/... URL.

Environment

aws --version
aws-cli/1.11.27 Python/2.7.10 Darwin/16.1.0 botocore/1.4.84

Repro Steps

1. Create A Simple Stack

# simple-bucket.yml
Resources:
  SimpleBucket:
    Properties:
      AccessControl: Private
      BucketName: some-bucket
    Type: AWS::S3::Bucket

2. Create A Stack With a Nested Stack

# nested-bucket.yml
Resources:
  NestedBucket:
    Type: "AWS::CloudFormation::Stack"
    Properties:
      TemplateURL: simple-bucket.yml

3. Generate New Template with aws cloudformation package

aws cloudformation package \
  --template-file nested-bucket.yml \
  --s3-bucket templates \
  --output-template-file package-template.yml

This generates package-template.yml:

Resources:
  NestedBucket:
    Properties:
      TemplateURL: s3://templates/2605eb3b081bda5a3e38952c8e4b70a4.template
    Type: AWS::CloudFormation::Stack

4. Deploy Generated Template

aws cloudformation deploy \
  --template-file package-template.yml \
  --stack-name TestStack

This fails with:

The specified url must be an Amazon S3 URL.

Workaround

If I change TemplateURL from s3://templates/2605eb3b081bda5a3e38952c8e4b70a4.template to https://s3.amazonaws.com/templates/f8b1a0b3844e6eea8ff045565f5b0b7e.template and rerun the deploy command. It works fine.

@djamison
Copy link
Member

@jkit's workaround worked for me.

@kyleknap
Copy link
Member

I can confirm this issue. We are working on a fix.

@jamesls
Copy link
Member

jamesls commented Jan 6, 2017

Should be fixed via #2360

@jamesls jamesls closed this as completed Jan 6, 2017
@kdaily kdaily added the customization Issues related to CLI customizations (located in /awscli/customizations) label Nov 12, 2020
thoward-godaddy pushed a commit to thoward-godaddy/aws-cli that referenced this issue Feb 12, 2022
* Move black install to dev.txt and update doc/appveyor

* Update pre-commit

* Format using black 20.8b1

* Add workaround for IDE black setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. cloudformation package-deploy customization Issues related to CLI customizations (located in /awscli/customizations)
Projects
None yet
Development

No branches or pull requests

5 participants