Pages

Monday, July 10, 2023

Delete Secret without waiting for 7 days

If we delete secret from AWS Console then we've to wait atleast for 7 days to create with the same name. but here is the command to delete the secret forecefully via CLI command


aws secretsmanager delete-secret --secret-id /DOS/CICD/SERVICE --force-delete-without-recovery --region eu-west-1

{

    "ARN": "arn:aws:secretsmanager:eu-west-1:xxxx:secret:/DOS/CICD/SERVICE-0ApOvK",

    "Name": "/DOS/CICD/SERVICE",

    "DeletionDate": 1688618796.092

Then we can go ahead and delete the secret in AWS Console without waiting time.


Command to read the secret value using AWS CLI

/usr/local/bin/aws secretsmanager get-secret-value --secret-id "$(dirname /${AWS_SM_COMMON})/SERVICE"

No comments:

Post a Comment