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

Fail creating a new cluster parameter group for Aurora 5.6 if the parameter is "modify locked" #3395

Closed
gmelillo opened this issue Feb 15, 2018 · 6 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. 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

@gmelillo
Copy link

Terraform Version

terraform -version
Terraform v0.11.3
+ provider.aws v1.9.0

Affected Resource(s)

  • aws_rds_cluster_parameter_group

Terraform Configuration Files

resource "aws_rds_cluster_parameter_group" "test_aurora_parameter" {
  name   = "test_aurora_parameter"
  family = "aurora5.6"

  parameter {
    apply_method = "pending-reboot"
    name         = "binlog_format"
    value        = "ROW"
  }

  parameter {
      apply_method = "pending-reboot"
      name         = "binlog_row_image"
      value        = "full"
  }
}

Expected Behavior

Create a resource group named test_aurora_parameter with the following parameter setted :

  • binlog_row_image = "full"
  • binlog_format = "ROW"

Actual Behavior

aws_rds_cluster_parameter_group.test_aurora_parameter: Creating...
  arn:                               "" => "<computed>"
  description:                       "" => "Managed by Terraform"
  family:                            "" => "aurora5.6"
  name:                              "" => "test_aurora_parameter"
  name_prefix:                       "" => "<computed>"
  parameter.#:                       "" => "2"
  parameter.1081139968.apply_method: "" => ""
  parameter.1081139968.name:         "" => "binlog_format"
  parameter.1081139968.value:        "" => "ROW"
  parameter.576252847.apply_method:  "" => ""
  parameter.576252847.name:          "" => "binlog_row_image"
  parameter.576252847.value:         "" => "full"

Error: Error applying plan:

1 error(s) occurred:

* aws_rds_cluster_parameter_group.test_aurora_parameter: 1 error(s) occurred:

* aws_rds_cluster_parameter_group.test_aurora_parameter: Error creating DB Cluster Parameter Group: InvalidParameterValue: The parameter DBClusterParameterGroupName is not a valid identifier. Identifiers must begin with a letter; must contain only ASCII letters, digits, and hyphens; and must not end with a hyphen or contain two consecutive hyphens.
	status code: 400, request id: 87d22b56-2bb8-49c8-bdd4-6183f8d9b525

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

Steps to Reproduce

  1. terraform apply

Important Factoids

I did this test with a single file on a new AWS account just to test the point.
terraform apply seems fail if the parameter is not modifiable inside the parameter group.

@bflad
Copy link
Contributor

bflad commented Feb 15, 2018

Hey @gmelillo! 👋 In your output above, the AWS API error returned back was:

InvalidParameterValue: The parameter DBClusterParameterGroupName is not a valid identifier. Identifiers must begin with a letter; must contain only ASCII letters, digits, and hyphens; and must not end with a hyphen or contain two consecutive hyphens.

Since your name attribute contains underscores (test_aurora_parameter ), AWS is not allowing you to create the parameter group. We can add plan-time validation to the name attribute to show this error sooner, but if you change your underscores to hyphens (test-aurora-parameter) it should work.

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/rds Issues and PRs that pertain to the rds service. bug Addresses a defect in current functionality. and removed enhancement Requests to existing resources that expand the functionality or scope. labels Feb 15, 2018
@bflad
Copy link
Contributor

bflad commented Feb 15, 2018

Interestingly enough, we actually had validation in place but it was errantly updated to allow underscores. I have submitted a fix to revert that change to match the API documentation in #3396

@gmelillo
Copy link
Author

Hello @bflad I just changed _ with - but the issue remains :

aws_rds_cluster_parameter_group.test_aurora_parameter: Creating...
  arn:                               "" => "<computed>"
  description:                       "" => "Managed by Terraform"
  family:                            "" => "aurora5.6"
  name:                              "" => "test-aurora-parameter"
  name_prefix:                       "" => "<computed>"
  parameter.#:                       "" => "2"
  parameter.1081139968.apply_method: "" => ""
  parameter.1081139968.name:         "" => "binlog_format"
  parameter.1081139968.value:        "" => "ROW"
  parameter.576252847.apply_method:  "" => ""
  parameter.576252847.name:          "" => "binlog_row_image"
  parameter.576252847.value:         "" => "full"

Error: Error applying plan:

1 error(s) occurred:

* aws_rds_cluster_parameter_group.test_aurora_parameter: 1 error(s) occurred:

* aws_rds_cluster_parameter_group.test_aurora_parameter: Error modifying DB Cluster Parameter Group: InvalidParameterValue: The parameter binlog_row_image cannot be modified.
	status code: 400, request id: 14986047-0709-4dfa-a834-d6db94429754

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

@bflad
Copy link
Contributor

bflad commented Feb 15, 2018

Okay now this makes more sense. Is the ask here for plan time validation of Aurora parameter names then? Looks like this is the authoritative documentation, but I think it would also need to check which family it is as well.

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. and removed bug Addresses a defect in current functionality. labels Feb 15, 2018
@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 Mar 27, 2020
@ghost
Copy link

ghost commented May 28, 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 May 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. 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

2 participants