Problem with Yaml key in Resources section (Cloudformation)

As part of my resources section I’m creating an API Gateway method (independent of lambda). I’m trying to set the IntegrationResponses using the Yaml like so:

Integration:
      IntegrationResponses:
        - StatusCode: 200
          ResponseParameters:
            method.response.header.Content-Type: integration.response.header.Content-Type

This is valid Cloudformation Yaml. However Serverless upon deploy converts it to JSON and uploads to S3. Looking at the JSON output the result is:

"ResponseParameters": {
  "method.response.header.Content-Type": "integration.response.header.Content-Type",
  "method": {
    "response": {
      "header": {
        "Content-Type": "integration.response.header.Content-Type"
      }
    }
  }
}

It appears that during the conversion to JSON the Yaml key is being separated by the dots and turned into a nested object. This is no longer valid Cloudformation and fails with

An error occurred while provisioning your stack: ServiceWorkerMethod
     - Value of property ResponseParameters must be an object with String (or simple type) properties.

How can I prevent this conversion. The expected output is also present, so how do I stop that nested object from being created. I have tried many many combinations of quotes and formatting with no luck.

Any thoughts?
Thanks

Fixed with patch release! https://github.com/serverless/serverless/releases/tag/v1.13.2

Thanks for the report!

Thank you. Everything is now working perfectly again.

1 Like