Comments (14)
@sanathkr correct me if this is not a bug . If I redeploy with a change in the stage name in the swagger its actually replacing the current stage and adding the new stage.
For Eg : suppose i deploy "dev" stage and then want the same code to be promoted to the "prod" stage in the same API gateway - API name, its is not happening .
from serverless-application-model.
@philipakash Yes, it will replace the stages. The recommended way with SAM is to create separate stacks for dev & prod. Your SAM file is the artifact that gets promoted from dev to prod.
from serverless-application-model.
There is a bug due to which your changes in Swagger file don't get redeployed. We are working on fixing it.
Enabling CloudWatch logs for APIGateway endpoint? At the moment you can't do it via SAM. Not the best idea, but you can enable it via the Console if you want - https://aws.amazon.com/premiumsupport/knowledge-center/api-gateway-cloudwatch-logs/
from serverless-application-model.
@sanathkr Can you provide details about this bug? Is it not getting redeployed because the S3 URL is the same, or is it not getting redeployed because the name didn't change? Or is it no getting redeployed because the S3 URL AND name didn't change?
Also, how can one specify the name of the API through the SAM template? I can't see any name property generated for the Gateway resource.
And one more question. We see that through console you can create two seperate API instances with the same name. But through SAM we couldn't achieve it. Is this possible? If not, is it not because of limitation of SAM, Cloudformation, or something else?
from serverless-application-model.
@Fogetti First of all, Swagger S3 URL must change to trigger a re-deployment. Secondly, there is a bug in the implementation that did not trigger a redeployment even if the S3 URL changed. We are working on fixing it
If you use a swagger file, you can set the name via Title property of info field. Otherwise you can't set name via SAM.
If you create two AWS::Serverless::Api resources with same name defined in the Swagger files, you will get two API instances with same name
from serverless-application-model.
Thanks @sanathkr ! Much clearer now.
from serverless-application-model.
+1 on this. A lack of redeployment when swagger changes is creating a lot of extra work right now.
from serverless-application-model.
This has been fixed. Your API would be redeployed when Swagger changes.
from serverless-application-model.
Which version is this fix in? I did not see a commit mentioned in this bug thread?
from serverless-application-model.
Just use your existing SAM template. It will start working. This package maintains only the specification. No changes required here. Fix was deployed to the backing service.
from serverless-application-model.
Thank you for the info! Is this live in all regions supporting SAM?
from serverless-application-model.
Yes indeed
from serverless-application-model.
^
from serverless-application-model.
@sanathkr
My API definition:
DeverAPI:
Type: AWS::Serverless::Api
Properties:
StageName: v1
CacheClusterSize: !Sub ${CacheClusterSize}
DefinitionBody:
Fn::Transform:
Name: AWS::Include
Parameters:
Location: !Sub s3://${ArtifactsBucket}/swagger/${SwaggerSpecificationFile}
When I'm changing ${SwaggerSpecificationFile}
I'm getting No updates are to be performed
I've added extra parameter ${CacheClusterSize}
just to make cloudformation update the stack, but update ignores changes in swagger file location.
I can't use DefinitionUri:
because I need to pass variables to swagger file.
Is there workaround for my case? I need to update API's without redeploy everything from scratch.
Thanks in advance.
from serverless-application-model.
Related Issues (20)
- "Invalid OpenAPI input" when OpenAPI set to `3.1.0` HOT 4
- AWS SAM Connector Write needs PutObjectTagging HOT 2
- Setting the runtime of a function to nodejs20.x causes sam validate to fail. HOT 2
- AWS::Serverless::Api - setting "OpenApiVersion" causes "Stage" deployment to be skipped - why? HOT 6
- [Test] GitHub Action automatic comments on GitHub closed Issue HOT 1
- AlwaysDeploy does not include GatewayResponse updates HOT 7
- Please explain how to version AWS::Serverless::Function artifacts cleanly HOT 11
- Bug: AWS::Serverless::Function Policies partly not applied HOT 8
- Cors error from SAM template and Auth enabled. HOT 3
- VSCode SAM Schema Validation Error with !Ref in Conditions Section HOT 7
- Bug: Creates unnecessary AWSLambdaVPCAccessExecutionRole role HOT 7
- Api CORS issue with 500 status after setup Cognito authorizer HOT 3
- Building features for AWS SAM HOT 4
- Can't reset BinaryMediaTypes to a default value for API Gateway REST API HOT 2
- AWS::Serverless::Api auto deploys API when a resource is being added HOT 4
- Environment variables not updated HOT 5
- Bug: Using a Ref in StageName is Not Working Properly - Template.yaml HOT 4
- !If not working on Serverless:Function handler HOT 5
- how to configure KMSVerifyPolicy and KMSSignPolicy HOT 1
- Feature request: Git sync HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless-application-model.