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

r/aws_secret_backend - add support for username_template #1292

Merged
merged 4 commits into from
Jan 14, 2022

Conversation

DrFaust92
Copy link
Contributor

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

Closes #1180

Release note for CHANGELOG:

aws_secret_backend - add support for `username_template`

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSSecretBackend_'
--- PASS: TestAccAWSSecretBackend_basic (40.29s)
--- PASS: TestAccAWSSecretBackend_usernameTempl (19.98s)

Copy link
Contributor

@vinay-gopalan vinay-gopalan left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @DrFaust92! Looking great just a few comments

func testAccAWSSecretBackendConfig_userTemplate(path, accessKey, secretKey, templ string) string {
return fmt.Sprintf(`
resource "vault_aws_secret_backend" "test" {
path = %[1]q
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we have these as %s?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why? in going by golang features. https://zetcode.com/golang/string-format/. using %s is a bit verbose IMO. ill change it if you still want me to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to move this along.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I also meant since we aren't reusing any of the indexed values and %[1]s is only used in one spot, we can probably just set them all to be %s

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@vinay-gopalan vinay-gopalan merged commit ad6634f into hashicorp:main Jan 14, 2022
@benashz benashz added this to the 3.2.0 milestone Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: add support (for the upcoming Vault feature) for username templating on AWS Secrets Engine
3 participants