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
已提问 2 年前1240 查看次数
1 回答
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
已回答 2 年前
profile picture
支持工程师
已审核 2 年前
  • 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.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则