DVA-C02 Deployment • Complete Question Bank
Complete DVA-C02 Deployment question bank — all 0 questions with answers and detailed explanations.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag a concept onto its matching description — or click a concept then click the description.
OK
Created
Bad Request
Forbidden
Internal Server Error
Drag a concept onto its matching description — or click a concept then click the description.
3306
6379
5432
11211
1521
Refer to the exhibit.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"codedeploy:RegisterApplicationRevision",
"codedeploy:GetDeploymentGroup"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": "arn:aws:s3:::my-bucket/*"
}
]
}Refer to the exhibit.
Resources:
MyLambdaFunction:
Type: AWS::Lambda::Function
Properties:
Code:
S3Bucket: my-bucket
S3Key: function.zip
Handler: index.handler
Role: arn:aws:iam::123456789012:role/lambda-role
Runtime: python3.9
MyLambdaVersion:
Type: AWS::Lambda::Version
Properties:
FunctionName: !Ref MyLambdaFunction
Description: "v1"Refer to the exhibit.
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"codedeploy:CreateDeployment",
"codedeploy:GetDeployment"
],
"Resource": "arn:aws:codedeploy:us-east-1:123456789012:deploymentgroup:MyApplication/MyDeploymentGroup"
},
{
"Effect": "Allow",
"Action": [
"codedeploy:RegisterApplicationRevision",
"codedeploy:GetApplicationRevision"
],
"Resource": "arn:aws:codedeploy:us-east-1:123456789012:application:MyApplication"
}
]
}
```Refer to the exhibit.
```
Resources:
MyBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: my-unique-bucket-123
VersioningConfiguration:
Status: Enabled
MyBucketPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket: !Ref MyBucket
PolicyDocument:
Statement:
- Effect: Allow
Principal: "*"
Action: "s3:GetObject"
Resource: !Sub "${MyBucket.Arn}/*"
```Refer to the exhibit.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"codebuild:StartBuild",
"codebuild:BatchGetBuilds"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"codepipeline:StartPipelineExecution",
"codepipeline:GetPipelineExecution"
],
"Resource": "arn:aws:codepipeline:us-east-1:123456789012:MyPipeline"
}
]
}Refer to the exhibit.
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Sample template",
"Resources": {
"MyBucket": {
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketName": "my-unique-bucket-12345",
"VersioningConfiguration": {
"Status": "Enabled"
}
},
"DeletionPolicy": "Retain"
},
"MyEC2Instance": {
"Type": "AWS::EC2::Instance",
"Properties": {
"ImageId": "ami-0abcdef1234567890",
"InstanceType": "t2.micro"
}
}
}
}{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Resource": "arn:aws:s3:::my-bucket/*"
}
]
}{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"codedeploy:GetDeployment",
"codedeploy:GetDeploymentGroup",
"codedeploy:RegisterApplicationRevision",
"codedeploy:CreateDeployment"
],
"Resource": "*"
}
]
}{
"AWSTemplateFormatVersion": "2010-09-09",
"Resources": {
"MyBucket": {
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketName": "my-app-data-12345"
}
}
}
}DeploymentId: d-EXAMPLE123 Status: FAILED Error: The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available, or some instances in your deployment group are experiencing problems. Instance logs: i-abc12345: Script 'BeforeInstall' failed with exit code 1
Refer to the exhibit. IAM policy attached to a deployment role:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ecs:UpdateService",
"ecs:DescribeServices"
],
"Resource": "arn:aws:ecs:us-east-1:123456789012:service/my-cluster/my-service"
},
{
"Effect": "Allow",
"Action": [
"ecs:RegisterTaskDefinition"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"iam:PassRole"
],
"Resource": "arn:aws:iam::123456789012:role/ecsTaskExecutionRole"
}
]
}Refer to the exhibit. Output from aws cloudformation describe-stacks:
{
"Stacks": [
{
"StackName": "my-stack",
"StackStatus": "ROLLBACK_COMPLETE",
"CreationTime": "2024-01-15T10:00:00Z",
"LastUpdatedTime": "2024-01-15T10:05:00Z",
"StackStatusReason": "The following resource(s) failed to create: [WaitCondition]. The following resource(s) failed to create: [EC2Instance]. . Rollback requested by user."
}
]
}Refer to the exhibit. CloudFormation template snippet:
Resources:
MyLambdaFunction:
Type: AWS::Lambda::Function
Properties:
Code:
S3Bucket: my-bucket
S3Key: my-function.zip
Handler: index.handler
Role: !GetAtt LambdaExecutionRole.Arn
Runtime: nodejs18.x
LambdaExecutionRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: lambda.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRoleRefer to the exhibit. Output from aws deploy get-deployment --deployment-id d-EXAMPLE:
{
"deploymentInfo": {
"applicationName": "MyApp",
"deploymentGroupName": "MyDG",
"status": "Failed",
"errorInformation": {
"code": "HEALTH_CONSTRAINTS",
"message": "Some instances failed to meet the minimum health requirements."
},
"deploymentOverview": {
"Pending": 0,
"InProgress": 0,
"Succeeded": 3,
"Failed": 2,
"Skipped": 0
},
"creator": "user"
}
}Refer to the exhibit.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"codedeploy:GetDeployment",
"codedeploy:GetDeploymentGroup"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"codedeploy:CreateDeployment",
"codedeploy:RegisterApplicationRevision"
],
"Resource": "arn:aws:codedeploy:us-west-2:123456789012:deploymentgroup:MyApplication/MyDeploymentGroup"
}
]
}
```Refer to the exhibit.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"elasticbeanstalk:DescribeEnvironmentResources",
"elasticbeanstalk:UpdateEnvironment"
],
"Resource": "arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/MyApp/MyEnv"
},
{
"Effect": "Deny",
"Action": "elasticbeanstalk:DeleteEnvironment",
"Resource": "*"
}
]
}
```Refer to the exhibit.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Resource": "arn:aws:s3:::my-bucket/*"
},
{
"Effect": "Allow",
"Action": [
"codedeploy:CreateDeployment",
"codedeploy:GetDeployment"
],
"Resource": "*"
}
]
}
```Refer to the exhibit.
IAM Policy:
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"codecommit:GitPull",
"codecommit:GitPush"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"codepipeline:StartPipelineExecution"
],
"Resource": "arn:aws:codepipeline:us-east-1:123456789012:MyPipeline"
}
]
}
```Refer to the exhibit.
CloudFormation template snippet:
```yaml
Resources:
MyBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Sub "my-app-bucket-${AWS::AccountId}"
VersioningConfiguration:
Status: Enabled
LifecycleConfiguration:
Rules:
- Id: ExpireOldVersions
Status: Enabled
NoncurrentVersionExpirationInDays: 30
```{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::my-bucket/*"
},
{
"Effect": "Allow",
"Action": [
"lambda:InvokeFunction"
],
"Resource": "*"
}
]
}{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeImages",
"ec2:RunInstances",
"ec2:TerminateInstances"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"iam:PassRole"
],
"Resource": "arn:aws:iam::123456789012:role/MyAppRole"
}
]
}A developer is deploying a serverless application using AWS SAM. The application includes an API Gateway HTTP API and multiple Lambda functions. The developer wants to implement a gradual deployment strategy where 10% of traffic is shifted to the new version, and if no errors occur, the remaining traffic is shifted after 5 minutes. The developer has defined the deployment preference in the SAM template. However, after deploying, the developer notices that the traffic shift happens immediately and not gradually. The SAM template includes the following configuration for one of the Lambda functions:
DeploymentPreference: Type: Linear10PercentEvery5Minutes
The developer has confirmed that the Lambda function version is being updated. What is the MOST likely reason the gradual deployment is not working?
A developer is using the AWS CLI to deploy a new version of a Lambda function. The developer runs the following command:
aws lambda update-function-code --function-name my-function --zip-file fileb://my-code.zip
After the command completes, the developer checks the function and sees that the code has been updated but the version number is still $LATEST. The developer wants to create a new version so that the previous version is preserved. What should the developer do next?