Skip to content

AWS::Serverless::Api and AWS::Serverless::HttpApi have slightly different CORS origin property names #3647

Closed
@mcavag

Description

@mcavag

The CorsConfiguration for AWS::Serverless::Api includes the following properties:

  AllowHeaders: String
  AllowMethods: String
  AllowOrigin: String <-- No S on the end of 'AllowOrigin'

The HttpApiCorsConfiguration for AWS::Serverless::HttpApi includes these properties:

 AllowHeaders: List
 AllowMethods: List
 AllowOrigins: List <-- But this one does have one

If you switch from a REST API to HTTP API and retain the same CORS configuration, you will get an error from this line of code:

Invalid value for 'Cors' property.

This is a difficult error to figure out. I ended up having to read the source code.

If the property name can't be changed, it would at least be helpful to include the name of the invalid property in the error message as a clue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions