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

AWS RDS - Restoring from snapshot doesn't set DBname #9988

Closed
kxseven opened this issue Nov 9, 2016 · 2 comments · Fixed by #10664
Closed

AWS RDS - Restoring from snapshot doesn't set DBname #9988

kxseven opened this issue Nov 9, 2016 · 2 comments · Fixed by #10664

Comments

@kxseven
Copy link

kxseven commented Nov 9, 2016

In a Nutshell

  • Creating an RDS instance by restoring from an existing Snapshot where the DBname will change results in a new RDS instance getting created with the DBname from the Snapshot.
  • Subsequent 'terraform apply' actions detect the incorrect DBname and force a new (RDS) resource, Re-creating the problem all over again

Example

  • An RDS snapshot is created myapp-sample-db from an existing RDS instance
  • A new RDS instance is requested using the myapp-sample-db Snapshot identifier but with a different DBname MYAPPDEV

Terraform Version

Terraform v0.7.7, Terraform v0.7.9

Affected Resource(s)

  • aws_db_instance

Terraform Configuration Files

resource "aws_db_instance" "development" {

    identifier                 = "myppdevdb"
    allocated_storage          = 500
    storage_type               = "gp2"
    engine                     = "oracle-ee"
    engine_version             = "12.1.0.2.v5"
    instance_class             = "db.r3.2xlarge"

    apply_immediately          = "true"

    password                   = "<redacted>"
    username                   = "<redacted>"
    name                       = "MYAPPDEV"

    publicly_accessible        = "false"
    db_subnet_group_name       = "<redacted>"
    parameter_group_name       = "<redacted>"
    option_group_name          = "<redacted>"
    copy_tags_to_snapshot      = "true"

    multi_az                   = "true"
    storage_encrypted          = "true"
    kms_key_id                 = "${var.kms_key_id}"
    vpc_security_group_ids     = [ "<redacted>" ]

    backup_retention_period    = 7
    backup_window              = "23:00-23:45"
    auto_minor_version_upgrade = "true"

    snapshot_identifier        = "myapp-sample-db"

    skip_final_snapshot        = "true"
    final_snapshot_identifier  = "devdb-final-snapshot"

}

Expected Behavior

Actual Behavior

  • The RDS instance gets created from the Snapshot but with the DBname stored in the Snapshot
  • Subsequent 'terraform apply' actions detect the incorrect DBname and force a new (RDS) resource, Re-creating the problem all over again

Steps to Reproduce

  1. terraform apply (RDS instance gets created)
  2. terraform apply (DBName is detected as incorrect, forces new resource)
  3. terraform apply (ad infinitum)

References

@kxseven
Copy link
Author

kxseven commented Nov 9, 2016

Is this a dupe of #4671 ?

If the root-cause is the AWS API (and not Terraform) should there not at least be a note in the TF docs to indicate this?

@ghost
Copy link

ghost commented Apr 18, 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 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.

@ghost ghost locked and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants