Open rmarilyak opened 8 months ago
Voting for Prioritization
Volunteering to Work on This Issue
@rmarilyak This is probably a usage error, as database activity stream is an Aurora feature, not regular RDS. Per your configuration, you are trying to use this feature against an RDS for SQL Server instance which is not supported AFAIK. Please double check your use case.
@acwwat, that is not correct, because database Activity Streams supports Amazon RDS for SQL Server and Oracle as well.
Moreover, as I've mentioned above, the aws_rds_cluster_activity_stream
terraform resource successfully starts the database activity stream even for RDS for SQL Server instance, but it fails with the above mentioned error afterwards.
I am pretty much sure that it simply uses aws rds start-activity-stream
CLI command 'under its hood', which successfully works with any most of RDS instances and engines (SQL Server as well).
The only problem as I see it - the aws_rds_cluster_activity_stream
terraform resource is simply can't handle the situations, when RDS instance does not have cluster ARN property, which is exactly my case.
@rmarilyak Thanks for the additional context. According to the aws-sdk-go-v2 RDS changelog, the support was added since 2023-02-15, so it would have worked if the API supports it. The StartActivityStream API reference also suggests the error we are seeing that the resource ARN is for (Aurora) DB clusters, which along with the error and resource name prompted my original comment. So the two confusing piece of information, AWS documentation and the TF resource name, should be fixed at some point.
Looking more into the resource code, I see that it tries to find an activity stream on an read operation but it is hardcoded to handle a DB cluster. The create operation does a read in the end, so the creation might be failing because of the read instead of the StartActivityStream
request. The actual behavior your described seems to suggest the same. The fix is probably to detect whether the ARN is for a cluster or instance and fetch the appropriate resource to read the activity stream settings.
So, is there gonna be any solution to this?
AWS API reference issue has also been reported to AWS as a support case. They have acknowledged the issue and will fix it "in due time" with no ETA nor notification when it is done. Just need to keep and eye out for the fix.
Terraform Core Version
1.7.4
AWS Provider Version
5.41.0
Affected Resource(s)
aws_rds_cluster_activity_stream
Expected Behavior
aws_rds_cluster_activity_stream resource successfully starts database activity streams for both RDS clusters and single DB Instances types
Actual Behavior
aws_rds_cluster_activity_stream resource is able to start database activity stream for single DB Instances (not clusters) - this can be seen in the AWS console, but fails with the error below
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
Debug Output
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None