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

[Bug]: RDS Cluster Members incorrectly surfaced as an argument #40227

Open
drakeryswrath opened this issue Nov 21, 2024 · 1 comment
Open

[Bug]: RDS Cluster Members incorrectly surfaced as an argument #40227

drakeryswrath opened this issue Nov 21, 2024 · 1 comment
Labels
bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer.

Comments

@drakeryswrath
Copy link

Terraform Core Version

1.6.6

AWS Provider Version

5.76.0

Affected Resource(s)

aws_rds_cluster
aws_rds_cluster_instance

Expected Behavior

RDS Cluster resource should output the cluster members. It should be invalid to provide cluster members to the resource. The cluster members are already defined as part of the rds cluster instances referencing the cluster. I came across the issue updating a colleagues existing code.

Actual Behavior

The cluster members applies first with the cluster resource and then is updated by the cluster instance resource. It then shows a change everytime a plan or apply runs.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

I can't share as they were discovered at work. I believe this is the issue. the cluster_members according to docs should only be an attribute but the way it has been defined is as an optional input as well. The relationship input is already covered by the cluster instance as defined by cluster identifier argument.

If the option remains there should need to check its not defined in both and would need to be added to documentation.
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster#attribute-reference

https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/rds/cluster.go#L135-L140
"cluster_members": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},

Steps to Reproduce

  1. In Terraform
  • create an aws_rds_cluster with an empty list for cluster_members = []
  • Create an aws_rds_cluster_instance referencing the cluster as cluster_identifier
  1. Apply the first time

  2. Then run a plan and it will show as dropping the instance from the cluster.

Fix/workaround:
Remove the cluster_members argument from rds cluster resource

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

Cluster source code issue suspected
https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/rds/cluster.go#L135-L140

Documentation from hashicorp
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster

Would you like to implement a fix?

None

@drakeryswrath drakeryswrath added the bug Addresses a defect in current functionality. label Nov 21, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer.
Projects
None yet
Development

No branches or pull requests

1 participant