-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
r/aws_redshift_logging: new resource #36862
Conversation
This resource will allow practitioners to manage Amazon Redshift cluster logging configurations with Terraform. This standalone resource will replace the optional `logging` block within the `aws_redshift_cluster` resource, allowing logging configurations to be managed independent of the parent cluster. ```console % make testacc PKG=redshift TESTS=TestAccRedshiftLogging_ ==> Checking that code complies with gofmt requirements... TF_ACC=1 go1.21.8 test ./internal/service/redshift/... -v -count 1 -parallel 20 -run='TestAccRedshiftLogging_' -timeout 360m --- PASS: TestAccRedshiftLogging_disappears_Cluster (411.73s) --- PASS: TestAccRedshiftLogging_basic (425.21s) --- PASS: TestAccRedshiftLogging_disappears (437.79s) --- PASS: TestAccRedshiftLogging_s3 (522.88s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/redshift 528.588s ```
Community NoteVoting for Prioritization
For Submitters
|
This argument is deprecated in favor of the new, standalone `aws_redshift_logging` resource.
e715201
to
844693a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments on the id
parameter and basic
tests. The basic
test isn't a blocker. Otherwise looks good.
--- PASS: TestAccRedshiftCluster_changeAvailabilityZone_availabilityZoneRelocationNotSet (387.37s)
--- PASS: TestAccRedshiftCluster_availabilityZoneRelocation_publiclyAccessible (398.85s)
--- PASS: TestAccRedshiftCluster_kmsKey (425.40s)
--- PASS: TestAccRedshiftCluster_disappears (430.00s)
--- PASS: TestAccRedshiftCluster_basic (433.48s)
--- PASS: TestAccRedshiftCluster_iamRoles (439.29s)
--- PASS: TestAccRedshiftLogging_disappears (442.28s)
--- FAIL: TestAccRedshiftCluster_snapshotCopy (445.79s)
--- PASS: TestAccRedshiftCluster_loggingEnabled (470.11s)
--- PASS: TestAccRedshiftCluster_withFinalSnapshot (492.94s)
--- PASS: TestAccRedshiftCluster_availabilityZoneRelocation (534.20s)
--- PASS: TestAccRedshiftCluster_enhancedVPCRoutingEnabled (548.49s)
--- PASS: TestAccRedshiftCluster_tags (591.88s)
--- PASS: TestAccRedshiftCluster_changeAvailabilityZoneAndSetAvailabilityZoneRelocation (735.42s)
--- PASS: TestAccRedshiftLogging_basic (424.98s)
--- PASS: TestAccRedshiftCluster_forceNewUsername (846.46s)
--- PASS: TestAccRedshiftLogging_s3 (424.41s)
--- PASS: TestAccRedshiftLogging_disappears_Cluster (420.53s)
--- PASS: TestAccRedshiftCluster_manageMasterPassword (419.58s)
--- PASS: TestAccRedshiftCluster_aqua (441.84s)
--- PASS: TestAccRedshiftCluster_changeAvailabilityZone (886.18s)
--- PASS: TestAccRedshiftCluster_publiclyAccessible (444.93s)
--- PASS: TestAccRedshiftCluster_restoreFromSnapshotARN (943.72s)
--- PASS: TestAccRedshiftCluster_restoreFromSnapshot (1004.78s)
--- PASS: TestAccRedshiftCluster_changeEncryption1 (1201.45s)
--- PASS: TestAccRedshiftCluster_multiAZ (831.77s)
--- PASS: TestAccRedshiftCluster_changeEncryption2 (1303.53s)
--- PASS: TestAccRedshiftCluster_updateNodeCount (1266.56s)
--- PASS: TestAccRedshiftCluster_updateNodeType (1447.71s)
TestAccRedshiftCluster_snapshotCopy
is an intermittent failure
if resp.Diagnostics.HasError() { | ||
return | ||
} | ||
plan.ID = types.StringValue(plan.ClusterIdentifier.ValueString()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id
is redundant, since it's the same as cluster_identifier
, so it's not needed for a Framework-based resource
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chatted offline on this topic. Will leave the id
attribute for now until we decide on a standard across the provider for Terraform Plugin Framework-based resources.
testAccCheckLoggingExists(ctx, resourceName, &log), | ||
resource.TestCheckResourceAttrPair(resourceName, "cluster_identifier", clusterResourceName, "id"), | ||
resource.TestCheckResourceAttr(resourceName, "log_destination_type", string(types.LogDestinationTypeCloudwatch)), | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The basic
test should check the values of all parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed with 02d60ee
log_destination_type = "cloudwatch" | ||
log_exports = ["connectionlog", "useractivitylog", "userlog"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A basic
test shouldn't set Optional
parameters, so that it tests defaults
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While technically optional, this argument is required when the log_destination_type
is cloudwatch
.
```console % make testacc PKG=redshift TESTS=TestAccRedshiftLogging_ ==> Checking that code complies with gofmt requirements... TF_ACC=1 go1.21.8 test ./internal/service/redshift/... -v -count 1 -parallel 20 -run='TestAccRedshiftLogging_' -timeout 360m --- PASS: TestAccRedshiftLogging_disappears_Cluster (419.18s) --- PASS: TestAccRedshiftLogging_basic (427.15s) --- PASS: TestAccRedshiftLogging_s3 (437.89s) --- PASS: TestAccRedshiftLogging_disappears (472.92s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/redshift 478.531s ```
Test results after adding missing checks: % make testacc PKG=redshift TESTS=TestAccRedshiftLogging_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/redshift/... -v -count 1 -parallel 20 -run='TestAccRedshiftLogging_' -timeout 360m
--- PASS: TestAccRedshiftLogging_disappears_Cluster (419.18s)
--- PASS: TestAccRedshiftLogging_basic (427.15s)
--- PASS: TestAccRedshiftLogging_s3 (437.89s)
--- PASS: TestAccRedshiftLogging_disappears (472.92s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/redshift 478.531s |
This functionality has been released in v5.45.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Description
This resource will allow practitioners to manage Amazon Redshift cluster logging configurations with Terraform. This standalone resource will replace the optional
logging
block within theaws_redshift_cluster
resource, allowing logging configurations to be managed independent of the parent cluster.The
logging
argument within theaws_redshift_cluster
resource is now deprecated.Relations
Closes #36651
References
Output from Acceptance Testing