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

RDS and secrets manager terraform - deadlock issue #19683

Closed
Nimsgs opened this issue Jun 6, 2021 · 5 comments
Closed

RDS and secrets manager terraform - deadlock issue #19683

Nimsgs opened this issue Jun 6, 2021 · 5 comments
Labels
service/rds Issues and PRs that pertain to the rds service. service/secretsmanager Issues and PRs that pertain to the secretsmanager service. upstream Addresses functionality related to the cloud provider.

Comments

@Nimsgs
Copy link

Nimsgs commented Jun 6, 2021

I am creating secrets manager through the console and RDS using terraform. While creating RDS, it requires a username and password which needs to be retrieved from Secrets manager as below:
username = local.db_secret.username
password = local.db_secret.password

But while creating a secrets manager for storing the RDS credentials, it asks for the RDS host- This is mandatory while creating the secrets- Select which RDS database this secret will access
Now before creating the RDS how will I pass this host to secrets manager and for creating the rds, I need to access the secrets manager for username and password. This is a chicken egg problem. Is there any solution to handle this deadlock situation ?

@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jun 6, 2021
@chrisbulgaria
Copy link
Contributor

Yes , you have todo it on two steps - see here for cloud formation : https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-secretsmanager-secrettargetattachment.html

unfortunately terraform does not support such secret target attachment yet , otherwise you could do everything from terraform ( no console, starting with a random password and rotate then ) , see here:
#9183

Chris

@Nimsgs
Copy link
Author

Nimsgs commented Jun 7, 2021

Thanks for the response Chris. Do you know when this capability will be enabled for Terraform ?

@chrisbulgaria
Copy link
Contributor

No, the best you can do is vote on that issue #9183 such that it may get prioritised higher by Hashicorp.
Until then you could use as a workaround the terraform cloudformation stack resource to call cloud formation.

@anGie44 anGie44 added upstream Addresses functionality related to the cloud provider. service/secretsmanager Issues and PRs that pertain to the secretsmanager service. service/rds Issues and PRs that pertain to the rds service. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 8, 2021
@anGie44
Copy link
Contributor

anGie44 commented Jun 8, 2021

Hi @Nimsgs , thank you for raising this issue. Just echoing @chrisbulgaria 's comment above to vote and follow #9183 to stay up-to-date with future terraform provider support. I'm going to close this issue to ensure we have one place to track community interest for the feature support, but thanks again!

@anGie44 anGie44 closed this as completed Jun 8, 2021
@github-actions
Copy link

github-actions bot commented Jul 9, 2021

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 Jul 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/rds Issues and PRs that pertain to the rds service. service/secretsmanager Issues and PRs that pertain to the secretsmanager service. upstream Addresses functionality related to the cloud provider.
Projects
None yet
Development

No branches or pull requests

3 participants