-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
New Resource aws_rds_cluster_activity_stream #22097
New Resource aws_rds_cluster_activity_stream #22097
Conversation
I'm having a difficult time debugging the Acceptance test code and I'm not sure why my tests are failing if it's bad code in my test or in the resource I added (or both :( ). I use Visual Studio Code for development and successfully followed the instructions on Debugging Providers to attach a debugger to the AWS Provider. I manage to run the acceptance tests with Any help or ideas how I can debug the acceptance tests? @DrFaust92 (or anyone) |
} | ||
} | ||
|
||
func testAccCheckAWSRDSClusterActivityStreamAttributes(v *rds.DBCluster) resource.TestCheckFunc { |
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.
why is these need if attributes are already checked?
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.
It checks properties returned from AWS and not only attributes stored with the resource. i.e. the ActivityStreamStatus
which is expected to be in state Started
return diag.FromErr(fmt.Errorf("error retrieving RDS cluster: empty response for: %s", d.Id())) | ||
} | ||
|
||
if aws.StringValue(resp.ActivityStreamStatus) == rds.ActivityStreamStatusStopped { |
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.
I think we should fold this into the find function (also will remove the dupe in acctest destory function)
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.
Do you suggest the FindDBClusterByClusterArn
function or do you suggest I create a new find function for the Activity Stream? The Activity Stream isn't really something you can "find" and return. It's a status property on the DB cluster.
kms_key_id = aws_kms_key.test.key_id | ||
mode = "async" | ||
|
||
depends_on = [aws_rds_cluster_instance.test] |
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.
should avoid this and add some retry logic in create if it needs to wait for the instance to be created.
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.
If there's no depends_on
it can also cause a race condition when deleting the entire stack. i.e. If AWS is busy destroying either aws_rds_cluster
or aws_rds_cluster_activity_stream
then the destroy operation of the other will fail stating the cluster is in invalid state to perform the operation.
We can wait at initialization, but to wait at destroy would require changes to the aws_rds_cluster
resources too.
@jdstuart can you share errors? i dont run tests on debug so can help you with this unfortunately. |
When trying to debug the test in VS Code I get the following Debug Output:
The debugger is attached and hit one of the breakpoints but when I continue it will just exit the process and detach. |
@DrFaust92 code is ready again for review. Results from Acceptance Tests
|
LGTM 🚀 % make testacc TESTS=TestAccAWSRDSClusterActivityStream_ PKG=rds
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 20 -run='TestAccAWSRDSClusterActivityStream_' -timeout 180m
=== RUN TestAccAWSRDSClusterActivityStream_basic
=== PAUSE TestAccAWSRDSClusterActivityStream_basic
=== RUN TestAccAWSRDSClusterActivityStream_disappears
=== PAUSE TestAccAWSRDSClusterActivityStream_disappears
=== CONT TestAccAWSRDSClusterActivityStream_basic
=== CONT TestAccAWSRDSClusterActivityStream_disappears
--- PASS: TestAccAWSRDSClusterActivityStream_basic (1515.37s)
--- PASS: TestAccAWSRDSClusterActivityStream_disappears (1613.83s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/rds 1615.716s |
@jdstuart Thanks for the contribution 🎉 . |
This functionality has been released in v4.9.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. |
Community Note
Closes #14243
Relates #18980
Description: This PR adds support for the Amazon Aurora Database Activity Streams.
A lot of credit to @Fedomn that did a bunch of the work in #14243.
Output from acceptance testing: