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년 전1237회 조회
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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠