diff --git a/aws/resource_aws_rds_cluster.go b/aws/resource_aws_rds_cluster.go index 0ce339af82d..c881fb69da1 100644 --- a/aws/resource_aws_rds_cluster.go +++ b/aws/resource_aws_rds_cluster.go @@ -398,6 +398,7 @@ func resourceAwsRDSCluster() *schema.Resource { "error", "general", "slowquery", + "postgresql", }, false), }, }, diff --git a/aws/resource_aws_rds_cluster_test.go b/aws/resource_aws_rds_cluster_test.go index a3ac614d0e7..2e3ebf3e0d1 100644 --- a/aws/resource_aws_rds_cluster_test.go +++ b/aws/resource_aws_rds_cluster_test.go @@ -413,7 +413,7 @@ func TestAccAWSRDSCluster_Tags(t *testing.T) { } func TestAccAWSRDSCluster_EnabledCloudwatchLogsExports(t *testing.T) { - var dbCluster1, dbCluster2, dbCluster3 rds.DBCluster + var dbCluster1, dbCluster2, dbCluster3, dbCluster4 rds.DBCluster rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_rds_cluster.test" @@ -459,6 +459,14 @@ func TestAccAWSRDSCluster_EnabledCloudwatchLogsExports(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "enabled_cloudwatch_logs_exports.0", "error"), ), }, + { + Config: testAccAWSClusterConfigEnabledCloudwatchLogsExportsPostgres1(rName, "postgresql"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSClusterExists(resourceName, &dbCluster4), + resource.TestCheckResourceAttr(resourceName, "enabled_cloudwatch_logs_exports.#", "1"), + resource.TestCheckResourceAttr(resourceName, "enabled_cloudwatch_logs_exports.0", "postgresql"), + ), + }, }, }) } @@ -2080,6 +2088,19 @@ resource "aws_rds_cluster" "test" { `, rName, enabledCloudwatchLogExports1, enabledCloudwatchLogExports2) } +func testAccAWSClusterConfigEnabledCloudwatchLogsExportsPostgres1(rName, enabledCloudwatchLogExports1 string) string { + return fmt.Sprintf(` +resource "aws_rds_cluster" "test" { + cluster_identifier = %[1]q + enabled_cloudwatch_logs_exports = [%[2]q] + engine = "aurora-postgresql" + master_username = "foo" + master_password = "mustbeeightcharaters" + skip_final_snapshot = true +} +`, rName, enabledCloudwatchLogExports1) +} + func testAccAWSClusterConfig_kmsKey(n int) string { return fmt.Sprintf(` diff --git a/website/docs/r/rds_cluster.html.markdown b/website/docs/r/rds_cluster.html.markdown index 1f53d2aece0..fd1e93ab658 100644 --- a/website/docs/r/rds_cluster.html.markdown +++ b/website/docs/r/rds_cluster.html.markdown @@ -135,7 +135,7 @@ Default: A 30-minute window selected at random from an 8-hour block of time per * `engine_version` - (Optional) The database engine version. Updating this argument results in an outage. See the [Aurora MySQL](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Updates.html) and [Aurora Postgres](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Updates.html) documentation for your configured engine to determine this value. For example with Aurora MySQL 2, a potential value for this argument is `5.7.mysql_aurora.2.03.2`. * `source_region` - (Optional) The source region for an encrypted replica DB cluster. * `enabled_cloudwatch_logs_exports` - (Optional) List of log types to export to cloudwatch. If omitted, no logs will be exported. - The following log types are supported: `audit`, `error`, `general`, `slowquery`. + The following log types are supported: `audit`, `error`, `general`, `slowquery`, `postgresql` (PostgreSQL). * `scaling_configuration` - (Optional) Nested attribute with scaling properties. Only valid when `engine_mode` is set to `serverless`. More details below. * `tags` - (Optional) A mapping of tags to assign to the DB cluster.