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
demandé il y a 2 ans1240 vues
1 réponse
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
répondu il y a 2 ans
profile picture
INGÉNIEUR EN ASSISTANCE TECHNIQUE
vérifié il y a 2 ans
  • 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.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions