Terraform-provider-aws: RDS resources with passwords always get destroyed / rebuilt

Created on 13 Jun 2017  ·  11Comments  ·  Source: hashicorp/terraform-provider-aws

_This issue was originally opened by @slajax as hashicorp/terraform#15144. It was migrated here as part of the provider split. The original body of the issue is below._


The same issue described in hashicorp/terraform#689 is back in < 0.9.6 - confirmed the same issue in 0.9.3 as well based on the comment at the end of the previous issue.

bug waiting-response

All 11 comments

^^^ happening to me as well

Is there some update to this issue?

Hello – if possible could someone please provide an example configuration that demonstrates this issue? Omit any secrets of course. A simple aws_db_instance config that reproduces this will let us dig in. Thanks!

Sure:

File main.tf

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

variable "db_user" {
  type    = "string"
  default = "pele"
}

variable "db_pass" {
  type    = "string"
  default = "m4r4d0n4ch31r4P0"
}

File rds.tf

resource "aws_rds_cluster_instance" "db_instance" {
  count              = 1
  identifier         = "ximbalaie-${count.index}"
  cluster_identifier = "${aws_rds_cluster.db_cluster.id}"
  instance_class     = "db.t2.small"
  apply_immediately = true
}

resource "aws_rds_cluster" "db_cluster" {
  cluster_identifier        = "zepequeno-db-cluster"
  availability_zones        = ["us-west-2a"]
  database_name             = "ximbalaie"
  backup_retention_period       = 3
  preferred_maintenance_window  = "Mon:02:00-Mon:03:00"
  preferred_backup_window   = "04:00-04:30"
  final_snapshot_identifier     = "parafuseta-aurora-cluster"
  db_subnet_group_name          = "subnet-ximbalaie"
  master_username           = "${var.db_user}"
  master_password           = "${var.db_pass}"
  vpc_security_group_ids    = ["sg-ximbaDB"]
}

Two applications in sequence, without code modification, generate the destruction of the instance in each command!

Forget it! My mistake. My code are setting availability zones in a wrong way, it's because this that the RDS was being rebuilded.

Thanks for the feedback @jjbeber :)

@doprdele could you please share your configuration with us so that we can replicate the issue? thanks!

ping @doprdele :)

Tell us how it goes, so that we can solve or close this issue!

Hi there! It looks like the issue author hasn't replied in a while. In the interest of helping keep the repository clean to help identify the issues that require maintainers' attention, I'm going to close this issue out. If it still requires action, or if someone has interest in it being reopened, feel free to reply to the issue.

Hi @jjbeber what's the proper way to set the availability zones? I also having this issue.

Hi, @rodrigoSyscop, you need to set all the availability zones, if not, the cluster will be rebuilt. You can see this pretty clear when run terraform plan.

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!

Was this page helpful?
0 / 5 - 0 ratings