Skip to content

How do we delete Secrets Manager secrets created by the Redshift integration?

0

We built a redshift serverless cluster that is managing it's secrets in secrets manager as described here: https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-secrets-manager-integration.html

We've deleted that cluster and want to stand up another with the same name but the old secret is still in place so, we can't do so because the secrets already exists. The docs say the cluster should've deleted the secret but it hasn't done so: Amazon Redshift manages the settings for the secret and rotates the secret every 30 days by default. You can manually rotate the secret at any time. If you delete a provisioned cluster or serverless namespace that manages a secret in AWS Secrets Manager, the secret and its associated metadata are also deleted. https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-secrets-manager-integration.html

I've tried the force delete in this article but get this error:

❯ aws secretsmanager delete-secret --secret-id 'arn:aws:secretsmanager:us-west-1:111111111111:secret:redshift!cluster-admin-sdxvUc' --force-delete-without-recovery --region us-west-1
An error occurred (InvalidRequestException) when calling the DeleteSecret operation: Operation is not allowed on secret owned by redshift

What is the solution?

  • please accept the answer if it was helpful

1 Answer
0

https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-secrets-manager-integration.html#redshift-secrets-manager-integration-considerations

When you pause a cluster whose admin credentials are managed by AWS Secrets Manager, your cluster's secret won't be deleted and you'll continue to be billed for the secret. Secrets are only deleted when you delete the cluster.

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

  • Thx for the answer but we didn't pause the clusters, we deleted them. The docs say that when deleting a cluster, the secrets it created will be deleted also (overriding the grace period). But this is not the case. We worked around this issue by changing the Redshift admin account username which changes the name of the secret but it'd be better if we didn't have to do that.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.