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

support final_snapshot_identifier #3

Merged

Conversation

jensendw
Copy link
Contributor

In its current state the module will provision an RDS instance just fine, however, because skip_final_snapshot is set to false by default AWS wont allow the RDS instance to be deleted. The only way I found to solve this was to require the setting of final_snapshot_identifier as I wanted to be conservative and not default to skipping the final snapshot by default.

@@ -39,6 +39,10 @@ variable "port" {
description = "The port on which the DB accepts connections"
}

variable "final_snapshot_identifier" {
description = "The name of your final DB snapshot when this DB instance is deleted."
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be default = "", because this is an optional argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since skip_final_snapshot defaults to false (https://github.com/terraform-aws-modules/terraform-aws-rds/blob/master/modules/db_instance/variables.tf#L108) And the AWS api wont allow you to delete an RDS instance without a final_snapshot_identifier set unless skip_final_snapshot = true, I'm not sure what is the best setting here. It seems to be that either skip_final_snapshot should be true by default, which I would consider a bad design decision as it could have unwanted effects. So my thought was to force the identification of final_snapshot_identifier instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This resource module does not have to be smarter than Terraform & AWS API, so keeping it as default = "" is a good solution. Please fix and we merge this PR.

Copy link
Contributor Author

@jensendw jensendw Oct 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 @antonbabenko should be fixed now.

variables.tf Outdated
@@ -19,6 +19,10 @@ variable "engine_version" {
description = "The engine version to use"
}

variable "final_snapshot_identifier" {
description = "The name of your final DB snapshot when this DB instance is deleted."
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@@ -23,39 +23,42 @@ module "db" {
source = "terraform-aws-modules/rds/aws"

identifier = "demodb"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch with all these spaces.

@antonbabenko antonbabenko merged commit d86b10b into terraform-aws-modules:master Oct 12, 2017
bryantbiggs pushed a commit to bryantbiggs/terraform-aws-rds that referenced this pull request Jul 14, 2022
…ules#3)

* update examples with terraform-aws-kms module

* add description
bryantbiggs pushed a commit to bryantbiggs/terraform-aws-rds that referenced this pull request Jul 14, 2022
…ules#3)

* update examples with terraform-aws-kms module

* add description
@github-actions
Copy link

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. If you have found a problem that seems related to this change, 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 Nov 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants