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: TF tries to update allow_major_version_upgrade on its own and fails #500

Closed
hashibot opened this issue Jun 13, 2017 · 3 comments · Fixed by #9193
Closed

AWS RDS: TF tries to update allow_major_version_upgrade on its own and fails #500

hashibot opened this issue Jun 13, 2017 · 3 comments · Fixed by #9193
Assignees
Labels
bug Addresses a defect in current functionality. service/rds Issues and PRs that pertain to the rds service.
Milestone

Comments

@hashibot
Copy link

This issue was originally opened by @mtekel as hashicorp/terraform#11519. It was migrated here as part of the provider split. The original body of the issue is below.


Terraform Version

0.7.10, 0.7.11, but seems to be still present in latest:
https://github.com/hashicorp/terraform/blob/dc91285949fc9db7d5273eee9b5eaf04955d677c/builtin/providers/aws/resource_aws_db_instance.go#L844

Affected Resource(s)

aws_db_instance

Terraform Configuration Files

resource "aws_db_instance" "cf" {
  identifier           = "abc"
  allocated_storage    = 10
  engine               = "postgres"
  engine_version       = "9.5.4"
  instance_class       = "db.t2.small"
  username             = "dbadmin"
  password             = "mypassword"
  db_subnet_group_name = "abc-cf"
  parameter_group_name = "abc-pg95-cf"

  storage_type               = "gp2"
  backup_window              = "02:00-03:00"
  maintenance_window         = "mon:04:00-mon:05:00"
  multi_az                   = "false"
  backup_retention_period    = "0"
  final_snapshot_identifier  = "abc-cf-rds-final-snapshot"
  skip_final_snapshot        = "true"
  vpc_security_group_ids     = ["sg-2234sdwe23"]
  auto_minor_version_upgrade = false

#  allow_major_version_upgrade = true
}

Debug Output

This is the snippet containing the issue, I have sanitized credentials:

2017/01/30 17:09:56 [DEBUG] apply: aws_db_instance.cf: executing Apply
aws_db_instance.cf: Modifying...
  allow_major_version_upgrade: "true" => "false"
2017/01/30 17:09:56 [DEBUG] plugin: terraform: aws-provider (internal) 2017/01/30 17:09:56 [DEBUG] Send DB Instance Modification request: true
2017/01/30 17:09:56 [DEBUG] plugin: terraform: aws-provider (internal) 2017/01/30 17:09:56 [DEBUG] DB Instance Modification request: {
2017/01/30 17:09:56 [DEBUG] plugin: terraform:   AllowMajorVersionUpgrade: false,
2017/01/30 17:09:56 [DEBUG] plugin: terraform:   ApplyImmediately: false,
2017/01/30 17:09:56 [DEBUG] plugin: terraform:   DBInstanceIdentifier: "michael-cf"
2017/01/30 17:09:56 [DEBUG] plugin: terraform: }
2017/01/30 17:09:56 [DEBUG] plugin: terraform: aws-provider (internal) 2017/01/30 17:09:56 [DEBUG] [aws-sdk-go] DEBUG: Request rds/ModifyDBInstance Details:
2017/01/30 17:09:56 [DEBUG] plugin: terraform: ---[ REQUEST POST-SIGN ]-----------------------------
2017/01/30 17:09:56 [DEBUG] plugin: terraform: POST / HTTP/1.1
2017/01/30 17:09:56 [DEBUG] plugin: terraform: Host: rds.eu-west-1.amazonaws.com
2017/01/30 17:09:56 [DEBUG] plugin: terraform: User-Agent: APN/1.0 HashiCorp/1.0 Terraform/0.7.11
2017/01/30 17:09:56 [DEBUG] plugin: terraform: Content-Length: 128
2017/01/30 17:09:56 [DEBUG] plugin: terraform: Authorization: AWS4-HMAC-SHA256 Credential=ABCDEFGH, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-security-token, Signature=jdflkjalfdjlajsdlfkajlskdjflaksdjflkajdlkfjadfslkjasdlkfjdas
2017/01/30 17:09:56 [DEBUG] plugin: terraform: Content-Type: application/x-www-form-urlencoded; charset=utf-8
2017/01/30 17:09:56 [DEBUG] plugin: terraform: X-Amz-Date: 20170130T170956Z
2017/01/30 17:09:56 [DEBUG] plugin: terraform: X-Amz-Security-Token: ASDfASDfaSDfASDfASDfASDfA
2017/01/30 17:09:56 [DEBUG] plugin: terraform: Accept-Encoding: gzip
2017/01/30 17:09:56 [DEBUG] plugin: terraform: 
2017/01/30 17:09:56 [DEBUG] plugin: terraform: Action=ModifyDBInstance&AllowMajorVersionUpgrade=false&ApplyImmediately=false&DBInstanceIdentifier=michael-cf&Version=2014-10-31
2017/01/30 17:09:56 [DEBUG] plugin: terraform: -----------------------------------------------------
2017/01/30 17:09:56 [DEBUG] plugin: terraform: aws-provider (internal) 2017/01/30 17:09:56 [DEBUG] [aws-sdk-go] DEBUG: Response rds/ModifyDBInstance Details:
2017/01/30 17:09:56 [DEBUG] plugin: terraform: ---[ RESPONSE ]--------------------------------------
2017/01/30 17:09:56 [DEBUG] plugin: terraform: HTTP/1.1 400 Bad Request
2017/01/30 17:09:56 [DEBUG] plugin: terraform: Connection: close
2017/01/30 17:09:56 [DEBUG] plugin: terraform: Content-Length: 289
2017/01/30 17:09:56 [DEBUG] plugin: terraform: Content-Type: text/xml
2017/01/30 17:09:56 [DEBUG] plugin: terraform: Date: Mon, 30 Jan 2017 17:11:06 GMT
2017/01/30 17:09:56 [DEBUG] plugin: terraform: X-Amzn-Requestid: 12-34-56-67
2017/01/30 17:09:56 [DEBUG] plugin: terraform: 
2017/01/30 17:09:56 [DEBUG] plugin: terraform: <ErrorResponse xmlns="http://rds.amazonaws.com/doc/2014-10-31/">
2017/01/30 17:09:56 [DEBUG] plugin: terraform:   <Error>
2017/01/30 17:09:56 [DEBUG] plugin: terraform:     <Type>Sender</Type>
2017/01/30 17:09:56 [DEBUG] plugin: terraform:     <Code>InvalidParameterCombination</Code>
2017/01/30 17:09:56 [DEBUG] plugin: terraform:     <Message>No modifications were requested</Message>
2017/01/30 17:09:56 [DEBUG] plugin: terraform:   </Error>
2017/01/30 17:09:56 [DEBUG] plugin: terraform:   <RequestId>12-34-56-67</RequestId>
2017/01/30 17:09:56 [DEBUG] plugin: terraform: </ErrorResponse>
2017/01/30 17:09:56 [DEBUG] plugin: terraform: 
2017/01/30 17:09:56 [DEBUG] plugin: terraform: -----------------------------------------------------

Expected Behavior

No changes applied to AWS. TF remembers state.

Actual Behavior

TF tries to send request to AWS changing the parameter from true to false:

Error applying plan:

1 error(s) occurred:

* aws_db_instance.cf: Error modifying DB Instance michael-cf: InvalidParameterCombination: No modifications were requested
	status code: 400, request id: 12-34-56-67

Steps to Reproduce

Apply with allow_major_version_upgrade set to true. Comment out/delete parameter completely (or set to false) and apply again. It's important that other parameters are not changed as well, just allow_major_version_upgrade.

Important Factoids

Looks like there needs to be some logic about when to send change of that parameter to AWS. If the parameter is changed on its own, I think it's OK just to update the state file.

@hashibot hashibot added the bug Addresses a defect in current functionality. label Jun 13, 2017
@radeksimko radeksimko added the service/rds Issues and PRs that pertain to the rds service. label Jan 25, 2018
@bflad bflad added this to the v2.18.0 milestone Jul 1, 2019
@bflad bflad self-assigned this Jul 1, 2019
bflad added a commit that referenced this issue Jul 1, 2019
…ifications were requested error when updating only allow_major_version_upgrade argument

Reference: #500

Previous output from updated acceptance testing:

```
--- FAIL: TestAccAWSDBInstance_AllowMajorVersionUpgrade (491.43s)
    testing.go:568: Step 2 error: errors during apply:

        Error: Error modifying DB Instance tf-acc-test-4576888905000364877: InvalidParameterCombination: No modifications were requested
```

Output from acceptance testing:

```
--- PASS: TestAccAWSDBInstance_AllowMajorVersionUpgrade (433.02s)
```
@bflad
Copy link
Contributor

bflad commented Jul 2, 2019

The fix for this has been merged and will release with version 2.18.0 of the Terraform AWS Provider, likely later this week.

@bflad
Copy link
Contributor

bflad commented Jul 5, 2019

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

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Nov 3, 2019

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 Nov 3, 2019
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
3 participants