GithubHelp home page GithubHelp logo

dvla / serverless-apigateway-log-retention Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 8.0 33 KB

Control the retention of your AWS ApiGateway access logs and execution logs.

License: MIT License

JavaScript 100.00%
apigateway aws log logging serverless

serverless-apigateway-log-retention's People

Contributors

deepakthankachan avatar mikkopiu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

serverless-apigateway-log-retention's Issues

plugin failing to retrieve restApi Id under proxy settings

Hello,

Thank you for the awesome plugin!

We have been using it in production since last year and it worked well until we decided to migrate the pipeline under our organization's docker instances. As a side effect, the plugin can no longer retrieve the restApi Id and returns connect ETIMEDOUT xx.xxx.85.247:443

Is there any way we can provide a proxy config to the plugin?

Support of custom API name

Hi

Thanks for sharing your plugin!
I had a bit of trouble getting a custom API name other than [STAGE]-[SERVICE_NAME]. However, There is no option to set it up.
This requirement can be met with other developes as well.

Plugin requires AWS_PROFILE to be set in shell (or default profile)

Thanks for sharing your plugin!

I had a bit of trouble getting it to work initially - I found that I needed to make sure the AWS_PROFILE variable was set in the shell to get the API call to work to API gateway.

We are passing --aws-profile as a custom option in our deployment toolchain, which we use to set profile on the provider, and that didn't work with this plugin, probably because of the direct call with the SDK here: https://github.com/dvla/serverless-apigateway-log-retention/blob/master/src/serverlessApigatewayLogRetentionPlugin.js#L23

Once I set AWS_PROFILE in the shell everywhere, it worked OK.

However, in the end I actually found serverless framework can set the log retention itself on the provider for API gateway, though it doesn't seem to be documented on the configuration page - see here:

https://github.com/serverless/serverless/blob/v2/lib/plugins/aws/package/compile/events/apiGateway/lib/stage.js#L113

I ended up not needing to use this plugin, because of the logRetentionInDays parameter: https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml#general-function-settings

So if anyone needs to set just a single log retention value for both lambda and API gateway, that's the simplest option.

I missed that when reading the API gateway docs, so just thought I'd let you know in case it's useful to you or anyone else.

The same goes for the serverless-plugin-log-retention which now does exactly the same thing as serverless core as far as I can tell.

v0.0.6 failing with syntax error

Hello,

I'm facing syntax error issue

  Syntax Error -------------------------------------------
 
  node_modules/serverless-apigateway-log-retention/src/serverlessApigatewayLogRetentionPlugin.js:36
          const apiName = this.serverless.service.provider.apiGateway?.shouldStartNameWithService
                                                                      ^
  
  SyntaxError: Unexpected token '.'

Can you help with it?

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.