Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

provider.logRetentionInDays not working as expected

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?

like image 281
Saurav Dutta Avatar asked Oct 22 '25 09:10

Saurav Dutta


2 Answers

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.

like image 199
Dương Hoàng Nhựt Avatar answered Oct 27 '25 03:10

Dương Hoàng Nhựt


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)

like image 43
Varshni N Avatar answered Oct 27 '25 04:10

Varshni N