How can i enable and disable access key and secret key in CLI?

0

hello, I need to be able to deactivate and activate the access key and secret key automatically from time to time through a CLI script, is this possible? And if it is, how is it done, what commands are used?

Thanks in advance

1 Answer
3

Yes, you can do this using aws cli. You can run these commands to activate/deactivate access keys:

aws iam update-access-key --access-key-id AKIAIOSFODNN7EXAMPLE --status Inactive --user-name Bob
aws iam update-access-key --access-key-id AKIAIOSFODNN7EXAMPLE --status Active --user-name Bob

See reference docs here

profile pictureAWS
answered a year ago
profile pictureAWS
EXPERT
reviewed a year ago
  • Thanks for the answer, now I have another question, is it possible to condition the activation of the access key? so that it only fires when I have new records in a database in aws timestream?

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.

Guidelines for Answering Questions