diff --git a/README.md b/README.md index 75e31f8..57fd38e 100644 --- a/README.md +++ b/README.md @@ -224,13 +224,13 @@ Terraform documentation is generated automatically using [pre-commit hooks](http | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.60 | +| [aws](#requirement\_aws) | >= 5.61 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.60 | +| [aws](#provider\_aws) | >= 5.61 | ## Modules @@ -285,6 +285,9 @@ No modules. | [cloudwatch\_log\_group\_skip\_destroy](#input\_cloudwatch\_log\_group\_skip\_destroy) | 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 | `bool` | `null` | no | | [cluster\_ca\_cert\_identifier](#input\_cluster\_ca\_cert\_identifier) | The CA certificate identifier to use for the DB cluster's server certificate. Currently only supported for multi-az DB clusters | `string` | `null` | no | | [cluster\_members](#input\_cluster\_members) | List of RDS Instances that are a part of this cluster | `list(string)` | `null` | no | +| [cluster\_performance\_insights\_enabled](#input\_cluster\_performance\_insights\_enabled) | Valid only for Non-Aurora Multi-AZ DB Clusters. Enables Performance Insights for the RDS Cluster | `bool` | `null` | no | +| [cluster\_performance\_insights\_kms\_key\_id](#input\_cluster\_performance\_insights\_kms\_key\_id) | Valid only for Non-Aurora Multi-AZ DB Clusters. Specifies the KMS Key ID to encrypt Performance Insights data. If not specified, the default RDS KMS key will be used (aws/rds) | `string` | `null` | no | +| [cluster\_performance\_insights\_retention\_period](#input\_cluster\_performance\_insights\_retention\_period) | Valid only for Non-Aurora Multi-AZ DB Clusters. Specifies the amount of time to retain performance insights data for. Defaults to 7 days if Performance Insights are enabled. Valid values are 7, month * 31 (where month is a number of months from 1-23), and 731 | `number` | `null` | no | | [cluster\_tags](#input\_cluster\_tags) | A map of tags to add to only the cluster. Used for AWS Instance Scheduler tagging | `map(string)` | `{}` | no | | [cluster\_timeouts](#input\_cluster\_timeouts) | Create, update, and delete timeout configurations for the cluster | `map(string)` | `{}` | no | | [cluster\_use\_name\_prefix](#input\_cluster\_use\_name\_prefix) | Whether to use `name` as a prefix for the cluster | `bool` | `false` | no | diff --git a/examples/autoscaling/README.md b/examples/autoscaling/README.md index fda84bc..3e116a4 100644 --- a/examples/autoscaling/README.md +++ b/examples/autoscaling/README.md @@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.60 | +| [aws](#requirement\_aws) | >= 5.61 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.60 | +| [aws](#provider\_aws) | >= 5.61 | ## Modules diff --git a/examples/autoscaling/versions.tf b/examples/autoscaling/versions.tf index 0f3bde3..97e87e8 100644 --- a/examples/autoscaling/versions.tf +++ b/examples/autoscaling/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.60" + version = ">= 5.61" } } } diff --git a/examples/global-cluster/README.md b/examples/global-cluster/README.md index b99853a..faa7ad4 100644 --- a/examples/global-cluster/README.md +++ b/examples/global-cluster/README.md @@ -20,15 +20,15 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.60 | +| [aws](#requirement\_aws) | >= 5.61 | | [random](#requirement\_random) | >= 2.2 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.60 | -| [aws.secondary](#provider\_aws.secondary) | >= 5.60 | +| [aws](#provider\_aws) | >= 5.61 | +| [aws.secondary](#provider\_aws.secondary) | >= 5.61 | | [random](#provider\_random) | >= 2.2 | ## Modules diff --git a/examples/global-cluster/versions.tf b/examples/global-cluster/versions.tf index 3f15dd6..f6b805a 100644 --- a/examples/global-cluster/versions.tf +++ b/examples/global-cluster/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.60" + version = ">= 5.61" } random = { diff --git a/examples/multi-az/README.md b/examples/multi-az/README.md index c725c72..4d06697 100644 --- a/examples/multi-az/README.md +++ b/examples/multi-az/README.md @@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.60 | +| [aws](#requirement\_aws) | >= 5.61 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.60 | +| [aws](#provider\_aws) | >= 5.61 | ## Modules diff --git a/examples/multi-az/main.tf b/examples/multi-az/main.tf index ea772ce..25dd353 100644 --- a/examples/multi-az/main.tf +++ b/examples/multi-az/main.tf @@ -38,6 +38,9 @@ module "aurora" { enabled_cloudwatch_logs_exports = ["postgresql"] + cluster_performance_insights_enabled = true + cluster_performance_insights_retention_period = 31 + # Multi-AZ availability_zones = module.vpc.azs allocated_storage = 256 diff --git a/examples/multi-az/versions.tf b/examples/multi-az/versions.tf index 0f3bde3..97e87e8 100644 --- a/examples/multi-az/versions.tf +++ b/examples/multi-az/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.60" + version = ">= 5.61" } } } diff --git a/examples/mysql/README.md b/examples/mysql/README.md index f2d8cf1..df25fb4 100644 --- a/examples/mysql/README.md +++ b/examples/mysql/README.md @@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.60 | +| [aws](#requirement\_aws) | >= 5.61 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.60 | +| [aws](#provider\_aws) | >= 5.61 | ## Modules diff --git a/examples/mysql/versions.tf b/examples/mysql/versions.tf index 0f3bde3..97e87e8 100644 --- a/examples/mysql/versions.tf +++ b/examples/mysql/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.60" + version = ">= 5.61" } } } diff --git a/examples/postgresql/README.md b/examples/postgresql/README.md index abb3e14..9c232a5 100644 --- a/examples/postgresql/README.md +++ b/examples/postgresql/README.md @@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.60 | +| [aws](#requirement\_aws) | >= 5.61 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.60 | +| [aws](#provider\_aws) | >= 5.61 | ## Modules diff --git a/examples/postgresql/versions.tf b/examples/postgresql/versions.tf index 0f3bde3..97e87e8 100644 --- a/examples/postgresql/versions.tf +++ b/examples/postgresql/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.60" + version = ">= 5.61" } } } diff --git a/examples/s3-import/README.md b/examples/s3-import/README.md index 167abc2..45b197f 100644 --- a/examples/s3-import/README.md +++ b/examples/s3-import/README.md @@ -49,13 +49,13 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.60 | +| [aws](#requirement\_aws) | >= 5.61 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.60 | +| [aws](#provider\_aws) | >= 5.61 | ## Modules diff --git a/examples/s3-import/versions.tf b/examples/s3-import/versions.tf index 0f3bde3..97e87e8 100644 --- a/examples/s3-import/versions.tf +++ b/examples/s3-import/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.60" + version = ">= 5.61" } } } diff --git a/examples/serverless/README.md b/examples/serverless/README.md index 0fcc889..820ada7 100644 --- a/examples/serverless/README.md +++ b/examples/serverless/README.md @@ -20,14 +20,14 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.60 | +| [aws](#requirement\_aws) | >= 5.61 | | [random](#requirement\_random) | >= 3.5 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.60 | +| [aws](#provider\_aws) | >= 5.61 | | [random](#provider\_random) | >= 3.5 | ## Modules diff --git a/examples/serverless/versions.tf b/examples/serverless/versions.tf index 464656a..4e533d7 100644 --- a/examples/serverless/versions.tf +++ b/examples/serverless/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.60" + version = ">= 5.61" } random = { source = "hashicorp/random" diff --git a/main.tf b/main.tf index 3976f1a..c82cdc4 100644 --- a/main.tf +++ b/main.tf @@ -71,17 +71,20 @@ resource "aws_rds_cluster" "this" { domain_iam_role_name = var.domain_iam_role_name iam_database_authentication_enabled = var.iam_database_authentication_enabled # iam_roles has been removed from this resource and instead will be used with aws_rds_cluster_role_association below to avoid conflicts per docs - iops = var.iops - kms_key_id = var.kms_key_id - manage_master_user_password = var.global_cluster_identifier == null && var.manage_master_user_password ? var.manage_master_user_password : null - master_user_secret_kms_key_id = var.global_cluster_identifier == null && var.manage_master_user_password ? var.master_user_secret_kms_key_id : null - master_password = var.is_primary_cluster && !var.manage_master_user_password ? var.master_password : null - master_username = var.is_primary_cluster ? var.master_username : null - network_type = var.network_type - port = local.port - preferred_backup_window = local.is_serverless ? null : var.preferred_backup_window - preferred_maintenance_window = var.preferred_maintenance_window - replication_source_identifier = var.replication_source_identifier + iops = var.iops + kms_key_id = var.kms_key_id + manage_master_user_password = var.global_cluster_identifier == null && var.manage_master_user_password ? var.manage_master_user_password : null + master_user_secret_kms_key_id = var.global_cluster_identifier == null && var.manage_master_user_password ? var.master_user_secret_kms_key_id : null + master_password = var.is_primary_cluster && !var.manage_master_user_password ? var.master_password : null + master_username = var.is_primary_cluster ? var.master_username : null + network_type = var.network_type + performance_insights_enabled = var.cluster_performance_insights_enabled + performance_insights_kms_key_id = var.cluster_performance_insights_kms_key_id + performance_insights_retention_period = var.cluster_performance_insights_retention_period + port = local.port + preferred_backup_window = local.is_serverless ? null : var.preferred_backup_window + preferred_maintenance_window = var.preferred_maintenance_window + replication_source_identifier = var.replication_source_identifier dynamic "restore_to_point_in_time" { for_each = length(var.restore_to_point_in_time) > 0 ? [var.restore_to_point_in_time] : [] @@ -89,7 +92,8 @@ resource "aws_rds_cluster" "this" { content { restore_to_time = try(restore_to_point_in_time.value.restore_to_time, null) restore_type = try(restore_to_point_in_time.value.restore_type, null) - source_cluster_identifier = restore_to_point_in_time.value.source_cluster_identifier + source_cluster_identifier = try(restore_to_point_in_time.value.source_cluster_identifier, null) + source_cluster_resource_id = try(restore_to_point_in_time.value.source_cluster_resource_id, null) use_latest_restorable_time = try(restore_to_point_in_time.value.use_latest_restorable_time, null) } } diff --git a/variables.tf b/variables.tf index 654405d..c17c5e4 100644 --- a/variables.tf +++ b/variables.tf @@ -102,6 +102,24 @@ variable "cluster_members" { default = null } +variable "cluster_performance_insights_enabled" { + description = "Valid only for Non-Aurora Multi-AZ DB Clusters. Enables Performance Insights for the RDS Cluster" + type = bool + default = null +} + +variable "cluster_performance_insights_kms_key_id" { + description = "Valid only for Non-Aurora Multi-AZ DB Clusters. Specifies the KMS Key ID to encrypt Performance Insights data. If not specified, the default RDS KMS key will be used (aws/rds)" + type = string + default = null +} + +variable "cluster_performance_insights_retention_period" { + description = "Valid only for Non-Aurora Multi-AZ DB Clusters. Specifies the amount of time to retain performance insights data for. Defaults to 7 days if Performance Insights are enabled. Valid values are 7, month * 31 (where month is a number of months from 1-23), and 731" + type = number + default = null +} + variable "copy_tags_to_snapshot" { description = "Copy all Cluster `tags` to snapshots" type = bool diff --git a/versions.tf b/versions.tf index 0f3bde3..97e87e8 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.60" + version = ">= 5.61" } } }