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

Feature Request: Allow Credential Creation in aws_secretsmanager_secret_version Resource #4353

Closed
bflad opened this issue Apr 25, 2018 · 7 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/secretsmanager Issues and PRs that pertain to the secretsmanager service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@bflad
Copy link
Contributor

bflad commented Apr 25, 2018

We recently released the aws_secretsmanager_secret_version resource which allows you to pass in a secret_string to create a secret version in the service. In a post release comment it was suggested that it might be nice if Terraform could generate the secret rather than requiring it to be passed in.

The Secrets Manager API provides an endpoint called GetRandomPassword. This is a feature request to implement support to call that endpoint then pass the result into SecretString or randomly generate a secret via crypto/rand, similar to aws_iam_user_login_profile.

Please vote on this issue by adding a 👍 reaction to the original issue to help prioritize interest. If you're interested in implementing this feature request, please comment below.

Terraform Version

terraform 0.10+

Affected Resource(s)

  • aws_secretsmanager_secret_version

Terraform Configuration Files

# Example implementation with GetRandomPassword, may change when developed
resource "aws_secretsmanager_secret_version" "example" {
  # ... other configuration ...
  generate_random_password { # optional
    exclude_characters = false
    exclude_lowercase = false
    exclude_numbers = false
    exclude_punctuation = false
    exclude_uppercase = false
    include_space = false
    password_length = 32
    require_each_included_type = true
  }
}

Expected Behavior

Resource does not require secret_string attribute and generates a random password (via call to GetRandomPassword or crypto/rand implementation).

Actual Behavior

New feature.

References

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/secretsmanager Issues and PRs that pertain to the secretsmanager service. labels Apr 25, 2018
@teamhanded
Copy link

This would be phenomenal, since the endpoint is a part of Secrets Manager itself instead of using Terraform resources. For example, I'm resorting to this right now, which is hackish:

resource "random_string" "secret" {
  length   = "${var.secret_length}"
  special  = true
  number = true
  upper    = true
  lower     = true
}

resource "aws_secretsmanager_secret_version" "dummy-test-credentials" {
  secret_id       = "${var.secrets_manager_secret_id}"
  secret_string = "${random_string.secret.result}"
}

In my opinion, creating the credential (e.g. prod/platforms/mysql/credentials/root) natively (using the AWS-provided API endpoint) is much more manageable.

@teamhanded
Copy link

@bflad Any updates on this?

@bflad
Copy link
Contributor Author

bflad commented Jun 26, 2018

This is not currently planned on our internal roadmap, but we would happily take a look at a pull request.

@joshuatalb
Copy link

Any updates on this? I'm currently using the hacky approach in @teamhanded's comment and getting this merged would be awesome.

@tomaszdudek7
Copy link

Any updates?

@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 May 17, 2021
@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 2021
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/secretsmanager Issues and PRs that pertain to the secretsmanager service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants