aws-cloudformation / aws-cloudformation-resource-providers-logs

The CloudFormation Resource Provider Package For Amazon CloudWatch Logs
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html
Apache License 2.0
33 stars 35 forks source link

Support all documented retentionInDays values #94

Open phs opened 2 years ago

phs commented 2 years ago

If we look in the cloudformation docs for the log group resource, we see these allowed values in the retentionInDays field:

The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 2192, 2557, 2922, 3288, and 3653.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html

However when I try to use value 2557 in a cloudformation template, I get an error:

Model validation failed (#/RetentionInDays: #: only 1 subschema matches out of 2)
#/RetentionInDays: failed validation constraint for keyword [enum] (#/RetentionInDays)

If we look in the source to see the actual schema, we see (for example) that 2557 does not appear in the list.

https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-logs/blob/19f04fec2f9689e1b64cca96101e05395bbad7d3/aws-logs-loggroup/aws-logs-loggroup.json#L44-L66

When I use the AWS console I can successfully choose 2557 (or rather, seven years). So it seems the schema in this repository is missing some entries.