You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
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 setprofile
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#L23Once 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-settingsSo 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.
The text was updated successfully, but these errors were encountered: