You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the following CloudFormation snippet called input.yml:
Resources:
RestApi:
Type: AWS::ApiGateway::RestApiProperties:
ApiKeySourceType: HEADERBody:
Fn::Transform:
Name: AWS::IncludeParameters:
Location: s3://<bucket-name>/<object-key>Description: APIEndpointConfiguration:
Types:
- PRIVATEFailOnWarnings: trueName: My API
When I run $ rain fmt input.yml > output.yml, the contents of output.yml are:
AWSTemplateFormatVersion: "2010-09-09"Resources:
RestApi:
Type: AWS::ApiGateway::RestApiProperties:
ApiKeySourceType: HEADERBody: !TransformName: AWS::IncludeParameters:
Location: s3://<bucket-name>/<object-key>Description: My APIEndpointConfiguration:
Types:
- PRIVATEFailOnWarnings: trueName: API
If I deploy this formatted template in CloudFormation, deployment fails with the following message:
An error occurred (ValidationError) when calling the ValidateTemplate operation: Template format error: YAML not well-formed.
Unfortunately, I cannot make use of S3BodyLocation (instead of Body), as our OpenAPI specification contains CloudFormation functions which are not substituted when used with S3BodyLocation (see this issue).
If used, the following message is shown for the CREATE_FAILED status:
Unable to parse API definition because of a malformed integration at path /an/example/path. (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException; Request ID: REDACTED; Proxy: null)
The AWS::Include transform documentation could be related, as it mentions the following:
We don't currently support using shorthand notations for YAML snippets.
The text was updated successfully, but these errors were encountered:
tomirio619
changed the title
Format of CloudFormation template that uses Fn::Transform within a section yields invalid template
Format of CloudFormation template that uses Fn::Transform invalid template
Apr 22, 2021
tomirio619
changed the title
Format of CloudFormation template that uses Fn::Transform invalid template
Format of CloudFormation template that uses Fn::Transform yields invalid template
Apr 22, 2021
Thanks for this! After some digging, it seems the Transform function just doesn't support the YAML tag-style notation. I will prevent Fn::Transform from being modified by rain fmt in the next release.
I have the following CloudFormation snippet called
input.yml
:When I run
$ rain fmt input.yml > output.yml
, the contents ofoutput.yml
are:If I deploy this formatted template in CloudFormation, deployment fails with the following message:
Unfortunately, I cannot make use of
S3BodyLocation
(instead ofBody
), as our OpenAPI specification contains CloudFormation functions which are not substituted when used withS3BodyLocation
(see this issue).If used, the following message is shown for the
CREATE_FAILED
status:The
AWS::Include
transform documentation could be related, as it mentions the following:The text was updated successfully, but these errors were encountered: