Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
Auto Rotation of Secret Key and Access Key in AWS using Lambda

I want to rotate Access Key and Secret Key automatically using Lambda. (boto3)

Condition is like:

  1. At 85 day of key age user will get a Email for warning
  2. At 90 day Age user will receive a new credential via Email.
  3. At 95th day the old key gets deactivate automatically.(user need to login via fresh Access key and secret key)

    Is this is possible using AWS lambda? Can anyone help me with the code?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Yes. Writing code is use-case specific. You can start writing it yourself and then ask again if you have any specific issue.

But generally, to implement periodic rotation you would use:

  • CloudWatch Event scheduled rules

The rule would automatically call a target, i.e. your lambda function, which would have logic to perform the rotation. For that boto3's create_access_key_pair along with deleting/disable existing keys (delete_access_key or update_access_key to disable).

over 4 years ago · Santiago Trujillo Report

0

Yes this is definitely possible, the AWS SDK has a action for list_access_keys.

If you created a CloudWatch event you could trigger this Lambda every day. Once you call the request you can see all access keys with a UserName value and a CreateDate value.

By doing a comparison between the 2 dates you could then perform the requested action.

  • Using either SES or SNS notify the user at 85 days
  • Use the create_access_key method at 90 days
  • Use the delete_access_key at 95 days.
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!