amazon-archives / realworld-serverless-application

This project is inspired by the design and development of the AWS Serverless Application Repository - a production-grade AWS service. Learn how AWS built a production service using serverless technologies.
Apache License 2.0
515 stars 108 forks source link

Cloudformation Stack fails with "Transform AWS::Include failed with: The location parameter is not a valid S3 uri." #58

Closed dhawalkp closed 4 years ago

dhawalkp commented 4 years ago

I am trying to build from source after doing certain changes in the parent sam template. I followed the instructions in the wiki and cloudformation stack failed with the below error

Error Message: "Transform AWS::Include failed with: The location parameter is not a valid S3 uri." Nested Cloudformation Template giving this error: The template creating the API Gateway and Lambda resources for the backend. This template is the output of "aws cloudformation package" command by the root pom.xml.

Investigation: After having a quick look, i found that the "aws cloudformation package" did not replace the local path referencing the swagger yaml file which is below DefinitionBody: Fn::Transform: Name: AWS::Include Parameters: Location: ../../swagger/api.yaml

Which basically lead to failure. Workaround: I manually changed the location attribute to reflect the relevant template file in my S3 bucket with s3 uri scheme.

Expectations: it should have replaced it with S3 URL in the first place

honglu commented 4 years ago

Which AWS CLI version do you have? The minimum version requirement for AWS CLI is 1.16.66. If you have an older version of AWS CLI, you will need to upgrade it. You can run the following command to check your AWS CLI version:

aws --version
dhawalkp commented 4 years ago

I am using aws-cli/1.16.71 Python/2.7.10 Darwin/16.7.0 botocore/1.12.61

honglu commented 4 years ago

Sorry the required version should be 1.16.84. I will update the quick start guide.

honglu commented 4 years ago

I was able to package the deploy the template successfully in us-west-2 using this version of AWS CLI:

aws-cli/1.16.212 Python/3.7.4 Darwin/18.7.0 botocore/1.12.202