serverless-application-model icon indicating copy to clipboard operation
serverless-application-model copied to clipboard

S3 Integration definitions in OpenAPI document are dropped in cloudformation processing

Open k3vur opened this issue 4 years ago • 2 comments

Description:

I have a SAM Project with an embedded OpenAPI file. This OpenAPI file contains definitions to integrate S3 via x-amazon-apigateway-integration of type aws. If I import this OpenAPI file directly on the API Gateway console, it works fine. If I do a sam deploy, those S3 endpoints don't get deployed. When I check the processed template in Cloudformation Console, those endpoints have been stripped away - the unprocessed template still shows them.

Steps to reproduce the issue:

  1. Create a template.yaml file with included OpenAPI Definition
  2. In the OpenAPI definition, create S3 integration via x-amazon-apigateway-integration of type aws
  3. Run sam deploy
  4. Check deployed API / processed Cloudformation Template

Observed result:

S3 Integration Endpoints are not there

Expected result:

I expect S3 Integration Endpoints to be there

k3vur avatar Mar 24 '20 09:03 k3vur

@k3vur What type of API are you using? Could you give us a sample template to reproduce the issue?

ShreyaGangishetty avatar Mar 24 '20 18:03 ShreyaGangishetty

I was trying to provide S3 Upload / Download through API Gateway. The template.yaml file contains an inline OpenAPI spec with x-amazon-apigateway-integration addons. As I already said, pasting the OpenAPI spec into the API Gateway Console import function (and un-indenting by 4 levels), it imports alright and works.

The Lambda function under /generate imports fine via sam deploy though.

I attached the template.yaml file and edited out our IAM Role arns and bucket names.

template.yaml.txt

k3vur avatar Mar 25 '20 14:03 k3vur

Closing because Issue was due to using a reserved resource name and a fix was implemented in sam cli to warn users of this occuring 2907

sidhujus avatar Oct 12 '23 21:10 sidhujus