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

Added CW log export value postgresql for aurora-postgresql #9740

Merged
merged 1 commit into from
Aug 15, 2019
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
1 change: 1 addition & 0 deletions aws/resource_aws_rds_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ func resourceAwsRDSCluster() *schema.Resource {
"error",
"general",
"slowquery",
"postgresql",
Copy link

@saiya saiya Aug 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi saiya,

I'm not sure if the documentation is wrong at this point, but when I try to add upgrade via the cli I receive the following error

An error occurred (InvalidParameterCombination) when calling the CreateDBCluster operation: You cannot use the log types 'upgrade' with engine version aurora-postgresql 10.7. For supported log types, see the documentation.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. And I confirmed only postgresql log type is exportable in AWS Console (web UI).

#6829 (comment)

"ExportableLogTypes": [
"postgresql"
],

Only postgresql seems to be enough at this moment.

}, false),
},
},
Expand Down
23 changes: 22 additions & 1 deletion aws/resource_aws_rds_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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"),
),
},
},
})
}
Expand Down Expand Up @@ -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(`

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/rds_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down