Curated

Testing and Deployment (3.1–3.3)

0 votes

Questions66

  1. Question 1

    Testing and Deployment

    A Python Lambda ZIP includes urllib3 but relies on runtime-provided Boto3 and botocore. After a runtime SDK update, imports fail because of incompatible dependency versions. How should the developer make the package independent of runtime SDK version changes?

    Show the answer

    Correct answerA. Package compatible Boto3, botocore, and urllib3 versions together.

    AWhy this is right: A complete, compatible packaged SDK dependency set takes precedence over runtime-provided SDK libraries.

    BWhy not this: An environment variable does not install or pin Python SDK packages.

    CWhy not this: Using the runtime's complete SDK avoids the partial override but does not provide independence from its version changes.

    DWhy not this: The ZIP copy takes precedence over the layer, and the runtime SDK dependency remains.

    Packaging a compatible SDK dependency set gives the function control over those versions and avoids mixing packaged libraries with an updated runtime SDK. Removing urllib3 may restore compatibility, but still leaves the function dependent on runtime SDK updates.

    Open this question
  2. Question 2

    Testing and Deployment

    A Python Lambda deployment package contains a native library built on a developer's macOS laptop. The function fails to import the library on its x86_64 Lambda runtime. What should the developer do?

    Show the answer

    Correct answerB. Build the library for the function's Linux environment and architecture.

    AWhy not this: More memory does not resolve operating system or architecture incompatibility.

    BWhy this is right: Building for the target Linux environment and x86_64 architecture produces a compatible native dependency.

    CWhy not this: Changing the search path cannot make an incompatible native binary load successfully.

    DWhy not this: A layer does not make a macOS native binary compatible with the Lambda Linux environment.

    Native dependencies must be compatible with the Lambda runtime's operating system and processor architecture. Moving an incompatible binary into a Lambda layer changes its packaging, not its compatibility.

    Open this question
  3. Question 3

    Testing and Deployment

    Which Lambda feature packages shared libraries separately from function code for reuse across multiple ZIP-based functions?

    Show the answer

    Correct answerA. Lambda layers

    AWhy this is right: Layers provide separately packaged dependencies that multiple compatible functions can use.

    BWhy not this: Environment variables supply configuration values rather than library files.

    CWhy not this: Aliases reference function versions rather than package shared libraries.

    DWhy not this: Versions preserve function code and configuration rather than provide reusable dependency packages.

    Lambda layers distribute libraries and other dependencies separately from function deployment packages. Lambda versions preserve snapshots of individual functions; they do not provide a shared library package.

    Open this question
  4. Question 4

    Testing and Deployment

    A team uses unique release tags in an Amazon ECR repository. It needs ECR to reject attempts to push a different image using an existing release tag. What should the developer configure?

    Show the answer

    Correct answerB. Immutable image tags without exclusion filters

    AWhy not this: Lifecycle policies control expiration and retention, not tag overwrites.

    BWhy this is right: Immutable tags without exclusions cause ECR to reject pushes that overwrite existing tags.

    CWhy not this: Download permissions control image retrieval rather than whether existing tags can be overwritten.

    DWhy not this: Image scanning identifies vulnerabilities rather than enforcing tag immutability.

    ECR tag immutability prevents an existing tag from being overwritten with another image. Lifecycle policies control image expiration, not whether a tag can be reassigned.

    Open this question
  5. Question 5

    Testing and Deployment

    A Lambda function passes unit tests that mock DynamoDB, but deployed invocations fail with AccessDeniedException. Which additional test would BEST detect this failure before promotion?

    Show the answer

    Correct answerC. Invoke the deployed function against a test table using its execution role

    AWhy not this: Additional local fixtures test input handling but do not verify the deployed execution role's permissions.

    BWhy not this: Mocked errors validate error-handling behavior, not the effective permissions of the deployed function.

    CWhy this is right: A real invocation exercises the deployed permissions and reveals denied DynamoDB operations.

    DWhy not this: The presence of a table does not establish that the function has permission to access it.

    A deployed integration test exercises the function's actual execution role and access to DynamoDB. Mocked error responses can test error handling, but they cannot establish whether the deployed IAM permissions permit the operation.

    Open this question
  6. Question 6

    Testing and Deployment

    A team needs an API Gateway REST API to return a predefined JSON response while an external dependency is unavailable. Which configuration meets this need without a backend?

    Show the answer

    Correct answerA. A MOCK integration with an integration response template

    AWhy this is right: A MOCK integration can return predefined status codes and response bodies without a backend.

    BWhy not this: An HTTP proxy forwards requests to a backend; a method response model does not supply a mock response.

    CWhy not this: An AWS service integration calls an AWS service; request validation does not create response bodies.

    DWhy not this: A Lambda proxy requires a function backend; a saved test event does not generate API responses.

    An API Gateway MOCK integration returns configured responses without calling a backend, and an integration response template can supply the JSON body. An HTTP proxy integration still requires a reachable HTTP backend; a response model does not generate its response.

    Open this question
  7. Question 7

    Testing and Deployment

    Which AWS SAM capability runs a Lambda function locally with a supplied event to check its behavior?

    Show the answer

    Correct answerB. SAM local invocation

    AWhy not this: Deployment provisions or updates AWS resources rather than running a local test.

    BWhy this is right: Local invocation executes the function locally with an event so its behavior can be checked.

    CWhy not this: Template validation checks the infrastructure template rather than executing function code.

    DWhy not this: Event generation produces sample input payloads rather than executing the function.

    SAM local invocation runs function code locally using a supplied event. SAM event generation creates sample event payloads but does not execute the function.

    Open this question
  8. Question 8

    Testing and Deployment

    A developer must verify that an AWS CDK stack defines an S3 bucket with versioning enabled, without deploying resources. Which test approach should the developer use?

    Show the answer

    Correct answerB. Assert the bucket properties in the synthesized template

    AWhy not this: An unreviewed snapshot establishes a baseline without confirming that versioning is enabled.

    BWhy this is right: A resource-property assertion checks the expected versioning configuration without creating the bucket.

    CWhy not this: A local function invocation tests handler behavior, not the bucket configuration defined by the stack.

    DWhy not this: Template validation does not assert application-specific resource requirements such as enabled versioning.

    A CDK fine-grained assertion can check that the synthesized bucket has versioning enabled without deployment. CloudFormation template validation checks template validity, not whether the bucket meets the application's versioning requirement.

    Open this question
  9. Question 9

    Testing and Deployment

    A team is moving an existing ZIP-based Lambda function to a container built from a non-AWS Linux base image. The build produces a multi-architecture image without Lambda runtime integration; which approach makes it deployable?

    Show the answer

    Correct answerD. Create a new function with a single-architecture image containing a runtime interface client.

    AWhy not this: The runtime interface emulator supports local testing and does not replace the runtime interface client.

    BWhy not this: Lambda requires an image targeting a single architecture, not a multi-architecture image.

    CWhy not this: An existing function cannot change its deployment package type from ZIP to container image.

    DWhy this is right: A new image-based function, one target architecture, and a runtime interface client satisfy the requirements.

    The migration requires a new function because its package type cannot be changed. The image must target one architecture and implement the Lambda Runtime API, typically through a runtime interface client; the runtime interface emulator is for local testing.

    Open this question
  10. Question 10

    Testing and Deployment

    Which AWS service stores container images that Lambda uses as deployment packages?

    Show the answer

    Correct answerD. Amazon Elastic Container Registry

    AWhy not this: Amazon S3 can store Lambda ZIP deployment packages, not serve as Lambda's container image registry.

    BWhy not this: AWS CodeArtifact stores software packages and dependencies, not Lambda container deployment images.

    CWhy not this: Amazon ECS orchestrates container workloads; it does not store Lambda deployment images.

    DWhy this is right: Amazon ECR is the container image registry used for Lambda image deployment packages.

    Lambda retrieves container image deployment packages from Amazon Elastic Container Registry. Amazon Elastic Container Service orchestrates containers but is not an image registry.

    Open this question
  11. Question 11

    Testing and Deployment

    Several ZIP-based Lambda functions reference version 3 of a shared dependency layer. A developer publishes version 4 with a security fix. Which actions deploy the fix to those functions? (Choose two.)

    Choose 2 answers

    Show the answer

    Correct answersC. Update each function to reference the version 4 layer ARN.D. Rebuild each function ZIP with the fixed dependency and remove the old layer reference.

    AWhy not this: Functions remain pinned to version 3 until their configuration or packaging changes.

    BWhy not this: Published layer versions are immutable; their dependency files cannot be overwritten.

    CWhy this is right: Changing the layer reference makes each function use the newly published dependency version.

    DWhy this is right: Bundling the fixed dependency and removing the old layer replaces the vulnerable dependency.

    Functions use specific, immutable layer versions. Referencing version 4 or bundling the fixed dependency while removing the old layer deploys the fix; publishing a new layer version alone does not update existing functions.

    Open this question
  12. Question 12

    Testing and Deployment

    A Lambda function requires 280 MB of uncompressed code and dependencies, all of which must be packaged for deployment. Which approach meets Lambda packaging limits?

    Show the answer

    Correct answerB. Package the function as a Lambda container image.

    AWhy not this: The 250 MB uncompressed limit includes the function package and all attached layers.

    BWhy this is right: A 280 MB package fits within the 10 GB uncompressed limit for Lambda container images.

    CWhy not this: AWS SAM automates deployment but does not change Lambda package size limits.

    DWhy not this: Uploading through Amazon S3 does not bypass the 250 MB uncompressed ZIP deployment limit.

    Lambda container images support up to 10 GB uncompressed, so this package fits. ZIP deployments have a 250 MB uncompressed limit that includes attached layers; uploading through Amazon S3 or using AWS SAM does not increase it.

    Open this question
  13. Question 13

    Testing and Deployment

    An ECR repository contains images with both prod- and dev-prefixed tags. A lifecycle policy must protect the 10 newest prod images while expiring dev images older than seven days, including older prod images that also have dev tags. Which rules should the developer combine? (Choose two.)

    Choose 2 answers

    Show the answer

    Correct answersB. Priority 1: Select prod-prefixed tags; expire images beyond the 10 newest.C. Priority 2: Select dev-prefixed tags; expire images pushed over seven days ago.

    AWhy not this: Giving the dev rule higher priority can expire images among the 10 newest prod images.

    BWhy this is right: The higher-priority prod rule protects its 10 newest matches from expiration by a lower-priority rule.

    CWhy this is right: The lower-priority dev rule expires old dev images without overriding protection from the prod rule.

    DWhy not this: A lower-priority prod rule cannot protect images already selected for expiration by a higher-priority dev rule.

    ECR evaluates overlapping lifecycle rules by priority, with lower numbers taking precedence. A higher-priority prod rule protects its 10 newest matching images from the lower-priority dev rule; reversing the priorities can expire protected prod images.

    Open this question
  14. Question 14

    Testing and Deployment

    A container build requires a compiler, but the deployed application requires only the compiled executable and runtime libraries. How should the developer reduce the final image size?

    Show the answer

    Correct answerB. Use a multi-stage Docker build.

    AWhy not this: A smaller build context reduces build input but does not exclude compiler layers from the resulting image.

    BWhy this is right: A separate runtime stage can contain the executable and libraries without the compiler or other build tools.

    CWhy not this: Compression reduces transfer and storage size but does not exclude unnecessary build tools.

    DWhy not this: Lifecycle policies expire stored images; they do not remove build tools from an image.

    A multi-stage build compiles the application in one stage and copies only required artifacts into the final runtime stage. Reducing the build context reduces files sent to the builder but does not itself remove compiler layers from the final image.

    Open this question
  15. Question 15

    Testing and Deployment

    A CodePipeline workflow receives source from GitHub through AWS CodeConnections, and its build requires Git history and submodules. The source action currently produces a ZIP artifact; what should the developer change to provide repository access during the build?

    Show the answer

    Correct answerB. Use full clone output and grant CodeBuild permission to use the connection.

    AWhy not this: ECR push permissions do not authorize CodeBuild to use the source connection.

    BWhy this is right: Full clone supplies repository access, and CodeBuild needs connection permission to perform the clone.

    CWhy not this: Artifact bucket access retrieves the ZIP but does not restore missing Git metadata.

    DWhy not this: A stored repository URL does not change ZIP contents or authorize a repository clone.

    Full clone output lets a downstream CodeBuild action clone the repository with Git metadata; its service role also needs permission to use the connection. ZIP output contains source files but does not provide the Git repository metadata needed for this build.

    Open this question
  16. Question 16

    Testing and Deployment

    What is the primary purpose of a Git repository in an application deployment workflow?

    Show the answer

    Correct answerC. Store and version application source code.

    AWhy not this: Runtime configuration management is distinct from source code version control.

    BWhy not this: Container image layers belong in a container registry such as Amazon ECR.

    CWhy this is right: Git tracks source files and their revision history for collaboration and deployment.

    DWhy not this: Credential storage and rotation belong in a secrets management service.

    A Git repository tracks source code and its change history, providing versioned inputs to deployment workflows. A container registry stores built container images rather than serving as the source code repository.

    Open this question
  17. Question 17

    Testing and Deployment

    Integration tests call a third-party payment API that has no sandbox. The team wants an API Gateway REST API to return a predictable response so the tests never call the provider. What should the developer configure?

    Show the answer

    Correct answerC. A mock integration whose integration response mapping template returns a canned body

    AWhy not this: Stage caching still sends uncached requests, including the first one, to the live provider.

    BWhy not this: Forwarding each request through Lambda still calls the provider for every test.

    CWhy this is right: A mock integration answers from API Gateway itself, with the response body defined in the integration response mapping template.

    DWhy not this: A stage variable only chooses which backend URL is called; pointing it at production calls the live provider.

    An API Gateway mock integration returns a response without calling any backend: its request template sets the status code and its integration response mapping template supplies the body. Caching, Lambda proxies and HTTP proxies all still reach the real provider at least once.

    Open this question
  18. Question 18

    Testing and Deployment

    A Lambda handler receives API Gateway REST API Lambda proxy events and supports repeated query parameters and binary request bodies. A developer is creating direct Lambda test events for these paths; which event constructions accurately represent the gateway's input? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersA. Represent a JSON request body as a JSON-encoded string with isBase64Encoded set to false.B. Represent a binary body as a base64 string with isBase64Encoded set to true.C. Represent repeated query values as arrays in multiValueQueryStringParameters.

    AWhy this is right: A textual JSON request arrives as a string that the handler must parse, without base64 encoding.

    BWhy this is right: The encoded string and flag let the handler recognize and decode a binary request body.

    CWhy this is right: This field preserves multiple values for the same query parameter as an array.

    DWhy not this: REST API proxy events carry body as a string, not an already-parsed JSON object.

    EWhy not this: The version 2.0 request structure represents an HTTP API payload rather than a REST API proxy event.

    REST API proxy events carry repeated query values in multiValueQueryStringParameters and request bodies as strings; binary bodies use base64 with isBase64Encoded set to true. A parsed object in body does not reproduce the gateway's event contract, and the version 2.0 structure belongs to HTTP API payloads.

    Open this question
  19. Question 19

    Testing and Deployment

    An API Gateway REST API mock must return HTTP 200 or 503 based on a request field. Its integration request template already produces the corresponding statusCode value, but both cases return HTTP 200; what should the developer configure?

    Show the answer

    Correct answerB. Integration response selection patterns and mappings to matching method responses

    AWhy not this: Stages represent deployments and do not select response statuses from a request field.

    BWhy this is right: Selection patterns distinguish the generated statuses, and response mappings expose the matching HTTP statuses.

    CWhy not this: Request models validate request structure; they do not select the mock's HTTP response status.

    DWhy not this: Method responses declare possible outputs but do not route the generated status to the appropriate output.

    MOCK integrations use the generated statusCode to select an integration response, which maps to a method response status. Declaring method responses alone does not select or map the mock's response.

    Open this question
  20. Question 20

    Testing and Deployment

    What is the primary benefit of replacing an external payment API with a mock API during application testing?

    Show the answer

    Correct answerB. Testing client behavior with controlled payment responses

    AWhy not this: A mock does not contact the production provider, so it cannot establish the provider's availability.

    BWhy this is right: Controlled responses let tests exercise client behavior without relying on the external provider.

    CWhy not this: A mock's throughput does not represent the real payment provider's processing capacity.

    DWhy not this: Infrastructure template validation checks resource definitions rather than client handling of API responses.

    A mock API provides controlled responses so developers can test client behavior independently of the payment provider. It does not establish the real provider's availability or performance.

    Open this question
  21. Question 21

    Testing and Deployment

    A CloudFormation template must create a Lambda function in every environment, but include its VpcConfig property only when a UseVpc condition is true. Which template approach meets this requirement?

    Show the answer

    Correct answerC. Use Fn::If for VpcConfig, returning AWS::NoValue when false.

    AWhy not this: DependsOn controls resource creation order; it does not conditionally include properties or depend on conditions.

    BWhy not this: A false resource-level condition prevents creation of the entire function rather than omitting only VpcConfig.

    CWhy this is right: Fn::If selects the configuration or AWS::NoValue, which removes the property from the resource.

    DWhy not this: An empty string is not an omitted property and does not satisfy VpcConfig's required object structure.

    Fn::If can return a VPC configuration when the condition is true and AWS::NoValue when false, removing the property. A resource-level Condition would omit the entire function, violating the requirement to create it in every environment.

    Open this question
  22. Question 22

    Testing and Deployment

    An Amazon ECS service must deploy a new container image identified by an immutable tag. What should the developer do to update the service?

    Show the answer

    Correct answerD. Register a task definition revision and update the service to use it.

    AWhy not this: An image tag matching a service name has no special meaning; restarted tasks still use the configured image reference.

    BWhy not this: Container instances provide compute capacity; the task definition specifies which image runs.

    CWhy not this: The task execution role grants permissions such as pulling images; it does not select the container image.

    DWhy this is right: A new task definition revision records the new image reference, and the service update deploys it.

    A task definition specifies the container image. Registering a revision with the new image and updating the service deploys that revision. Restarting tasks does not change the image reference in the task definition.

    Open this question
  23. Question 23

    Testing and Deployment

    An application runs in Amazon EKS under a Kubernetes Deployment. A developer must release a new image while retaining declarative management and the existing Service endpoint. What should the developer update?

    Show the answer

    Correct answerA. The image reference in the Deployment's Pod template

    AWhy this is right: Updating the Pod template image triggers a controller-managed rollout while retaining the Service.

    BWhy not this: Individual Pod edits do not update the Deployment's desired state and are not the declarative release mechanism.

    CWhy not this: Changing the replica count scales the existing application version rather than selecting a new image.

    DWhy not this: A Service selects endpoints and routes traffic; an image annotation does not deploy containers.

    Changing the Deployment's Pod template image triggers a rollout managed by the Deployment controller. Editing individual Pods does not update the controller's desired state, and a Service routes traffic rather than defining container images.

    Open this question
  24. Question 24

    Testing and Deployment

    An ECS rolling-update service has three healthy tasks, a desired count of three, and both deployment percentages set to 100; deployment cannot progress. All three tasks must remain available, and capacity exists for another task. Which change allows progress?

    Show the answer

    Correct answerA. Set maximumPercent to 134.

    AWhy this is right: The maximum rounds down to four, allowing a replacement to start while all three existing tasks remain available.

    BWhy not this: 133% of three rounds down to three, leaving no room to start a replacement task.

    CWhy not this: The minimum rounds up to three, so no task can stop and the unchanged maximum prevents an additional task.

    DWhy not this: The minimum rounds up to two, permitting a task to stop before its replacement is available.

    ECS rounds the maximum task count down: 134% of three permits four tasks, allowing a replacement to start before an old task stops. At 133%, the limit remains three; reducing the minimum either preserves the blockage or permits availability to fall below three.

    Open this question
  25. Question 25

    Testing and Deployment

    Which template declaration enables CloudFormation to process AWS::Serverless resources in an AWS SAM template?

    Show the answer

    Correct answerB. Transform: AWS::Serverless-2016-10-31

    AWhy not this: This identifies the CloudFormation template format version but does not enable the SAM transform.

    BWhy this is right: This invokes the AWS SAM transform to expand AWS::Serverless resource definitions.

    CWhy not this: This metadata organizes parameter presentation in the CloudFormation console rather than expanding SAM resources.

    DWhy not this: This is an IAM policy language version declaration, not a CloudFormation transform declaration.

    The AWS::Serverless transform expands SAM resource definitions into CloudFormation resources. AWSTemplateFormatVersion identifies the CloudFormation template format; it does not enable SAM processing.

    Open this question
  26. Question 26

    Testing and Deployment

    Development and production use separate Amazon RDS databases. A Lambda application must retrieve each environment's database password at runtime and support managed password rotation; where should the passwords be stored?

    Show the answer

    Correct answerB. In separate AWS Secrets Manager secrets

    AWhy not this: SecureString parameters encrypt values but require additional automation to rotate database passwords.

    BWhy this is right: Secrets Manager supports separate environment secrets, runtime retrieval, and managed rotation for supported RDS credentials.

    CWhy not this: Hosted configurations manage application settings rather than database credential rotation.

    DWhy not this: Environment variables can hold encrypted values but do not manage rotation of database credentials.

    Secrets Manager supports runtime secret retrieval and managed rotation for supported Amazon RDS credentials. Parameter Store SecureString encrypts sensitive values but does not natively manage database password rotation.

    Open this question
  27. Question 27

    Testing and Deployment

    A team must validate production configuration against a JSON schema before gradually releasing it, and automatically roll it back if a CloudWatch alarm activates during deployment. Which approach meets these requirements with the least custom code?

    Show the answer

    Correct answerD. Use AWS AppConfig validators, a deployment strategy, and alarm monitoring.

    AWhy not this: Secret rotation replaces credentials; it does not provide the required application configuration deployment workflow.

    BWhy not this: Parameter policies support expiration and change notifications, not schema-validated gradual rollouts with alarm-based rollback.

    CWhy not this: Environment variable updates would require custom orchestration to provide validation, gradual rollout, and alarm-based rollback.

    DWhy this is right: AWS AppConfig combines schema validation, controlled rollout, and CloudWatch alarm-based rollback.

    AWS AppConfig supports JSON Schema validation, gradual deployment strategies, and automatic rollback based on CloudWatch alarms. Parameter Store parameter policies provide controls such as expiration notifications, not this managed validation and rollout workflow.

    Open this question
  28. Question 28

    Testing and Deployment

    A CodePipeline pipeline uses a GitHub source action through AWS CodeConnections. Only pushes to the release branch should start deployments; what should the developer configure?

    Show the answer

    Correct answerB. A source trigger with a release-branch push filter

    AWhy not this: An artifact name identifies pipeline output; it does not control source triggers.

    BWhy this is right: A branch filter on the push trigger restricts which repository events start pipeline executions.

    CWhy not this: A build environment variable supplies a value to the build; it does not filter repository events.

    DWhy not this: An approval action pauses an existing execution rather than preventing unwanted executions from starting.

    A source trigger can filter Git push events by branch, so only release-branch pushes start the pipeline. An approval action controls whether an execution proceeds, not which branch events start it.

    Open this question
  29. Question 29

    Testing and Deployment

    Which Git value should deployment records capture to identify the exact source revision used for a build?

    Show the answer

    Correct answerD. Commit ID

    AWhy not this: A repository URL identifies the repository location, not a particular revision.

    BWhy not this: A remote name is a local alias for a repository connection, not a source revision.

    CWhy not this: A branch name can point to different commits as development continues.

    DWhy this is right: A commit ID identifies the specific revision from which the build was produced.

    A commit ID identifies a specific source revision. A branch name is a movable reference and can point to a different commit after subsequent changes.

    Open this question
  30. Question 30

    Testing and Deployment

    A team uses one CloudFormation template for development and production. Production requires a monitoring resource that development must omit. How should the developer model this difference?

    Show the answer

    Correct answerC. Use a Condition to control creation of the resource.

    AWhy not this: Mappings supply lookup values; they do not independently determine whether CloudFormation creates a resource.

    BWhy not this: Outputs expose stack values; hiding an output does not prevent creation of its resource.

    CWhy this is right: A resource's Condition attribute can reference a condition that evaluates whether the environment is production.

    DWhy not this: DependsOn controls creation order, not environment-specific inclusion.

    A CloudFormation Condition can use an environment parameter to determine whether a resource is created. Mappings provide lookup values but do not independently control resource creation.

    Open this question
  31. Question 31

    Testing and Deployment

    Which CodeDeploy resource identifies the tagged Amazon EC2 instances that should receive an application revision?

    Show the answer

    Correct answerD. Deployment group

    AWhy not this: An application groups CodeDeploy resources but does not itself select the target instances.

    BWhy not this: A source action retrieves source artifacts for a pipeline; it does not select CodeDeploy target instances.

    CWhy not this: A deployment configuration controls deployment behavior rather than identifying tagged target instances.

    DWhy this is right: A deployment group can select target EC2 instances by tags.

    A deployment group identifies deployment targets, such as EC2 instances selected by tags. A deployment configuration controls deployment behavior, including minimum healthy hosts, rather than selecting the target instances.

    Open this question
  32. Question 32

    Testing and Deployment

    A CloudFormation-managed database must survive stack deletion or removal from its template. If a property change replaces it, the old database must also remain intact rather than only as a snapshot. Which resource attributes meet these requirements?

    Show the answer

    Correct answerD. DeletionPolicy: Retain; UpdateReplacePolicy: Retain

    AWhy not this: Replacement preserves the old database, but stack deletion or template removal preserves only a snapshot.

    BWhy not this: Stack deletion and template removal preserve the database, but replacement preserves only a snapshot of the old database.

    CWhy not this: The old database is deleted during replacement despite the DeletionPolicy setting.

    DWhy this is right: DeletionPolicy covers deletion and template removal; UpdateReplacePolicy covers the old resource during replacement.

    DeletionPolicy: Retain preserves the database when the stack is deleted or the resource is removed from the template. UpdateReplacePolicy: Retain preserves the old physical database during replacement; Snapshot preserves a backup instead of the database itself.

    Open this question
  33. Question 33

    Testing and Deployment

    A developer packages a revision for an in-place CodeDeploy deployment to Amazon EC2 instances. Which elements belong in the revision's AppSpec file? (Choose two.)

    Choose 2 answers

    Show the answer

    Correct answersA. Mappings from source files to installation destinationsC. Lifecycle event hooks that run deployment scripts

    AWhy this is right: The files section maps revision content to destination paths on the instances.

    BWhy not this: Source trigger configuration controls pipeline invocation, not revision installation on instances.

    CWhy this is right: The hooks section associates scripts with deployment lifecycle events.

    DWhy not this: CodeBuild buildspec files define build commands; AppSpec files describe deployment behavior.

    An EC2 AppSpec file specifies file installation mappings and lifecycle hooks for deployment scripts. Build commands belong in a CodeBuild buildspec, not the CodeDeploy AppSpec file.

    Open this question
  34. Question 34

    Testing and Deployment

    A production Lambda alias points to published version 12. A team must test identical code with different environment variables through a stable test alias while leaving production unchanged; which configuration should it use?

    Show the answer

    Correct answerB. Configure $LATEST with test variables, publish a version, and point the test alias to it.

    AWhy not this: An alias can point to $LATEST, but it then changes whenever $LATEST is edited, so it is not a stable test target.

    BWhy this is right: A new published version preserves the test configuration without changing production's version.

    CWhy not this: Environment variables belong to function version configuration, not aliases.

    DWhy not this: Published versions are immutable, so version 12's environment variables cannot be changed.

    A published Lambda version captures code and configuration, including environment variables. Publish the test configuration as a new version and target it with the test alias; aliases have no environment variables of their own, and an alias pointing to $LATEST would change whenever $LATEST is edited, so it is not a stable test target.

    Open this question
  35. Question 35

    Testing and Deployment

    An API Gateway REST API has test and production stages pointing to the same deployment. After changing a method's integration, how should a developer expose the change only through the test stage?

    Show the answer

    Correct answerA. Create a deployment and associate it with the test stage.

    AWhy this is right: The test stage can reference a new deployment while production retains the existing snapshot.

    BWhy not this: Stage variables can parameterize configured integrations but do not deploy API configuration changes.

    CWhy not this: A method test can exercise changes but does not expose them through the test stage's endpoint.

    DWhy not this: Execution logging records request processing; it does not update the stage's deployment.

    A REST API deployment is a snapshot of the API configuration, and each stage references a deployment. Deploy the changed API to the test stage while leaving production on its existing deployment; changing a stage variable does not publish integration changes.

    Open this question
  36. Question 36

    Testing and Deployment

    What happens when a developer selects Test with a saved test event in the Lambda console?

    Show the answer

    Correct answerB. Lambda invokes the function with the event as input.

    AWhy not this: Saving or running a test event does not create an event source configuration.

    BWhy this is right: The console passes the saved event to the function during a synchronous invocation.

    CWhy not this: The Test action executes the function; it is not limited to validating the input.

    DWhy not this: Test events supply input but do not automatically mock downstream service calls.

    The Lambda console invokes the function synchronously using the saved event as input. A saved test event is an invocation payload, not an event source configuration or a mock for downstream services.

    Open this question
  37. Question 37

    Testing and Deployment

    A Lambda function processes Amazon SQS messages, and a developer wants to test its handling of multiple messages in one invocation. How should the developer structure the saved test event?

    Show the answer

    Correct answerC. Use a Records array with each message body represented as a string.

    AWhy not this: A body object containing messages does not match the SQS event structure.

    BWhy not this: SQS delivers an event object containing Records, not a top-level array of message bodies.

    CWhy this is right: The Records array represents the batch, and each record contains a string-valued body.

    DWhy not this: SQS places messages in Records rather than properties keyed by message identifier.

    An SQS event contains a Records array, with each record's body represented as a string, even when that string contains JSON. A top-level array of message bodies does not match the event structure Lambda receives from SQS.

    Open this question
  38. Question 38

    Testing and Deployment

    A team must release production feature-flag changes gradually and automatically roll them back when an Amazon CloudWatch alarm triggers. Which approach best meets these requirements?

    Show the answer

    Correct answerD. Use AWS AppConfig deployments with alarm monitoring.

    AWhy not this: Secret rotation updates credentials; it does not provide the required feature-flag deployment controls.

    BWhy not this: Publishing versions captures environment variables but does not itself provide gradual configuration rollout and alarm-driven rollback.

    CWhy not this: Parameter policies provide expiration and notification capabilities, not gradual configuration deployment with alarm-driven rollback.

    DWhy this is right: AWS AppConfig deployment strategies control rollout, and associated CloudWatch alarms can trigger automatic rollback.

    AWS AppConfig supports gradual configuration deployments and automatic rollback based on CloudWatch alarms. Parameter Store parameter policies support expiration and change notifications, not alarm-driven gradual deployment rollback.

    Open this question
  39. Question 39

    Testing and Deployment

    Which part of a default API Gateway REST API invoke URL identifies the deployment environment, such as test or production?

    Show the answer

    Correct answerB. The stage name

    AWhy not this: The resource path identifies the requested API resource rather than the deployment environment.

    BWhy this is right: The stage name selects the named environment associated with an API deployment.

    CWhy not this: The API identifier identifies the REST API, which can have multiple stages.

    DWhy not this: The Region identifies where the API is hosted rather than which environment is invoked.

    The stage name identifies a named environment in a default REST API invoke URL. The resource path identifies an API resource within that stage, not the deployment environment.

    Open this question
  40. Question 40

    Testing and Deployment

    A Regional custom domain uses API mappings: orders to API A's prod stage, and orders/v2 to API B's beta stage. With no routing rules configured, how is a request to /orders/v2/items routed?

    Show the answer

    Correct answerB. To API B's beta stage with resource path /items.

    AWhy not this: The shorter orders mapping loses to the longer matching orders/v2 mapping.

    BWhy this is right: The longest mapping selects API B's beta stage, and removing orders/v2 leaves /items.

    CWhy not this: API Gateway removes the matched mapping path instead of forwarding the complete custom-domain path.

    DWhy not this: The mapping selects the beta stage without inserting beta into the resource path.

    API Gateway selects the longest matching API mapping, orders/v2, and strips that mapping path before invoking API B's beta stage. The stage is selected by the mapping; its name is not added to the resource path.

    Open this question
  41. Question 41

    Testing and Deployment

    A REST API must be callable from a client VPC without a public internet path, and its backend already uses a private integration. Which change provides private client access to API Gateway?

    Show the answer

    Correct answerD. Use a private REST API endpoint and an execute-api interface VPC endpoint.

    AWhy not this: An edge-optimized endpoint remains public, and an API key does not provide private network connectivity.

    BWhy not this: A VPC link provides backend connectivity, not private client connectivity to the API endpoint.

    CWhy not this: A private backend integration does not change the Regional API's public client-facing endpoint.

    DWhy this is right: A private REST API and interface VPC endpoint provide private connectivity from clients in the VPC to API Gateway.

    A private REST API can be invoked through an execute-api interface VPC endpoint. A private integration or VPC link controls connectivity from API Gateway to the backend; it does not make client access to the API private.

    Open this question
  42. Question 42

    Testing and Deployment

    A developer changes an API Gateway REST API and its production stage settings. Which changes require a new API deployment before they take effect for that stage? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersB. Add a resource to the REST API.D. Add a method to an existing resource.F. Change an existing method's integration URI.

    AWhy not this: Access logging is configured on the stage and does not require a new API deployment.

    BWhy this is right: A new resource changes the API definition and must be included in a new deployment.

    CWhy not this: A stage variable is a stage setting that can be updated without redeploying the API.

    DWhy this is right: A new method changes the API definition and must be included in a new deployment.

    EWhy not this: Stage-level throttling settings can be changed without creating a new API deployment.

    FWhy this is right: An integration URI is part of the API definition, so its change requires redeployment.

    Resource, method, and integration changes require redeploying a REST API to update a stage's deployed API definition. Stage variables, access logging, and stage throttling settings can be changed without creating a new API deployment.

    Open this question
  43. Question 43

    Testing and Deployment

    A CodeDeploy deployment shifts traffic between Lambda versions. Its BeforeAllowTraffic validation function returns successfully, but deployment remains pending at that hook; what must the function do to complete validation?

    Show the answer

    Correct answerC. Report success through PutLifecycleEventHookExecutionStatus

    AWhy not this: CodeDeploy manages alias traffic shifting; changing the alias does not report the validation hook's result.

    BWhy not this: A successful invocation response does not notify CodeDeploy that the lifecycle event succeeded.

    CWhy this is right: The API reports the result using the deployment ID and lifecycle event hook execution ID supplied to the function.

    DWhy not this: Publishing a version creates deployable code but does not complete a pending validation event.

    Lambda validation hooks must explicitly report their result to CodeDeploy through PutLifecycleEventHookExecutionStatus. A successful function return alone does not complete the lifecycle event.

    Open this question
  44. Question 44

    Testing and Deployment

    A CodePipeline pipeline deploys successfully to staging. A release manager must review the results before the production deployment begins; what should the developer add?

    Show the answer

    Correct answerA. A manual approval action before production

    AWhy this is right: A manual approval action blocks progression until an authorized reviewer approves the execution.

    BWhy not this: A release branch controls source selection but does not require review of staging results.

    CWhy not this: A post-deployment hook runs too late to gate the start of production deployment.

    DWhy not this: A notification informs reviewers without requiring approval before progression.

    A manual approval action pauses pipeline progression until an authorized reviewer approves it. A notification rule can alert the release manager but does not block the production deployment.

    Open this question
  45. Question 45

    Testing and Deployment

    What carries build output from a CodePipeline build action to a downstream deployment action?

    Show the answer

    Correct answerC. An output artifact

    AWhy not this: An output variable passes a value such as an identifier, not a package of build files.

    BWhy not this: An action execution identifier identifies an action run rather than transporting its files.

    CWhy this is right: An output artifact contains files that a downstream action can consume as an input artifact.

    DWhy not this: A source revision identifier identifies the source version rather than carrying build output.

    An output artifact carries files produced by an action and can become a downstream action's input artifact. Output variables pass values, not packaged build files.

    Open this question
  46. Question 46

    Testing and Deployment

    Within one CodePipeline stage, unit tests and security tests must run concurrently, and deployment must wait for both to succeed. How should the developer configure action runOrder values?

    Show the answer

    Correct answerA. Unit tests: 1; security tests: 1; deployment: 2

    AWhy this is right: The tests share a runOrder, and deployment waits at the next runOrder until both succeed.

    BWhy not this: The deployment runs before either test because it has the lowest runOrder.

    CWhy not this: Different runOrder values make the tests sequential rather than concurrent.

    DWhy not this: All actions can start concurrently, so deployment does not wait for the tests.

    Actions with the same runOrder can run concurrently within a stage. A higher runOrder waits for lower-order actions to succeed; assigning successive values to the tests would run them sequentially.

    Open this question
  47. Question 47

    Testing and Deployment

    A V2 CodePipeline pipeline receives releases faster than it can deploy them. Every execution must run in arrival order without overlapping another execution; which execution mode meets these requirements?

    Show the answer

    Correct answerA. QUEUED

    AWhy this is right: QUEUED preserves execution order and runs executions one at a time.

    BWhy not this: PARALLEL permits concurrent executions and does not enforce arrival-order completion.

    CWhy not this: A manual approval pauses an execution, but in SUPERSEDED mode newer executions can still replace the ones waiting behind it.

    DWhy not this: SUPERSEDED can replace older waiting executions, so it does not preserve every release.

    QUEUED processes pipeline executions sequentially in arrival order. SUPERSEDED, the default mode, can replace an older waiting execution with a newer one; adding a manual approval only pauses an execution, and executions waiting behind it can still be superseded.

    Open this question
  48. Question 48

    Testing and Deployment

    A developer uses Kiro to expand a unit test suite. Coverage results show that several error-handling branches remain untested; which request would BEST address the gap?

    Show the answer

    Correct answerD. Generate tests for uncovered branches using the coverage report

    AWhy not this: Additional successful inputs can exercise the same paths while leaving the error branches uncovered.

    BWhy not this: Another environment does not supply the missing unit tests for error-handling branches.

    CWhy not this: Replacing error assertions with successful responses removes validation of the behavior that needs testing.

    DWhy this is right: The coverage report directs test generation toward the specific branches that lack execution.

    Coverage reports identify unexercised code paths that can guide targeted AI-generated tests. Generating more successful inputs may increase the test count without exercising missing error-handling branches.

    Open this question
  49. Question 49

    Testing and Deployment

    Which AWS Amplify Hosting feature gives a Git feature branch its own deployment URL for testing?

    Show the answer

    Correct answerA. A branch deployment

    AWhy this is right: A branch deployment builds and hosts a connected Git branch at its own URL.

    BWhy not this: A build cache reuses build artifacts to reduce build time.

    CWhy not this: A rewrite rule controls request routing within a hosted application.

    DWhy not this: A custom domain changes how users address a deployment; it does not create a separate branch deployment.

    Amplify Hosting supports branch deployments with branch-specific URLs, allowing feature changes to be tested separately. A custom domain provides a friendly address but does not itself create a separate deployment.

    Open this question
  50. Question 50

    Testing and Deployment

    A developer wants Kiro to update and run the matching unit tests automatically after every edit to a source file, without prompting Kiro each time. Which Kiro feature should the developer configure?

    Show the answer

    Correct answerB. An agent hook triggered by the file-save event

    AWhy not this: Steering files give Kiro lasting project guidance, but they do not start any action when a file changes.

    BWhy this is right: An agent hook runs a predefined prompt or command automatically when its trigger event, such as a file save, occurs.

    CWhy not this: A spec structures planned work into requirements, design, and tasks; it is not triggered by file edits.

    DWhy not this: An MCP server extends the tools Kiro can call; it does not schedule or trigger work by itself.

    Kiro agent hooks run an agent prompt or shell command automatically when an event occurs, such as a file being saved, so they can update and run tests on every change without a manual prompt. Steering files and specs guide what Kiro writes, and an MCP server adds tools, but none of them starts work on its own when a file changes.

    Open this question