-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AlwaysDeploy does not include GatewayResponse updates #3482
Comments
Hi there, thanks for opening an issue. It would often result in weird behaviour if you mix SAM resources with regular CloudFormation resources. I would recommend defining the gateway response as part of the openapi specification in
|
Thanks @GavinZZ, unfortunately, I don't think this will work for my use case. The responses I'm manipulating are generated by the CognitoAuthorizer, not by any of my mapped endpoints. As far as I understand things, your solution would require the request getting past the authorizer before those response transformations were implemented. |
@mousedownmike I spent some time and wrote an example following your description. However, I cannot reproduce this problem. I'm using a simple template like the following
Note that this template includes a SAM API, a Then I proceeded with updating the
I then tried to deploy this updated template again and I am able to deploy it and I can see changes reflected in the console as well. So I'm not able to reproduce the issue described. To be super clear, this problem is not related to |
@GavinZZ, thank you for your time on this. Without using an Authorizer on the API, I don't think it replicates the experience I was having. To be clear, I do see the changes reflected in the console when I apply the template. The problem is that they don't actually function for responses generated by the Authorizer. From my understanding of what you're saying, it sounds like that's expected. I might recommend a minor documentation update for the Ultimately, I've decided not to use the GatewayResponse resources because they just don't offer the flexibility I was hoping for... specifically, no |
|
|
@mousedownmike thanks for the suggestion, I'm going to create a task internally for doc update to clearly state the limitation of
That's definitely not expected, but all SAM Transform does it to transform the template into standard CloudFormation template. Specifically in your scenario, this problem seems to be an issue on ApiGateway side or CloudFormation side. Unfortunately, there's not much SAM can do since the transformed template looks valid. |
Description
Setting
AlwaysDeploy: true
on anAWS::Serverless::Api
resource does not pick up changes toAWS::ApiGateway::GatewayResponse
resources when the API is deployed.AlwaysDeploy
was introduced in #2935Steps to reproduce
AWS::Serverless::Api
and aAWS::ApiGateway::GatewayResponse
that references the API in theRestApiId
property.AlwaysDeploy
property on the API to betrue
.AWS::ApiGateway::GatewayResponse
in some fashion.Observed result
Expected result
I expected the API Deployment to pick up the changes to the GatewayResponse properties.
Work Around
Manually deploying the API in the AWS API Gateway Console causes the GatewayResponse changes to be picked up.
Additional environment details
Here is a snippet of my SAM template where I am experiencing this:
The text was updated successfully, but these errors were encountered: