Skip to content

Commit

Permalink
Merge pull request #25729 from fdmsantos/f-aws_rds_cluster_instance-a…
Browse files Browse the repository at this point in the history
…llow-monthly-perfinsight

Make aws_rds_cluster_instance resource support monthly performance insights retention period
  • Loading branch information
ewbankkit authored Jul 8, 2022
2 parents 082b47f + 072e42b commit 0cfafc0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .changelog/25729.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_rds_cluster_instance: Allow `performance_insights_retention_period` values that are multiples of `31`
```
15 changes: 11 additions & 4 deletions internal/service/rds/cluster_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,17 @@ func ResourceClusterInstance() *schema.Resource {
},

"performance_insights_retention_period": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
ValidateFunc: validation.IntInSlice([]int{7, 731}),
Type: schema.TypeInt,
Optional: true,
Computed: true,
ValidateFunc: validation.Any(
validation.IntInSlice([]int{7, 731}),
validation.All(
validation.IntAtLeast(7),
validation.IntAtMost(731),
validation.IntDivisibleBy(31),
),
),
},

"copy_tags_to_snapshot": {
Expand Down
8 changes: 8 additions & 0 deletions internal/service/rds/cluster_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,14 @@ func TestAccRDSClusterInstance_performanceInsightsRetentionPeriod(t *testing.T)
resource.TestCheckResourceAttr(resourceName, "performance_insights_retention_period", "7"),
),
},
{
Config: testAccClusterInstanceConfig_performanceInsightsRetentionPeriod(rName, 155),
Check: resource.ComposeTestCheckFunc(
testAccCheckClusterInstanceExists(resourceName, &dbInstance),
resource.TestCheckResourceAttr(resourceName, "performance_insights_enabled", "true"),
resource.TestCheckResourceAttr(resourceName, "performance_insights_retention_period", "155"),
),
},
},
})
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/rds_cluster_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ what IAM permissions are needed to allow Enhanced Monitoring for RDS Instances.
* `auto_minor_version_upgrade` - (Optional) Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window. Default `true`.
* `performance_insights_enabled` - (Optional) Specifies whether Performance Insights is enabled or not.
* `performance_insights_kms_key_id` - (Optional) ARN for the KMS key to encrypt Performance Insights data. When specifying `performance_insights_kms_key_id`, `performance_insights_enabled` needs to be set to true.
* `performance_insights_retention_period` - (Optional) Amount of time in days to retain Performance Insights data. Either 7 (7 days) or 731 (2 years). When specifying `performance_insights_retention_period`, `performance_insights_enabled` needs to be set to true. Defaults to '7'.
* `performance_insights_retention_period` - (Optional) Amount of time in days to retain Performance Insights data. Valida values are `7`, `731` (2 years) or a multiple of `31`. When specifying `performance_insights_retention_period`, `performance_insights_enabled` needs to be set to true. Defaults to '7'.
* `copy_tags_to_snapshot` – (Optional, boolean) Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance. Default `false`.
* `ca_cert_identifier` - (Optional) The identifier of the CA certificate for the DB instance.
* `tags` - (Optional) A map of tags to assign to the instance. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
Expand Down

0 comments on commit 0cfafc0

Please sign in to comment.