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

resource/aws_db_instance: Redact MasterUserPassword when displaying InvalidParameterValue error with CreateDBInstance #9446

Merged
merged 1 commit into from
Jul 23, 2019

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Jul 23, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Release note for CHANGELOG:

* resource/aws_db_instance: Redact `MasterUserPassword` from user interface when displaying `InvalidParameterValue` error during resource creation

It was previously requested that the aws_db_instance Terraform resource show the given CreateDBInstance input configuration when receiving an InvalidParameterValue error. This would previously show the MasterUserPassword field of the input in the UI. The logic to show the input configuration has been present since version 1.23.0 of the Terraform AWS Provider.

Previously before code update:

--- FAIL: TestAccAWSDBInstance_Password (5.84s)
    testing.go:561: Step 0, expected error:

        errors during apply: Error creating DB Instance: InvalidParameterValue: The parameter MasterUserPassword is not a valid password because it is shorter than 8 characters.
        	status code: 400, request id: 795895e7-8110-4460-9bf7-5211729522d9, {
          AllocatedStorage: 5,
          AutoMinorVersionUpgrade: true,
          BackupRetentionPeriod: 0,
          CopyTagsToSnapshot: false,
          DBInstanceClass: "db.t2.micro",
          DBInstanceIdentifier: "tf-acc-test-796357036994784624",
          DBName: "",
          DeletionProtection: false,
          Engine: "mysql",
          EngineVersion: "",
          MasterUserPassword: "invalid",
          MasterUsername: "tfacctest",
          PubliclyAccessible: false,
          StorageEncrypted: false,
          Tags: []
        }

        To match:

        MasterUserPassword: "\*{8}",

Output from acceptance testing after code update:

--- PASS: TestAccAWSDBInstance_Password (401.36s)

…nvalidParameterValue error with CreateDBInstance

It was previously requested that the aws_db_instance Terraform resource show the given CreateDBInstance input configuration when receiving an `InvalidParameterValue` error. This would previously show the `MasterUserPassword` field of the input in the UI.

Previously before code update:

```
--- FAIL: TestAccAWSDBInstance_Password (5.84s)
    testing.go:561: Step 0, expected error:

        errors during apply: Error creating DB Instance: InvalidParameterValue: The parameter MasterUserPassword is not a valid password because it is shorter than 8 characters.
        	status code: 400, request id: 795895e7-8110-4460-9bf7-5211729522d9, {
          AllocatedStorage: 5,
          AutoMinorVersionUpgrade: true,
          BackupRetentionPeriod: 0,
          CopyTagsToSnapshot: false,
          DBInstanceClass: "db.t2.micro",
          DBInstanceIdentifier: "tf-acc-test-796357036994784624",
          DBName: "",
          DeletionProtection: false,
          Engine: "mysql",
          EngineVersion: "",
          MasterUserPassword: "invalid",
          MasterUsername: "tfacctest",
          PubliclyAccessible: false,
          StorageEncrypted: false,
          Tags: []
        }

        To match:

        MasterUserPassword: "\*{8}",
```

Output from acceptance testing after code update:

```
--- PASS: TestAccAWSDBInstance_Password (401.36s)
```
@bflad bflad added bug Addresses a defect in current functionality. service/rds Issues and PRs that pertain to the rds service. labels Jul 23, 2019
@bflad bflad requested a review from a team July 23, 2019 00:40
@ghost ghost added size/S Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jul 23, 2019
Copy link
Contributor

@ryndaniels ryndaniels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 🚢

--- PASS: TestAccAWSDBInstance_Password (389.53s)

@bflad bflad added this to the v2.21.0 milestone Jul 23, 2019
@bflad bflad merged commit 1449a32 into master Jul 23, 2019
@bflad bflad deleted the s-aws_db_instance-MasterUserPassword branch July 23, 2019 15:59
bflad added a commit that referenced this pull request Jul 23, 2019
@bflad
Copy link
Contributor Author

bflad commented Jul 26, 2019

This has been released in version 2.21.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, documentation updates, or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Nov 2, 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 2, 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. size/S Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants