Question

Difficulty: EasyAWS CodeDeploy

A developer is configuring a deployment for an AWS Lambda function using AWS CodeDeploy. The developer needs to define the deployment configuration and ensure CodeDeploy has the necessary permissions.

Which TWO of the following configurations or steps are required to successfully set up this deployment?

  1. Define the Resources section in the AppSpec file specifying the Lambda function name, alias, current version, and target version.Answer
  2. Create an IAM service role for CodeDeploy with a trust policy that allows the codedeploy.amazonaws.com service to assume the role.Answer
  3. C
    Define the BeforeInstall and AfterInstall hooks in the AppSpec file to run deployment validation scripts.
  4. D
    Configure the trust policy of the CodeDeploy IAM service role to allow the lambda.amazonaws.com service to assume it.
  5. E
    Store the application credentials in Systems Manager Parameter Store with automatic rotation enabled to secure the deployment.

Answer

To successfully deploy a Lambda function using CodeDeploy, the developer must define the Resources section in the AppSpec file to specify function details, and create an IAM service role for CodeDeploy with a trust policy that permits the codedeploy.amazonaws.com service to assume it.
Defining the Resources section in the AppSpec file is required for Lambda deployments to specify the target function name, alias, and versions. Additionally, CodeDeploy requires an IAM service role with a trust policy allowing the codedeploy.amazonaws.com service to assume it to perform actions on the developer's behalf.

Step-by-Step Solution

1
Identify the target compute platform and the required AppSpec structure.
Since the target platform is AWS Lambda, the AppSpec file must use the Resources section to specify the function name, alias, current version, and target version.
This tells CodeDeploy which function and versions are involved in the deployment.
2
Determine the required IAM configuration for the deployment service.
Create an IAM service role that grants CodeDeploy permissions to interact with AWS Lambda, and ensure the trust policy allows codedeploy.amazonaws.com to assume this role.
CodeDeploy requires permission to perform traffic shifting on the Lambda function.

Key Concept

AWS CodeDeploy Lambda deployment configuration requires specifying function resources in the AppSpec file and establishing an IAM service role that trusts the CodeDeploy service.
Rate this question