Hi all, I have integrated automated password rota...
# ask-metaflow
a
Hi all, I have integrated automated password rotation to secretsmanager which now RDS and ECS are pulling from. Unfortunately, after I do a new terrafrom apply and read in the changed secret from secretsmanager, the ECS services (metadata backend + UI) fail. I thought just rotating the password in secretsmanager and propagating the updated passwords to the resources that consume it would suffice, but is there an additional thing I need to do?
1
a
did you use the new RDS <> secrets manager integration? or the old style where you rotate secrets via lambda and update RDS in your lambda?
I guess either way you need to find a way to bounce ECS task to re-read the secret, I don't remember for sure but it doesn't look like AWS would do that for you 🤔
a
The old way - update RDS via lambda. Yes you're correct. I would have to do another
terraform apply
after the rotation to get the ECS task to re-read the secret. That's another thing too - passing the password via environment variables is not very secure. It's even visible from the console. Are there are other options?
Looking through some docs, it might be possible to configure a task definition to read environment variables directly from secretsmanager. I will have to experiment with that.
a
yes! i was going to suggest that. Its not too bad in this case since RDS instance is not available outside from networking perspective, so we essentially rely on network perimeter security there to limit access, and to simplify open source terraform template. But to harden it further makes sense to use SecretsManager reference in ECS task.
a
Perfect. I'll give it a go. Thanks Oleg!