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_cluster_parameter_group does not generate a unique name when specifying name_prefix #1739

Closed
majormoses opened this issue Sep 23, 2017 · 6 comments · Fixed by #7326
Closed
Labels
bug Addresses a defect in current functionality. service/rds Issues and PRs that pertain to the rds service.
Milestone

Comments

@majormoses
Copy link

majormoses commented Sep 23, 2017

Terraform Version

$ terraform --version
Terraform v0.9.11

Your version of Terraform is out of date! The latest version
is 0.10.6. You can update by downloading from www.terraform.io

Affected Resource(s)

Please list the resources as a list, for example:

  • aws_rds_cluster_parameter_group

Terraform Configuration Files

####
# RDS Cluster Paramater Group

resource "aws_rds_cluster_parameter_group" "fa-arora" {
  name_prefix = "${var.env}-aurora-params"
  family      = "aurora5.6"
  description = "RDS ${var.env} cluster parameter group"

  parameter {
    name  = "character_set_server"
    value = "utf8"
  }

  parameter {
    name  = "character_set_client"
    value = "utf8"
  }

}
# End of RDS Cluster Paramater Group
####

Debug Output

https://gist.github.com/majormoses/f373836f0219ae37a0079f3938868ce9

Expected Behavior

Terraform should have computed a unique name (using the prefix) and submitted it with the request.

Actual Behavior

It appears that the plan believes it should compute the value but either does and does not submit it or does not compute it. This results in a 400 because the body did not match the requirements:

* aws_rds_cluster_parameter_group.fa-arora: Error modifying DB Cluster Parameter Group: InvalidParameterValue: The parameter DBClusterParameterGroupName must be provided and must not be blank.
	status code: 400, request id: 40a2e32e-a094-11e7-a4f7-21baf61bfe2b

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan
  2. terraform apply

Important Factoids

None

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here?
Not that I saw

@majormoses
Copy link
Author

Commenting out name_prefix and specifying the name attribute works as expected.

@Ninir Ninir added the bug Addresses a defect in current functionality. label Oct 11, 2017
@spanktar
Copy link

spanktar commented Jan 6, 2018

0.10.7 confirmed. name_prefix combined with create_before_destroy.

@radeksimko radeksimko added the service/rds Issues and PRs that pertain to the rds service. label Jan 28, 2018
@richid
Copy link

richid commented Apr 26, 2018

Confirmed in 0.11.5 as well.

Here is a little workaround I'm successfully using:

name = "${var.name}-${lower(replace(timestamp(), ":", ""))}"

which generates strings like

foo-2018-04-26t193814z

Not as elegant as using name_prefix but it gets the job done.

bflad added a commit that referenced this issue Jan 25, 2019
…rameterGroupName error on creation with generated names and name_prefix

References:
* #1739
* #7264

Previous output from acceptance testing:

```
--- FAIL: TestAccAWSDBClusterParameterGroup_generatedName_Parameter (8.30s)
    testing.go:538: Step 0 error: Error applying: 1 error occurred:
        	* aws_rds_cluster_parameter_group.test: 1 error occurred:
        	* aws_rds_cluster_parameter_group.test: Error modifying DB Cluster Parameter Group: InvalidParameterValue: The parameter DBClusterParameterGroupName must be provided and must not be blank.
        	status code: 400, request id: e2a07ba0-ba60-4d24-a8ee-3d7a86cf1793

--- FAIL: TestAccAWSDBClusterParameterGroup_namePrefix_Parameter (8.43s)
    testing.go:538: Step 0 error: Error applying: 1 error occurred:
        	* aws_rds_cluster_parameter_group.test: 1 error occurred:
        	* aws_rds_cluster_parameter_group.test: Error modifying DB Cluster Parameter Group: InvalidParameterValue: The parameter DBClusterParameterGroupName must be provided and must not be blank.
        	status code: 400, request id: 895b9f34-c88e-46ec-8006-0ee61096cff1
```

Output from acceptance testing:

```
--- PASS: TestAccAWSDBClusterParameterGroup_disappears (10.98s)
--- PASS: TestAccAWSDBClusterParameterGroup_namePrefix (12.80s)
--- PASS: TestAccAWSDBClusterParameterGroup_generatedName (12.99s)
--- PASS: TestAccAWSDBClusterParameterGroup_namePrefix_Parameter (13.53s)
--- PASS: TestAccAWSDBClusterParameterGroup_generatedName_Parameter (13.60s)
--- PASS: TestAccAWSDBClusterParameterGroup_withApplyMethod (14.34s)
--- PASS: TestAccAWSDBClusterParameterGroup_importBasic (15.56s)
--- PASS: TestAccAWSDBClusterParameterGroup_basic (24.07s)
```
@bflad bflad added this to the v1.57.0 milestone Jan 25, 2019
@bflad
Copy link
Contributor

bflad commented Jan 25, 2019

The fix for the aws_rds_cluster_parameter_group resource not correctly applying during resource creation with a generated name or with the name_prefix argument while also including parameter configurations has been merged and will release with version 1.57.0 of the Terraform AWS provider, likely later today. 👍

@bflad
Copy link
Contributor

bflad commented Jan 26, 2019

This has been released in version 1.57.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 1, 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 1, 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
6 participants