DVA-C02 practice question · Security
A developer is writing a custom AWS Lambda rotation function for an AWS Secrets Manager secret that stores credentials…
A developer is writing a custom AWS Lambda rotation function for an AWS Secrets Manager secret that stores credentials for a third-party service. Secrets Manager calls the function once for each rotation step. Which list shows the steps the function must handle, in the order Secrets Manager runs them?
- AcreateSecret, setSecret, testSecret, finishSecret
- BcreateSecret, testSecret, setSecret, finishSecret
- CgenerateSecret, applySecret, validateSecret, promoteSecret
- DcreateSecret, setSecret, testSecret, deleteSecret
Show the answer and explanation
Correct answer: A) createSecret, setSecret, testSecret, finishSecret
A Secrets Manager rotation function handles four steps in this order: createSecret, setSecret, testSecret, and finishSecret. The new value is staged as AWSPENDING and becomes AWSCURRENT only after it has been applied and tested.
Why each option is right or wrong
- A) Correct. createSecret stores a new secret value with the AWSPENDING label. setSecret changes the credential in the service to match it. testSecret uses the AWSPENDING version to access the service. finishSecret moves the AWSCURRENT label to the new version, and Secrets Manager adds AWSPREVIOUS to the old one.
- B) Incorrect. The step names are right but the order is wrong. The new credential can only be tested after setSecret has applied it to the service. Testing first would fail.
- C) Incorrect. These describe the right ideas, but they are not the step names Secrets Manager passes to the function. The steps are createSecret, setSecret, testSecret, and finishSecret.
- D) Incorrect. The last step is finishSecret, which moves the AWSCURRENT label to the new version. The previous version is not deleted. It is kept with the AWSPREVIOUS label as the last known good version.
- Exam domain
- Security · 26% of DVA-C02
- Question type
- Multiple choice (one answer)
Related DVA-C02 questions
- A developer's application runs under an IAM role in a member account of an AWS Organizations organization.Security
- Which AWS service should a developer use to manage user sign-up, sign-in, and access control for a mobile or web…Security
- A web application stores session tokens and needs to prevent them from being read by client-side JavaScript in the…Security
- A Lambda function's execution role has the AWS managed AmazonS3FullAccess policy attached.Security
All 67 free DVA-C02 questions by domain · 15 sample questions on one page
Practise the full DVA-C02 exam
This question is one of a small free sample from the CertRidge DVA-C02 bank. Full practice exams match the real exam's length, time limit and domain weights, explain every option, and Review Mode re-drills the questions you miss.
Original question written from the official exam guide. Not affiliated with AWS; never copied from the real exam.
Worth reading: DVA-C02 cheat sheet, Lambda, DynamoDB, API Gateway, IAM and Cognito, messaging, CI/CD and X-Ray in tables, plus what DVA-C03 changes.