The resource was previously deployed. I have now enabled CORS and tried deploying. Now it throws error as below.
Serverless Error ---------------------------------------
An error occurred: ApiGatewayMethodPreviewOptions - Method already exists for this resource (Service: AmazonApiGateway; Status Code: 409; Error Code: ConflictException; Request ID: 15402480-8b5b-11e8-bbee-378f583b9f67).
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information -----------------------------
OS: darwin
Node Version: 8.11.1
Serverless Version: 1.28.0
Here is the snippet of the yaml configuration.
events:
- http:
path: preview
method: get
cors: true