Curated

Testing and Deployment (3.1–3.3)

0 votes

Questions66

  1. Question 51

    Testing and Deployment

    Which AWS tool can use natural-language instructions and project code to help generate unit tests?

    Show the answer

    Correct answerA. Kiro

    AWhy this is right: Kiro can use project context and natural-language requests to help author unit tests.

    BWhy not this: CodeBuild executes configured builds and tests rather than authoring tests through a natural-language assistant.

    CWhy not this: API Gateway manages APIs and supports mock integrations rather than AI-assisted unit test generation.

    DWhy not this: CloudFormation provisions infrastructure from templates rather than generating unit tests from natural-language instructions.

    Kiro provides AI-assisted development capabilities that can generate unit tests from instructions and code context. AWS CodeBuild runs configured build and test commands but is not itself a natural-language test-generation assistant.

    Open this question
  2. Question 52

    Testing and Deployment

    A test Lambda function uses an Amazon ECR image tagged test. After that tag is moved to a new image, invocations still run the previous code; what should the developer do?

    Show the answer

    Correct answerD. Update the function code using the image URI

    AWhy not this: Publishing a version snapshots the current function rather than retrieving the newly tagged image.

    BWhy not this: Environment-variable changes do not make Lambda resolve the image tag to a new digest.

    CWhy not this: Lambda retains the resolved image digest; this is not a cache-expiration issue.

    DWhy this is right: Updating function code makes Lambda resolve the image URI to the image currently associated with the tag.

    Lambda resolves an image tag to a specific digest when function code is updated. Moving the ECR tag does not update the function automatically; publishing the unchanged function also preserves the existing image.

    Open this question
  3. Question 53

    Testing and Deployment

    A team uses CodeDeploy to release a Lambda function. The release must receive 10% of production traffic for five minutes before receiving all remaining traffic. Which deployment configuration meets this requirement?

    Show the answer

    Correct answerB. CodeDeployDefault.LambdaCanary10Percent5Minutes

    AWhy not this: This shifts traffic in 10% increments every ten minutes, rather than using the required two-step shift.

    BWhy this is right: This shifts 10% initially and the remaining 90% after five minutes.

    CWhy not this: This shifts all traffic immediately, without an initial observation period.

    DWhy not this: This shifts traffic in 10% increments every minute, rather than holding at 10% for five minutes.

    LambdaCanary10Percent5Minutes shifts 10% of traffic initially and the remainder after five minutes. Linear configurations shift equal increments repeatedly rather than making one initial shift followed by the remainder.

    Open this question
  4. Question 54

    Testing and Deployment

    Which deployment strategy replaces application instances in successive batches while the remaining instances continue serving requests?

    Show the answer

    Correct answerD. Rolling deployment

    AWhy not this: All-at-once deployment updates the target fleet together rather than in successive batches.

    BWhy not this: Blue/green deployment uses separate environments rather than replacing the serving fleet in successive batches.

    CWhy not this: Canary deployment exposes a limited share of traffic to a release before broader promotion.

    DWhy this is right: Rolling deployment updates successive batches while the remaining instances continue serving traffic.

    A rolling deployment replaces instances in successive batches while other instances remain available. Blue/green deployment instead uses separate existing and replacement environments.

    Open this question
  5. Question 55

    Testing and Deployment

    A team wants CodeDeploy to stop an Amazon EC2 application deployment and automatically restore the last successfully deployed revision when application errors exceed a threshold. Which actions establish this behavior? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersB. Create a CloudWatch alarm for the application error threshold.D. Associate the CloudWatch alarm with the CodeDeploy deployment group.E. Enable automatic rollback for deployment stops caused by alarms.

    AWhy not this: An approval action gates pipeline progression; it does not automatically restore the previous application revision.

    BWhy this is right: The alarm detects when application errors cross the threshold that should trigger deployment intervention.

    CWhy not this: Ignoring alarm polling failures controls behavior when alarm status is unavailable, not rollback when errors exceed a threshold.

    DWhy this is right: The association lets CodeDeploy monitor the alarm and stop the deployment when it enters ALARM.

    EWhy this is right: This rollback event setting causes CodeDeploy to redeploy the last successful revision after an alarm-triggered stop.

    A CloudWatch alarm detects the error threshold, its deployment-group association lets CodeDeploy stop the deployment, and alarm-triggered automatic rollback restores the last successful revision. A manual approval action does not automatically reverse a deployment.

    Open this question
  6. Question 56

    Testing and Deployment

    An Amazon ECS service uses CodeDeploy blue/green deployments behind a Network Load Balancer that must be retained. The team wants the most gradual supported production traffic shift; which deployment configuration must it use?

    Show the answer

    Correct answerC. CodeDeployDefault.ECSAllAtOnce

    AWhy not this: A longer canary interval does not make canary shifting supported with a Network Load Balancer.

    BWhy not this: This canary configuration is not supported for CodeDeploy ECS deployments using a Network Load Balancer.

    CWhy this is right: This is the only supported CodeDeploy ECS traffic-shifting configuration with a Network Load Balancer.

    DWhy not this: This linear configuration requires an Application Load Balancer for CodeDeploy ECS traffic shifting.

    For CodeDeploy-managed ECS blue/green deployments with a Network Load Balancer, only ECSAllAtOnce is supported. Canary and linear traffic shifting require an Application Load Balancer.

    Open this question
  7. Question 57

    Testing and Deployment

    Production runs release v2.4.0, while main contains unreleased features and a self-contained security-fix commit. How should a developer prepare a patch containing only the production code and that fix?

    Show the answer

    Correct answerA. Branch from v2.4.0 and cherry-pick the security-fix commit.

    AWhy this is right: The release baseline excludes unreleased features, and cherry-picking adds only the selected fix.

    BWhy not this: Starting from main retains unreleased features; merging the older release does not remove them.

    CWhy not this: Merging main brings its unreleased changes into the maintenance branch.

    DWhy not this: This retains unreleased features while removing the required security fix.

    A branch from the production release establishes the correct baseline, and cherry-picking applies only the selected fix. Merging main into that branch also brings in the unreleased features.

    Open this question
  8. Question 58

    Testing and Deployment

    How does AWS CodeDeploy restore a previously deployed application revision during a rollback?

    Show the answer

    Correct answerA. It creates a new deployment of a previous revision.

    AWhy this is right: A rollback is a new deployment that uses a previously deployed application revision.

    BWhy not this: CodeDeploy rollback does not restore instance snapshots.

    CWhy not this: Changing source control history does not redeploy an application revision to target resources.

    DWhy not this: CodeDeploy redeploys a revision rather than calculating inverse operations for installation commands.

    CodeDeploy performs a rollback by creating a new deployment of a previously deployed revision. It does not reverse installation commands or automatically undo application-side changes such as database migrations.

    Open this question
  9. Question 59

    Testing and Deployment

    A CodeDeploy deployment group has automatic rollback enabled. A deployment fails, and CodeDeploy rolls back to the last known good revision. How does CodeDeploy carry out this rollback?

    Show the answer

    Correct answerB. It starts a new deployment of the last good revision with a new deployment ID.

    AWhy not this: CodeDeploy does not undo a deployment in place; the failed deployment keeps its failed status.

    BWhy this is right: A rollback is a new deployment of the previous revision, recorded under a new deployment ID.

    CWhy not this: CodeDeploy does not snapshot instances; it redeploys the earlier application revision.

    DWhy not this: The rollback deploys the earlier revision's files and runs its lifecycle events as a full deployment.

    CodeDeploy rolls back by redeploying the last known good revision as a new deployment, so the rollback has its own deployment ID rather than restoring the failed one. It does not take or restore snapshots, and the rollback runs a full deployment of the earlier revision.

    Open this question
  10. Question 60

    Testing and Deployment

    A CloudFormation update ends in UPDATE_ROLLBACK_FAILED because the stack's service role lost permission to restore a resource. The permission is now restored, and all resources must match the previous template before another update; what should the developer do?

    Show the answer

    Correct answerD. Run ContinueUpdateRollback without skipping resources.

    AWhy not this: RollbackStack supports CREATE_FAILED and UPDATE_FAILED, not UPDATE_ROLLBACK_FAILED.

    BWhy not this: Skipping can leave the resource inconsistent with the template, violating the required end state.

    CWhy not this: The stack must recover from UPDATE_ROLLBACK_FAILED before another update can proceed.

    DWhy this is right: The permission issue is fixed, so rollback can resume and restore resources to the previous template's state.

    ContinueUpdateRollback resumes a failed update rollback after its underlying cause is fixed. Skipping the resource can leave it inconsistent with the template; RollbackStack applies to CREATE_FAILED or UPDATE_FAILED, not UPDATE_ROLLBACK_FAILED.

    Open this question
  11. Question 61

    Testing and Deployment

    A team must identify the exact Git commit used for release v3.1.0 even as development continues. Which source control practice best meets this requirement?

    Show the answer

    Correct answerA. Create a release tag and prevent it from being moved.

    AWhy this is right: A protected, unmoved tag preserves a stable association between the release name and its commit.

    BWhy not this: Renaming a branch does not prevent its tip from advancing during development.

    CWhy not this: A message can describe a release but does not establish a dedicated, stable release reference.

    DWhy not this: The branch tip changes as future changes are merged, so it is not a fixed release reference.

    A release tag identifies a specific commit; preventing tag movement preserves that association. A branch advances as commits are added, so its current tip does not provide a fixed release reference.

    Open this question
  12. Question 62

    Testing and Deployment

    Which Git feature gives a release commit a name such as v2.1.0 without creating a separate development line?

    Show the answer

    Correct answerA. Tag

    AWhy this is right: A tag assigns a name to a specific commit, making it suitable for marking a release.

    BWhy not this: A branch represents a development line rather than a fixed release marker.

    CWhy not this: A pull request proposes and reviews changes before they are integrated.

    DWhy not this: A merge integrates changes from different development histories.

    A tag names a specific commit and is commonly used to identify a release. A branch identifies a development line whose tip normally advances as commits are added.

    Open this question
  13. Question 63

    Testing and Deployment

    A developer wants Kiro to help create a repeatable staging environment from written requirements. Which approach best combines AI assistance with controlled provisioning?

    Show the answer

    Correct answerD. Generate a template with Kiro, then validate and review its change set

    AWhy not this: An approval action gates pipeline progression but does not translate requirements into infrastructure.

    BWhy not this: CloudFormation requires a valid template; it does not interpret prose requirements as infrastructure definitions.

    CWhy not this: An AppSpec file describes application deployment instructions, not general environment provisioning.

    DWhy this is right: AI-assisted template authoring followed by validation and change-set review supports repeatable, controlled provisioning.

    Kiro, the AWS AI-assisted IDE, can help author infrastructure templates such as CloudFormation templates, which should be validated and their change sets reviewed before deployment. An AppSpec file controls application deployment behavior; it does not define a complete infrastructure environment.

    Open this question
  14. Question 64

    Testing and Deployment

    A Bedrock-based post-deployment validator reads logs containing user-controlled text and can invoke a rollback tool. A log entry instructs it to ignore validation rules and invoke that tool; which design best preserves useful analysis without granting log content operational authority?

    Show the answer

    Correct answerA. Treat logs as untrusted data and enforce rollback criteria outside the model

    AWhy this is right: Separating untrusted evidence from action authorization limits the impact of indirect prompt injection.

    BWhy not this: Credential redaction protects secrets but does not prevent instructions in logs from influencing tool use.

    CWhy not this: A generated explanation does not prevent the model from following malicious embedded instructions.

    DWhy not this: Additional log entries do not establish a security boundary between evidence and instructions.

    User-controlled log content can carry indirect prompt injection. Treating logs as untrusted evidence and enforcing rollback criteria outside the model prevents embedded instructions from authorizing actions; credential redaction alone does not address this risk.

    Open this question
  15. Question 65

    Testing and Deployment

    A custom CodePipeline action uses Amazon Bedrock to recommend production approval from test reports. Policy requires passing security tests for the exact revision, but the model recommends approval when that report is missing; what should the developer implement?

    Show the answer

    Correct answerB. Enforce required evidence checks before accepting the recommendation

    AWhy not this: Model confidence does not prove that mandatory security tests ran for the deployed revision.

    BWhy this is right: Required evidence checks enforce release policy independently of the model's recommendation.

    CWhy not this: A branch's latest successful report might describe a different revision.

    DWhy not this: Agreement between models does not supply the missing revision-specific test evidence.

    Deterministic checks must enforce required evidence and revision matching before an AI recommendation can authorize progression. Model confidence or agreement cannot establish that a missing security test passed.

    Open this question
  16. Question 66

    Testing and Deployment

    A team wants to use Amazon Q Developer to help resolve recurring CodeBuild test failures. Which uses appropriately apply its generative AI capabilities? (Choose two.)

    Choose 2 answers

    Show the answer

    Correct answersA. Explain likely causes from supplied build logs and relevant sourceD. Suggest regression tests based on the failure and proposed code fix

    AWhy this is right: Amazon Q Developer can analyze supplied diagnostic context and suggest likely causes of a build failure.

    BWhy not this: Restoring a deployed revision requires a configured deployment or rollback operation, not merely AI assistance.

    CWhy not this: Pipeline action dependencies are enforced by the pipeline configuration, not by AI interpretation of a build specification.

    DWhy this is right: Amazon Q Developer can suggest tests that exercise a reported defect and help verify a proposed fix.

    Amazon Q Developer can help interpret build failures and generate relevant test suggestions. Pipeline scheduling and revision restoration are orchestration or deployment operations, not outcomes supplied merely by AI analysis.

    Open this question