Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_cloudwatch_log_group: Allow a three year retention period (1096 days) #29426

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/29426.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_cloudwatch_log_group: Allow `retention_in_days` attribute to accept a three year retention period (1096 days)
```
2 changes: 1 addition & 1 deletion internal/service/logs/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func resourceGroup() *schema.Resource {
Type: schema.TypeInt,
Optional: true,
Default: 0,
ValidateFunc: validation.IntInSlice([]int{0, 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 2192, 2557, 2922, 3288, 3653}),
ValidateFunc: validation.IntInSlice([]int{0, 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, 3653}),
},
"skip_destroy": {
Type: schema.TypeBool,
Expand Down
7 changes: 7 additions & 0 deletions internal/service/logs/group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@ func TestAccLogsGroup_retentionPolicy(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "retention_in_days", "365"),
),
},
{
Config: testAccGroupConfig_retentionPolicy(rName, 1096),
Check: resource.ComposeTestCheckFunc(
testAccCheckGroupExists(ctx, t, resourceName, &v),
resource.TestCheckResourceAttr(resourceName, "retention_in_days", "1096"),
),
},
{
ResourceName: resourceName,
ImportState: true,
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/cloudwatch_log_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The following arguments are supported:
* `name_prefix` - (Optional, Forces new resource) Creates a unique name beginning with the specified prefix. Conflicts with `name`.
* `skip_destroy` - (Optional) Set to true if you do not wish the log group (and any logs it may contain) to be deleted at destroy time, and instead just remove the log group from the Terraform state.
* `retention_in_days` - (Optional) Specifies the number of days
you want to retain 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, 3653, and 0.
you want to retain 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, 1096, 1827, 2192, 2557, 2922, 3288, 3653, and 0.
If you select 0, the events in the log group are always retained and never expire.
* `kms_key_id` - (Optional) The ARN of the KMS Key to use when encrypting log data. Please note, after the AWS KMS CMK is disassociated from the log group,
AWS CloudWatch Logs stops encrypting newly ingested data for the log group. All previously ingested data remains encrypted, and AWS CloudWatch Logs requires
Expand Down