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

Require final_snapshot_identifier when skip_final_snapshot = false. #769

Closed
hashibot opened this issue Jun 13, 2017 · 12 comments
Closed

Require final_snapshot_identifier when skip_final_snapshot = false. #769

hashibot opened this issue Jun 13, 2017 · 12 comments
Assignees
Labels
bug Addresses a defect in current functionality. service/rds Issues and PRs that pertain to the rds service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@hashibot
Copy link

This issue was originally opened by @davecozz as hashicorp/terraform#14449. It was migrated here as part of the provider split. The original body of the issue is below.


Terraform Version

0.9.4

Affected Resource(s)

  • aws_db_instance
  • aws_rds_cluster

Expected Behavior

Now that skip_final_snapshot defaults to false it would be nice if final_snapshot_identifier was required when skip_final_snapshot == false.

Actual Behavior

TF currently allows an RDS instance/cluster to be created without specifying any final_snapshot_identifier, which subsequently requires manual intervention when trying to delete the resource:

1 error(s) occurred:

* aws_db_instance.my_aws_db (destroy): 1 error(s) occurred:

* aws_db_instance.my_aws_db: DB Instance FinalSnapshotIdentifier is required when a final snapshot is required

Steps to Reproduce

  1. Create RDS instance using default skip_final_snapshot value (false) without specifying a final_snapshot_identifier attribute.
  2. Attempt to destroy RDS instance.
  3. Log into AWS console and manually delete. :(
@hashibot hashibot added the bug Addresses a defect in current functionality. label Jun 13, 2017
@madmod
Copy link

madmod commented Aug 21, 2017

+1 This is an issue I have experienced.

@bansriyar
Copy link

bansriyar commented Oct 3, 2017

+1 I am experiencing the same issue. Can we expect to have a near term resolution for this?

@drmikecrowe
Copy link

I know this is hacky, but to work around this, I had to edit my .tfstate and change it to:

                            "copy_tags_to_snapshot": "false",
                            "skip_final_snapshot": "true",

in order to bypass it.

@brandonawells
Copy link

Any updates on this issue? I used the solution from @drmikecrowe in the meantime.

@jepma
Copy link

jepma commented Oct 20, 2017

That's correct @drmikecrowe, but in that case you won't have the snapshot. Add "final_snapshot_identifier": "your-finalsnapshot-identifier" below skip_final_snapshot in your tfstate file and the snapshot will be created when you destroy the resource.

@drmikecrowe
Copy link

@jepma I think (but I'm pulling the from memory of several days ago) there's something wonky with the default variables and tfstate: I believe If you set "skip_final_snapshot": "true" then "copy_tags_to_snapshot": "true" was still the default.

When I tried to destroy the test RDS instance, it failed because of the copy_tags_to_snapshot was trying to execute, but I wasn't creating a snapshot.

@jepma
Copy link

jepma commented Oct 20, 2017

Ok! In my case I wanted the snapshot but did not provide the identifier. So, the failure popped up. The fix is fairly easy to implement within the Go code so if I have some spare time left this weekend I will try to create a PR.

@radeksimko radeksimko added the service/rds Issues and PRs that pertain to the rds service. label Jan 27, 2018
@jvelonis
Copy link

I ran into this too. Didn't need a final snapshot so just manually deleted the cluster via AWS console, then ran terraform destroy to start over again -- seems fine.

@edmundcraske
Copy link
Contributor

A workaround for this would be to change 'skip_final_snapshot' to true, run 'terraform apply' and then run 'terraform destroy'... It would be good if Terraform took the value from config rather than state for this though!

@trungie
Copy link

trungie commented Jul 3, 2020

I can confirm, a work around is to change skip_final_shapshot to true and run terraform apply first. Then terraform destroy after.

@github-actions
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Jun 23, 2022
@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/rds Issues and PRs that pertain to the rds service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests