Coder Social home page Coder Social logo

Comments (14)

philipakash avatar philipakash commented on May 22, 2024 1

@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.

sanathkr avatar sanathkr commented on May 22, 2024 1

@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.

sanathkr avatar sanathkr commented on May 22, 2024

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.

 avatar commented on May 22, 2024

@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.

sanathkr avatar sanathkr commented on May 22, 2024

@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.

 avatar commented on May 22, 2024

Thanks @sanathkr ! Much clearer now.

from serverless-application-model.

terodox avatar terodox commented on May 22, 2024

+1 on this. A lack of redeployment when swagger changes is creating a lot of extra work right now.

from serverless-application-model.

sanathkr avatar sanathkr commented on May 22, 2024

This has been fixed. Your API would be redeployed when Swagger changes.

from serverless-application-model.

terodox avatar terodox commented on May 22, 2024

Which version is this fix in? I did not see a commit mentioned in this bug thread?

from serverless-application-model.

sanathkr avatar sanathkr commented on May 22, 2024

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.

terodox avatar terodox commented on May 22, 2024

Thank you for the info! Is this live in all regions supporting SAM?

from serverless-application-model.

sanathkr avatar sanathkr commented on May 22, 2024

Yes indeed

from serverless-application-model.

philipakash avatar philipakash commented on May 22, 2024

^

from serverless-application-model.

mputilin avatar mputilin commented on May 22, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.