A developer is implementing a serverless payment microservice using AWS Lambda. The microservice needs to securely access a third-party API key that must be rotated every 90 days. Which solution should the developer implement to manage and rotate this API key with the lowest operational overhead?
- AStore the API key in AWS Systems Manager Parameter Store as a SecureString parameter. Configure a recurring Amazon EventBridge rule that triggers a Lambda function to update the parameter value.
- Store the API key in AWS Secrets Manager. Configure automatic rotation for the secret, and associate a custom AWS Lambda function to execute the rotation steps with the payment provider.Cevap
- CEmbed the API key directly in the Lambda function's deployment package as a static configuration file. Configure the AWS SDK inside the Lambda function to decrypt the file at runtime using a customer managed key.
- DStore the API key in AWS Systems Manager Parameter Store as a String parameter. Enable the built-in Parameter Store auto-rotation feature and link it to the Lambda function's execution role.
Cevap
Store the API key in AWS Secrets Manager, configure automatic rotation, and associate a custom AWS Lambda function to handle the rotation lifecycle events with the third-party payment provider.
AWS Secrets Manager is designed to store, manage, and rotate secrets. For third-party APIs that do not have built-in rotation integration in AWS, Secrets Manager allows you to configure automatic rotation by invoking a custom AWS Lambda function. This custom function implements the rotation logic (e.g., creating a new key with the provider and updating the secret value) automatically on the set schedule, minimizing operational overhead.
Adım Adım Çözüm
Anahtar Kavram
Secrets Management and Parameter Store