How to debug "Transform AWS::Include failed with: The location parameter is not a valid S3 uri."

0

I have a CloudFormation template (YAML) that includes the following:

        Fn::Transform:
          Name: AWS::Include
          Parameters:
            Location:
              Fn::Sub: s3://${TemplatePath}/${SnippetFile}

Although I have verified the validity and accessibility of the S3 path with the expected values of these variables, the output fails with "Transform AWS::Include failed with: The location parameter is not a valid S3 uri." There is nothing to indicate the path it tried to use, so I'm not sure how to debug. There appears to be nothing useful in either the console or the output.

Questions:

  1. Have I done something obviously wrong syntactically? (I don't normally use the long-form functions but need them here for reasons not relevant to the question)
  2. How do I debug in the absence of more detailed error messages?
  • The only thing I can think of is the TemplatePath or SnippetFile does not have intended values.

Ed
asked 2 years ago1190 views
1 Answer
0

Hello Ed,

The error "Transform AWS::Include failed with: The location parameter is not a valid S3 uri" occurs when the S3 URI that CloudFormation expects is in an incorrect format. CloudFormation expects a valid S3 URI such as s3://MyAmazonS3BucketName/MyFileName.json.

Note that using long hand 'Fn::Sub' is fine. However, because I do not know the resolved values of the variables and template, I recommend that you carry out a test where the S3 URI is passed directly with resolved values in a correct format such as;


'Fn::Transform':
  Name: 'AWS::Include'
  Parameters:
    Location: s3://MyAmazonS3BucketName/MyFileName.yaml

If the test works successfully, it will help narrow down the issue to the variables not resolving properly. To further troubleshoot the cause of issue, we require details that are non-public information. Please open a support case with AWS using the following link

AWS
answered 2 years ago
profile picture
SUPPORT ENGINEER
reviewed 2 years ago
  • I did contact support, and we eventually determined that the short form !Sub will work in this context, but Fn::Sub will not. They're forwarding that to the internal team. I'll try to remember to post back here if I learn anything further.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions