Soru

Zorluk: ZorAWS CodePipeline

A developer is configuring a test stage in AWS CodePipeline that invokes an AWS Lambda function to run integration tests against an Amazon RDS database. The Lambda function requires access to the database credentials and must inform CodePipeline of the test execution results so the pipeline can proceed or halt. Which configuration steps should the developer perform to meet these requirements? (Select TWO.)

  1. Store the database credentials in AWS Secrets Manager and grant the Lambda execution role permission to retrieve the secret.Cevap
  2. Program the Lambda function to parse the job ID from the event payload and invoke PutJobSuccessResult or PutJobFailureResult to report the outcome to CodePipeline.Cevap
  3. C
    Store the database credentials as a standard parameter in Systems Manager Parameter Store and retrieve them using the Parameter Store API.
  4. D
    Modify the trust policy of the Lambda execution role to allow the CodePipeline service principal to assume the role.
  5. E
    Save the database credentials as plaintext environment variables in the Lambda function configuration to bypass permission checks.

Cevap

Store the database credentials in AWS Secrets Manager and grant the Lambda execution role permission to retrieve the secret. Program the Lambda function to parse the job ID from the event payload and invoke PutJobSuccessResult or PutJobFailureResult to report the outcome to CodePipeline.
The correct steps involve securely managing credentials and properly signaling CodePipeline. Storing database credentials in AWS Secrets Manager is secure and supports automatic rotation. Additionally, AWS CodePipeline expects any invoked Lambda action to notify it of success or failure by calling PutJobSuccessResult or PutJobFailureResult using the job ID extracted from the event payload.

Adım Adım Çözüm

1
Analyze how AWS CodePipeline interacts with custom Lambda actions.
The Lambda function receives a job details payload from CodePipeline containing a unique job ID.
This job ID is required to notify CodePipeline of the action's success or failure using the appropriate API calls.
2
Implement the completion signaling logic inside the Lambda function.
The Lambda code calls PutJobSuccessResult on success or PutJobFailureResult on failure, passing the job ID.
If the Lambda function does not send this signal, CodePipeline will remain in the 'InProgress' state until the action times out.
3
Evaluate options for secure credential retrieval.
Database credentials should be stored in AWS Secrets Manager, and the Lambda execution role must be granted permissions to retrieve them.
This ensures the credentials are encrypted, not hardcoded in the codebase, and can be rotated automatically.

Anahtar Kavram

AWS CodePipeline integration with AWS Lambda requires the Lambda function to explicitly return status using the PutJobSuccessResult or PutJobFailureResult API, and secrets should be managed securely using AWS Secrets Manager.
Tahmini Süre:2m 0s
Bu soruyu puanla