provider.logRetentionInDays not working as expected

2k Views Asked by At

I am using serverless framework version 2.11.0

When trying to deploy, it is throwing serverless error:

Configuration error at 'provider.logRetentionInDays': should be equal to one of the allowed values

But it is not showing any allowed values. Also in my case I am giving the value as 90 (Integer). Anything which I am doing wrong?

2

There are 2 best solutions below

3
On

I got same warning when I used the value as 2 (Integer). I checked in aws cloudwatch log retention settings. It lists some options as this image. Then I changed the value to 3, which is in the list, the warning message was disappeared.

0
On

The serverless plugin for setting logRetention internally uses the PutRetentionPolicy AWS api to set up the logRetentionPolicy by which we can set up a retention period. The api accepts only a set of valid values for the retention days as you can see in this link.

Also to make it never expire we simply don't have to set it to any logRetentionPolicy. (Reference)