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

Error when destroying global rds cluster (from Snapshot) when secondary cluster is attached. #16065

Closed
marinsalinas opened this issue Nov 5, 2020 · 3 comments
Labels
service/rds Issues and PRs that pertain to the rds service.
Milestone

Comments

@marinsalinas
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.12.29

  • provider.aws v3.13.0

Affected Resource(s)

  • aws_rds_global_cluster

Terraform Configuration Files

data "aws_kms_alias" "this" {
  name  = "alias/rds"
}


# The source_db_cluster_identifier argument does not currently exist
resource "aws_rds_global_cluster" "global_cluster" {
  # ... other configuration ...
  source_db_cluster_identifier = aws_rds_cluster.example.id
force_destroy = true
}

resource "aws_rds_cluster" "example" {
  snapshot_identifier = aws_db_cluster_snapshot.example.id
 # ... other configuration ...

  storage_encrypted = true
  kms_key_id              =  data.aws_kms_alias.this.target_key_arn

  lifecycle {
    ignore_changes = [global_cluster_identifier]
  }
}

provider "aws" {
  alias  = "secondary"
  region = "us-west-2"
}

resource "aws_rds_cluster" "secondary" {
   providers = {
      aws.secondary = aws.secondary
   }

  global_cluster_identifier =  aws_rds_global_cluster.global_cluster.id
 # ... other configuration ...
  
storage_encrypted = true
  kms_key_id              =  data.aws_kms_alias.this.target_key_arn
}

Debug Output

Panic Output

Expected Behavior

Terraform destroy should be with no errors.

Actual Behavior

Terraform destroy is errored:

Error: error removing RDS DB Cluster (arn:aws:rds:us-west-2:414158246671:cluster:dbtfmodules-mysql-rds-testing-global-us-west-2) from Global Cluster (dbtfmodules-mysql-rds-testing-global): InvalidParameterValue: Cluster arn:aws:rds:us-west-2:414158246671:cluster:dbtfmodules-mysql-rds-testing-global-us-west-2 is not found in global cluster dbtfmodules-mysql-rds-testing-global
	status code: 400, request id: 858997c6-de0f-4bc7-8553-769456e5aae3

Steps to Reproduce

  1. terraform destroy

Important Factoids

I'm not sure why is not reaching this: https://github.com/hashicorp/terraform-provider-aws/blob/master/aws/resource_aws_rds_global_cluster.go#L256

@ghost ghost added service/kms Issues and PRs that pertain to the kms service. service/rds Issues and PRs that pertain to the rds service. labels Nov 5, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 5, 2020
@marinsalinas marinsalinas changed the title Error when destroy global rds cluster (from Snapshot) when secondary cluster is attached. Error when destroying global rds cluster (from Snapshot) when secondary cluster is attached. Nov 5, 2020
@bflad
Copy link
Contributor

bflad commented Nov 6, 2020

Hi @marinsalinas 👋 The code you reference there was merged yesterday with #15938 and will release with version 3.14.0 of the Terraform AWS Provider in a few minutes (release is running now).

@bflad bflad added this to the v3.14.0 milestone Nov 6, 2020
@ghost
Copy link

ghost commented Nov 6, 2020

This has been released in version 3.14.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 for triage. Thanks!

@ewbankkit ewbankkit removed needs-triage Waiting for first response or review from a maintainer. service/kms Issues and PRs that pertain to the kms service. labels Nov 7, 2020
@ghost
Copy link

ghost commented Dec 7, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/rds Issues and PRs that pertain to the rds service.
Projects
None yet
Development

No branches or pull requests

3 participants