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_db_instance parameter_group_name Ignored #2859

Closed
hashibot opened this issue Jan 4, 2018 · 7 comments · Fixed by #5621
Closed

aws_db_instance parameter_group_name Ignored #2859

hashibot opened this issue Jan 4, 2018 · 7 comments · Fixed by #5621
Labels
bug Addresses a defect in current functionality. service/rds Issues and PRs that pertain to the rds service.
Milestone

Comments

@hashibot
Copy link

hashibot commented Jan 4, 2018

This issue was originally opened by @dgarstang as hashicorp/terraform#17031. It was migrated here as a result of the provider split. The original body of the issue is below.


Following code:

resource "aws_db_instance" "alpha" {
  allocated_storage    = 300
  storage_type         = "gp2"
  engine               = "mysql"
  engine_version       = "5.5.46"
  instance_class       = "db.m4.large"
  identifier           = "${var.name}"
  db_subnet_group_name = "default"
  parameter_group_name = "allow-triggers"
  snapshot_identifier  = "${var.rds_snapshot_name}"
  skip_final_snapshot  = true
  tags = {
    Name = "${var.name}"
  }
}

When running apply, output displays:

parameter_group_name:                           "allow-triggers"

However, when I look at the RDS instance in the AWS cli, it shows:

Parameter group
default.mysql5.5 (in-sync)

Seems that parameter_group_name is completely ignored.
Terraform v0.11.1

@hashibot hashibot added the bug Addresses a defect in current functionality. label Jan 4, 2018
@atsushi-ishibashi
Copy link
Contributor

because snapshot_identifier is set

@dgarstang
Copy link

dgarstang commented Jan 4, 2018

I tried creating an RDS instance from a snapshot in the AWS console. I was not asked for a db parameter group. The parameter group used was the default, not the parameter group used by the original snapshot. Is there some way to set this in terraform?

@atsushi-ishibashi
Copy link
Contributor

Could you try to specify parameter_group_name = "allow-triggers" after terraform apply then terraform apply again?

@dgarstang
Copy link

No I don't really think that's a viable option.

@atsushi-ishibashi
Copy link
Contributor

atsushi-ishibashi commented Jan 5, 2018

I'll submit PR to fix it because parameter_group_name is ignored completely as you said but if you'd like to work well with the current version, I suggest the above way or running terraform apply two times may work.

@bflad
Copy link
Contributor

bflad commented Aug 22, 2018

In version 1.33.0 of the AWS provider, likely releasing later today, the aws_db_instance will now correctly apply parameter_group_name on resource creation when using snapshot_identifier. Please note though that it will still be in pending-reboot state, which will also be fixed shortly. You can track any of these for the pending-reboot issue: #218, #1494, #1510

@ghost
Copy link

ghost commented Apr 3, 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 and limited conversation to collaborators Apr 3, 2020
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.
Projects
None yet
5 participants