Curated

SDLC Automation (1.1–1.4)

0 votes

Questions65

  1. Question 1

    SDLC Automation

    A CodePipeline pipeline in a tools account deploys a CloudFormation stack to a production account through a cross-account role. The artifact bucket uses the AWS managed aws/s3 key, and the deploy action fails because the production role cannot read the input artifact. Which change fixes this?

    Show the answer

    Correct answerB. Use a customer managed KMS key for the artifact store whose key policy lets the production role decrypt, and allow that role in the bucket policy.

    AWhy not this: The bucket policy alone is not enough: the aws/s3 key's policy cannot grant the production role permission to decrypt.

    BWhy this is right: A customer managed key's policy can let the production role decrypt artifacts, and the bucket policy lets it read them.

    CWhy not this: The deploy action reads artifacts from the pipeline's artifact store, so a replica in another bucket does not supply them.

    DWhy not this: The pipeline's service role assumes the production role; the trust must be on the production role, and it does not fix decryption.

    Cross-account pipeline actions need a customer managed KMS key for the artifact store, because an AWS managed key's policy cannot be changed to let another account decrypt. The key policy and the bucket policy must both allow the production role.

    Open this question
  2. Question 2

    SDLC Automation

    A team requires daily integration into its main branch and must keep that branch releasable while developing features that take several weeks. Which approach BEST meets both requirements?

    Show the answer

    Correct answerD. Merge small changes frequently and hide incomplete features behind disabled feature flags.

    AWhy not this: Integrating only during stabilization creates long-lived branches and delays integration feedback.

    BWhy not this: Suspending production releases means the main branch is not kept ready for release.

    CWhy not this: Holding features on release branches postpones their integration into the main branch.

    DWhy this is right: Small, frequent merges meet the integration requirement; disabled flags separate code integration from feature availability.

    Frequent integration with disabled feature flags keeps incomplete behavior unavailable while the main branch remains releasable. Long-lived feature or release branches defer integration and therefore fail the daily integration requirement.

    Open this question
  3. Question 3

    SDLC Automation

    A central AWS CodePipeline pipeline must deploy through a least-privilege action role in a production account, using artifacts stored in the central account's S3 bucket and encrypted with a customer managed KMS key. Which configuration supports cross-account deployment and artifact access?

    Show the answer

    Correct answerD. Trust the pipeline role in the production action role; authorize role assumption, S3 artifact reads, and KMS decryption in the applicable IAM, bucket, and key policies.

    AWhy not this: Cross-account S3 access also requires permission from the bucket owner, normally through the bucket policy.

    BWhy not this: The cross-account action role must trust the pipeline's service role, not merely the CodePipeline service principal.

    CWhy not this: An S3 bucket policy grants S3 access, not permission to decrypt with a KMS key.

    DWhy this is right: Role assumption needs permission and trust; cross-account artifact reads and decryption need corresponding identity and resource permissions.

    The pipeline role needs permission to assume the production role, whose trust policy must allow it. Cross-account artifact access also requires appropriate S3 and KMS permissions on both sides; an S3 bucket policy cannot grant KMS decryption.

    Open this question
  4. Question 4

    SDLC Automation

    A team automates builds, testing, and deployment to staging for every accepted change. Production releases must remain a business decision requiring manual approval; which SDLC practice should the team implement?

    Show the answer

    Correct answerC. Continuous delivery with a production approval gate

    AWhy not this: Continuous integration validates merged changes but does not by itself provide an automated, release-ready delivery process.

    BWhy not this: Continuous deployment automatically releases validated changes, conflicting with the required manual business decision.

    CWhy this is right: Continuous delivery automates release preparation while allowing a manual decision before production deployment.

    DWhy not this: Scheduled integration and manual packaging delay feedback and do not maintain an automatically prepared release.

    Continuous delivery keeps validated changes ready for release while allowing a manual production approval. Continuous deployment instead automatically releases changes that pass the pipeline's checks.

    Open this question
  5. Question 5

    SDLC Automation

    A release gate must compare p99 latency at a fixed total request rate against a baseline using distributed load generators. Previous runs saturated the generators, and averaging their p99 values produced inconsistent results; which approach BEST supports a valid comparison?

    Show the answer

    Correct answerB. Replay a fixed aggregate request rate, merge latency histograms, and verify generator headroom and achieved throughput.

    AWhy not this: Adding generators at a fixed per-generator rate increases the total load and invalidates the fixed-load comparison.

    BWhy this is right: The aggregate rate remains controlled, merged compatible histograms support global p99, and throughput checks expose generator limits.

    CWhy not this: Fixed concurrency can produce different request rates as latency changes, and averaging percentiles does not yield a global percentile.

    DWhy not this: Generator headroom helps, but averaging per-generator percentiles still produces an invalid aggregate p99.

    A valid comparison requires the same aggregate offered load, sufficient generator capacity, and a global latency distribution. Averaging generator p99 values does not produce the overall p99, even when generators have adequate capacity.

    Open this question
  6. Question 6

    SDLC Automation

    A GitHub-backed CodeBuild project must test pull requests when they are created or updated, but only when they target main. How should the webhook filters be configured?

    Show the answer

    Correct answerD. One filter group combining the pull request events with a BASE_REF filter matching main

    AWhy not this: Separate groups use OR logic, so the destination restriction would not constrain the pull request event group.

    BWhy not this: A push filter detects branch pushes rather than pull request creation and updates targeting that branch.

    CWhy not this: HEAD_REF filters the pull request's source branch rather than its destination branch.

    DWhy this is right: The event filter selects pull request creation or updates, and BASE_REF restricts their destination to main.

    Filters within a CodeBuild webhook filter group are combined with AND, and BASE_REF identifies the pull request's destination branch. HEAD_REF identifies its source branch, so filtering it for main would test the wrong condition.

    Open this question
  7. Question 7

    SDLC Automation

    A team must find the request rate at which an API stops meeting its latency target and verify that it recovers after overload. Which automated test should the pipeline run?

    Show the answer

    Correct answerA. A stress test that ramps beyond capacity and then reduces load

    AWhy this is right: Increasing load beyond capacity identifies the threshold, and reducing it allows recovery to be assessed.

    BWhy not this: Normal steady load can validate expected performance but does not reveal the overload threshold.

    CWhy not this: Functional regression tests check behavior rather than capacity limits and recovery under load.

    DWhy not this: Unit tests validate isolated code behavior, not system capacity or recovery from excessive traffic.

    A stress test increases demand beyond expected capacity to identify the breaking point and assess recovery as load decreases. A constant-load test at normal traffic validates expected operation but does not establish overload behavior.

    Open this question
  8. Question 8

    SDLC Automation

    Which CodeBuild feature automatically starts tests when a merge produces a push event in a connected GitHub repository?

    Show the answer

    Correct answerD. A source webhook

    AWhy not this: A test report group organizes test results after tests run; it does not respond to repository events.

    BWhy not this: A coverage report records code coverage measurements rather than triggering tests.

    CWhy not this: A build badge displays build status rather than initiating builds.

    DWhy this is right: A source webhook receives repository events and can automatically trigger a build that runs tests.

    A source webhook can start a CodeBuild build in response to a GitHub push event, including a push resulting from a merge. A test report group stores test results; it does not trigger test execution.

    Open this question
  9. Question 9

    SDLC Automation

    A V2 CodePipeline pipeline uses a GitHub source through AWS CodeConnections. It must start only for pushes that change services/payments/** on release/** branches, excluding release/legacy/** branches. Which configuration meets these requirements?

    Show the answer

    Correct answerB. Configure one push filter with branch inclusion release/**, branch exclusion release/legacy/**, and file-path inclusion services/payments/**.

    AWhy not this: BranchName is not a wildcard branch filter; the custom trigger would lack the required branch restrictions.

    BWhy this is right: A single push filter combines branch and file-path conditions with AND, while the exclusion removes legacy branches.

    CWhy not this: A pull-request CLOSED event is not the required push event and can include closure without a merge.

    DWhy not this: Separate push filters use OR logic, allowing unrelated file changes or pushes on unintended branches to start executions.

    Within one push filter, branch and file-path conditions must both match, and branch exclusions take precedence over inclusions, so release/legacy/** branches are removed even though release/** matches them. Separate push filters are alternatives, so either matching filter could start the pipeline.

    Open this question
  10. Question 10

    SDLC Automation

    A CodeBuild role in account A must pull images directly from a private Amazon ECR repository in account B without assuming another role. Neither account has applicable explicit denies, and no permissions are configured yet. Which permissions should an administrator grant? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersC. Allow the CodeBuild role the ECR image-pull actions on the target repository in its identity policy.E. Allow the CodeBuild role ecr:GetAuthorizationToken on all resources in its identity policy.F. Allow the CodeBuild role the ECR image-pull actions in the target repository policy.

    AWhy not this: ReplicateImage authorizes ECR replication rather than a build role's direct image pulls.

    BWhy not this: PutImage supports pushing image manifests; it does not authorize pulling images.

    CWhy this is right: The caller's account must authorize BatchGetImage, GetDownloadUrlForLayer, and BatchCheckLayerAvailability on the repository.

    DWhy not this: ECR issues temporary authorization tokens; storing a password does not supply the missing cross-account permissions.

    EWhy this is right: ECR authentication requires ecr:GetAuthorizationToken through an identity policy, with Resource set to an asterisk.

    FWhy this is right: The repository's account must grant the external role the required image-pull actions through its repository policy.

    Cross-account pulls require an authorization token and image-pull permissions in both the role's identity policy and the destination repository policy. Registry replication permissions authorize replication, not direct image pulls.

    Open this question
  11. Question 11

    SDLC Automation

    A team tags container images in a private Amazon ECR repository with release numbers. The repository must reject pushes that would replace an existing release tag. What should the team configure?

    Show the answer

    Correct answerD. ECR image tag immutability

    AWhy not this: Lifecycle policies expire images according to retention rules; they do not prevent tag overwrites.

    BWhy not this: Enhanced scanning identifies image vulnerabilities; it does not control tag replacement.

    CWhy not this: Docker layer caching accelerates builds; it does not enforce repository tag rules.

    DWhy this is right: An immutable repository rejects attempts to overwrite existing tags unless an applicable exclusion permits it.

    Image tag immutability prevents a subsequent push from overwriting an existing tag. A lifecycle policy controls image expiration, not whether a tag can be replaced.

    Open this question
  12. Question 12

    SDLC Automation

    Several teams use separate AWS CodeArtifact repositories for internal npm packages. They need access to public npm packages through a shared CodeArtifact repository rather than separate public connections. Which configuration meets this requirement?

    Show the answer

    Correct answerC. Connect the shared repository to npm public and make it each team's upstream.

    AWhy not this: This reverses dependency resolution: the shared repository could search team repositories, not the other way around.

    BWhy not this: Separate external connections do not meet the requirement to use a shared public-package connection.

    CWhy this is right: Team repositories can resolve public packages through the shared upstream repository's npm public connection.

    DWhy not this: A CodeBuild cache is not a managed npm registry endpoint or a replacement for CodeArtifact upstream relationships.

    An external connection gives the shared repository access to npm public, and upstream relationships let team repositories resolve packages through it. Reversing the upstream relationship does not give team repositories access through the shared repository.

    Open this question
  13. Question 13

    SDLC Automation

    A pipeline already scans source code and dependencies, but the team also needs to detect exploitable behavior caused by the application's runtime configuration. Where should authenticated dynamic application security testing run to block unsafe releases without probing production?

    Show the answer

    Correct answerA. Against the deployed application in staging before promotion

    AWhy this is right: A staging deployment provides a running target and allows findings to block production promotion.

    BWhy not this: An image scan can inspect packages and files but cannot test runtime application responses.

    CWhy not this: Source-file analysis is static testing and cannot exercise the running application's configuration.

    DWhy not this: Production testing violates the requirement to avoid probing production and occurs too late to block release.

    Dynamic application security testing requires a running application; staging allows it to evaluate runtime behavior before production promotion. Scanning an unstarted image can find package issues but cannot exercise application behavior.

    Open this question
  14. Question 14

    SDLC Automation

    A checkout service passes interface-contract and service-interaction tests, but release approval requires evidence that tiered discounts and tax rounding satisfy product-owner examples. The service has no user interface, and internal interfaces may change; which test suite BEST meets the approval requirement?

    Show the answer

    Correct answerD. Acceptance tests that verify business outcomes through the API

    AWhy not this: Schema compatibility does not establish that calculated totals satisfy the product owner's examples.

    BWhy not this: Individual helper checks do not establish that the service fulfills the complete business examples.

    CWhy not this: Correct component interactions do not by themselves demonstrate the required business outcomes.

    DWhy this is right: API-level acceptance tests validate stakeholder-defined outcomes without depending on internal interfaces or a UI.

    Acceptance tests verify observable behavior against stakeholder-defined business criteria and can run through an API. Contract tests verify interface agreements, not whether discount and tax results meet the business requirements.

    Open this question
  15. Question 15

    SDLC Automation

    An AWS Lambda function passes tests that replace Amazon DynamoDB with a mock, but its deployed execution role cannot write to the table. Which additional test would MOST directly detect this defect before production?

    Show the answer

    Correct answerA. An integration test that writes to a test table using the deployed function

    AWhy this is right: Calling DynamoDB through the deployed function tests the real service interaction and its effective permissions.

    BWhy not this: Dependency scanning identifies vulnerable packages, not whether the execution role can write to DynamoDB.

    CWhy not this: A mocked backend bypasses the real function-to-table interaction where the permission failure occurs.

    DWhy not this: Validating request construction does not exercise the deployed execution role's permissions.

    An integration test using the deployed function exercises the real DynamoDB interaction and execution-role permissions. A unit test of the generated request can verify request construction but cannot establish that AWS authorizes it.

    Open this question
  16. Question 16

    SDLC Automation

    A service must meet a latency target at expected peak traffic before each release, without affecting production users. Where should the pipeline run the load test?

    Show the answer

    Correct answerB. In a production-like environment before release approval

    AWhy not this: Individual handler measurements do not capture the deployed system's end-to-end performance under load.

    BWhy this is right: Representative infrastructure and dependencies allow meaningful load testing before production exposure.

    CWhy not this: Applying peak test traffic in production risks affecting users and does not validate performance before release.

    DWhy not this: Mocks omit real dependency behavior and cannot establish deployed-service latency under peak traffic.

    A production-like preproduction environment allows representative load testing before release without affecting users. Testing isolated handlers can measure local performance but omits infrastructure and dependency bottlenecks.

    Open this question
  17. Question 17

    SDLC Automation

    An AWS CodePipeline pipeline provisions a test environment before running any tests, and developers wait 20 minutes to discover simple calculation defects. Where should the team place fast, isolated unit tests to provide earlier feedback?

    Show the answer

    Correct answerD. In an AWS CodeBuild action before test-environment provisioning

    AWhy not this: Waiting for staging delays feedback on defects that can be detected without deployment.

    BWhy not this: Post-production testing detects these simple defects only after users could be exposed.

    CWhy not this: Isolated unit tests do not require the provisioned environment, so this retains the unnecessary delay.

    DWhy this is right: Running isolated tests before provisioning exposes calculation defects without waiting for infrastructure.

    Fast, isolated unit tests should run early so simple defects stop the pipeline before expensive provisioning. Waiting for a test environment adds delay without providing a dependency that isolated unit tests need.

    Open this question
  18. Question 18

    SDLC Automation

    Which section of an AWS CodeBuild buildspec identifies the generated files to include in the build output?

    Show the answer

    Correct answerB. artifacts

    AWhy not this: The cache section identifies files to reuse across builds rather than deliver as build output.

    BWhy this is right: The artifacts section identifies generated files to collect as build output.

    CWhy not this: The env section configures environment variables rather than output file selection.

    DWhy not this: The phases section defines build commands rather than the files collected as output.

    The artifacts section specifies the files CodeBuild collects as build output. The phases section defines commands that run during the build, including commands that generate those files.

    Open this question
  19. Question 19

    SDLC Automation

    A company stores approved npm packages in a central CodeArtifact repository that has an external connection to npmjs.com. Developers must retrieve both approved packages and public dependencies through a team repository endpoint. How should the team repository be configured?

    Show the answer

    Correct answerD. Add the central repository as an upstream repository.

    AWhy not this: ECR stores container images and OCI artifacts; it does not proxy npm dependencies for CodeArtifact.

    BWhy not this: npmjs.com is accessed through an external connection, not configured as a CodeArtifact upstream repository.

    CWhy not this: S3 stores objects but cannot serve as a CodeArtifact package origin or upstream repository.

    DWhy this is right: An upstream relationship provides access to central packages and public dependencies through the team endpoint.

    A CodeArtifact upstream repository lets a downstream repository resolve packages from the central repository and its external connection. An upstream repository is another CodeArtifact repository, not the public npm registry itself.

    Open this question
  20. Question 20

    SDLC Automation

    A company has years of release images in a private Amazon ECR repository and is adding a second AWS Region for disaster recovery. All existing images and future pushes must be available there without changing the build pipeline; which approach meets these requirements?

    Show the answer

    Correct answerD. Enable cross-Region replication and separately copy the repository's existing images.

    AWhy not this: ECR replication does not automatically replicate images that existed before the replication configuration.

    BWhy not this: Pull-through caching is demand-driven and does not replicate every future push to the recovery Region.

    CWhy not this: ECR lifecycle policies expire or archive images; they do not copy future releases to another Region.

    DWhy this is right: Replication covers future pushes, while a separate image copy supplies the existing release history.

    ECR replication handles images pushed after replication is configured; existing images require a separate copy. Enabling replication alone does not backfill images already present in the source repository.

    Open this question
  21. Question 21

    SDLC Automation

    A company will publish a new internal package to AWS CodeArtifact, where a public repository is configured as an upstream source. Which package origin configuration permits internal publishing while preventing ingestion of public versions with the same package name?

    Show the answer

    Correct answerB. Allow direct publishing and block upstream ingestion.

    AWhy not this: This permits internal releases but also permits ingestion of public versions with the same package name.

    BWhy this is right: Internal publishers can release versions, while versions of that package cannot enter from an upstream repository.

    CWhy not this: This excludes public versions but also prevents the required internal publishing.

    DWhy not this: This prevents internal publishing while permitting the public versions the company needs to exclude.

    Package origin controls distinguish direct publishing from upstream ingestion. Allowing publishing while blocking upstream ingestion preserves internal releases and prevents public versions from entering through the upstream; blocking publishing instead would prevent internal releases.

    Open this question
  22. Question 22

    SDLC Automation

    An AWS CodeBuild project must compile an application and export all generated files from the dist directory, without the dist directory itself appearing in the artifact paths. Which buildspec settings meet these requirements? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersA. Set artifacts.base-directory to dist.B. Run compilation commands in phases.build.commands.D. Set artifacts.files to the recursive pattern **/*.

    AWhy this is right: The base directory makes artifact paths relative to dist, excluding the dist directory itself.

    BWhy this is right: The build phase can run the compilation commands that generate the application files.

    CWhy not this: Cache paths identify reusable build data, not the files to export as build artifacts.

    DWhy this is right: The recursive file pattern selects all generated files beneath the artifact base directory.

    EWhy not this: Reports collect supported test or coverage results, not general deployment artifacts.

    Build commands generate the application files, artifacts.base-directory selects dist as the collection root, and artifacts.files selects its contents recursively. Cache paths preserve reusable build data; they do not define exported build artifacts.

    Open this question
  23. Question 23

    SDLC Automation

    A deployment pipeline promotes container images to production by tag, such as v1.4.2, from a private Amazon ECR repository. An incident occurred after someone pushed different image content under an existing release tag. Which repository setting prevents this?

    Show the answer

    Correct answerD. Tag immutability enabled on the repository

    AWhy not this: Lifecycle policies clean up old images; they do not stop a new push from taking over an existing tag.

    BWhy not this: Scanning reports vulnerabilities in pushed images; it does not block a push that reuses a tag.

    CWhy not this: Overwriting a tag happens through a push, not a delete, so denying BatchDeleteImage does not prevent it.

    DWhy this is right: Immutable tags make ECR reject any push that would point an existing tag at different image content.

    With tag immutability, ECR rejects a push that would move an existing tag to a different image, so a release tag always refers to the same image. Lifecycle policies, scanning, and delete permissions do not stop a push from reusing a tag.

    Open this question
  24. Question 24

    SDLC Automation

    Which Amazon ECS deployment approach incrementally replaces running tasks with tasks using a new application version?

    Show the answer

    Correct answerC. Rolling update deployment

    AWhy not this: Blue/green deployment uses separate existing and replacement environments rather than incrementally replacing tasks within one service deployment.

    BWhy not this: In-place instance deployment updates software on existing instances rather than replacing ECS tasks.

    CWhy this is right: A rolling update progressively stops old tasks and starts replacement tasks using the new version.

    DWhy not this: AMI replacement changes the underlying EC2 instances, not directly the application version of ECS service tasks.

    A rolling update incrementally replaces existing ECS service tasks with new tasks. Blue/green deployment creates a separate replacement environment and shifts traffic to it.

    Open this question
  25. Question 25

    SDLC Automation

    A deployment pipeline publishes versioned JavaScript bundles that browsers retrieve through Amazon CloudFront. Which storage pattern provides a durable origin without running file servers?

    Show the answer

    Correct answerB. Store the bundles in an Amazon S3 bucket

    AWhy not this: An EBS volume provides block storage for EC2 and requires a serving layer to deliver browser requests.

    BWhy this is right: S3 durably stores static objects and can serve as a CloudFront origin without customer-managed file servers.

    CWhy not this: EFS provides shared file storage but requires a serving layer to act as a CloudFront origin.

    DWhy not this: Instance store requires a serving instance and does not preserve bundles when that instance is terminated.

    Amazon S3 provides durable object storage and integrates directly with CloudFront as an origin. Amazon EFS provides shared file storage, but it is not a direct CloudFront origin and would require a serving layer.

    Open this question
  26. Question 26

    SDLC Automation

    During blue/green deployments, Linux EC2 instances in different Availability Zones must concurrently read and update the same uploaded files using existing POSIX file operations. Which storage configuration meets these requirements without changing application file access?

    Show the answer

    Correct answerC. Use an EFS Regional file system with mount targets in each participating Availability Zone

    AWhy not this: EBS Multi-Attach attachments must be in the same Availability Zone, and a shared-disk-aware file system is still required.

    BWhy not this: Mountpoint exposes S3 objects as files but does not provide the full POSIX semantics needed for existing file updates.

    CWhy this is right: EFS Regional supports concurrent shared file access across Availability Zones with POSIX file-system semantics.

    DWhy not this: Volumes restored from a snapshot are independent copies; subsequent writes are not shared between environments.

    EFS Regional provides a shared POSIX file system accessible concurrently across Availability Zones. EBS Multi-Attach is limited to instances in the same Availability Zone and does not itself provide a shared file system.

    Open this question
  27. Question 27

    SDLC Automation

    A Lambda release must receive 10% of production traffic for 10 minutes before receiving the remainder, and automatically revert if an error alarm triggers. Which deployment configuration meets these requirements?

    Show the answer

    Correct answerD. CodeDeploy canary traffic shifting with a CloudWatch alarm and automatic rollback

    AWhy not this: Linear deployment shifts equal increments at regular intervals rather than shifting 10% and then the remaining 90%.

    BWhy not this: All-at-once deployment immediately sends all traffic to the new version, eliminating the required observation period.

    CWhy not this: A weighted alias distributes traffic, but an alarm alone does not advance the deployment or restore the previous routing.

    DWhy this is right: Canary deployment provides the required two-stage shift, and CodeDeploy can automatically roll back when the alarm triggers.

    CodeDeploy canary deployment shifts an initial percentage, waits, and then shifts the remainder; alarms can trigger automatic rollback. Linear deployment shifts equal increments repeatedly instead of making the required two-stage shift.

    Open this question
  28. Question 28

    SDLC Automation

    A company will use CodeDeploy to deploy to an on-premises Linux server that cannot use an EC2 instance profile. The company selects the supported IAM-user authentication method. What configuration is required on the server?

    Show the answer

    Correct answerB. Register it with CodeDeploy and configure the agent with the IAM user's credentials and Region.

    AWhy not this: Systems Manager activation credentials register a managed node; they are not CodeDeploy agent credentials.

    BWhy this is right: Registration and matching IAM-user agent configuration establish the server's CodeDeploy identity and regional connection.

    CWhy not this: ECS external-instance registration supports ECS Anywhere, not CodeDeploy on-premises agent authentication.

    DWhy not this: An on-premises server cannot use EC2 registration, and the CodeDeploy service role is not the agent's identity.

    An on-premises CodeDeploy target must be registered and its agent configured for the selected authentication method, including IAM-user credentials and Region. Systems Manager hybrid registration is separate and does not establish CodeDeploy on-premises identity.

    Open this question
  29. Question 29

    SDLC Automation

    A build role can read packages from CodeArtifact and has codeartifact:GetAuthorizationToken permission on its domain, but token requests fail with an AccessDenied error for sts:GetServiceBearerToken. Which change grants the missing permission with the narrowest service scope?

    Show the answer

    Correct answerD. Allow sts:GetServiceBearerToken in the role policy, conditioned on sts:AWSServiceName being codeartifact.amazonaws.com.

    AWhy not this: GetAuthorizationToken is already allowed and is a domain-level permission, not a repository-level permission.

    BWhy not this: AssumeRole obtains role credentials, not the service bearer token required by CodeArtifact.

    CWhy not this: A CodeArtifact domain resource policy cannot grant the required sts:GetServiceBearerToken permission.

    DWhy this is right: The role policy grants the missing STS action while restricting the service for which a bearer token can be requested.

    CodeArtifact token retrieval requires sts:GetServiceBearerToken in an identity-based policy; the service-name condition limits its use to CodeArtifact. Adding that permission to a CodeArtifact domain policy has no effect.

    Open this question
  30. Question 30

    SDLC Automation

    A build role pulls Docker Hub images through an Amazon ECR pull through cache rule that has valid upstream credentials. Its identity policy allows ecr:GetAuthorizationToken and the image-pull actions on the docker-hub/* repositories. Tags that are already cached pull successfully, but pulling a tag that has never been cached fails with access denied, even though its repository already exists. Which permission should be added?

    Show the answer

    Correct answerC. ecr:BatchImportUpstreamImage on the docker-hub/* repositories

    AWhy not this: This permission creates rules; the rule already exists and pulling through it does not need it.

    BWhy not this: Push permissions are not needed: ECR imports the upstream image itself once the caller may trigger the import.

    CWhy this is right: Pulling an uncached tag makes ECR import it from upstream, and the caller must be allowed to trigger that import.

    DWhy not this: ECR reads the upstream credentials secret itself; the caller doesn't need access to it to pull.

    When a requested image isn't cached yet, ECR imports it from the upstream registry, which requires ecr:BatchImportUpstreamImage for the caller; ecr:CreateRepository is also needed only when the repository doesn't exist. Push permissions and rule-management permissions are not part of pulling.

    Open this question
  31. Question 31

    SDLC Automation

    CodeDeploy agents run on EC2 instances in a private subnet without internet access; S3 revision downloads work, and a codedeploy interface VPC endpoint handles deployment API requests. The agents cannot poll for deployment commands. Which change provides the missing private connectivity?

    Show the answer

    Correct answerC. Add a codedeploy-commands-secure interface endpoint with private DNS enabled.

    AWhy not this: The agent initiates outbound communication; CodeDeploy does not deliver commands through inbound instance HTTPS connections.

    BWhy not this: STS provides temporary credentials, not the CodeDeploy agent command service.

    CWhy this is right: The agent command endpoint supplies private connectivity for polling; its security group must permit HTTPS from the instances.

    DWhy not this: The CodeArtifact repository endpoint serves package traffic, not CodeDeploy agent command polling.

    CodeDeploy agents use the codedeploy-commands-secure endpoint to receive commands through AWS PrivateLink. The codedeploy endpoint serves deployment API operations and does not replace the agent command endpoint.

    Open this question
  32. Question 32

    SDLC Automation

    An Auto Scaling group launches Amazon Linux instances from a custom AMI for CodeDeploy EC2 deployments. The instances have the required IAM permissions and network access, but the AMI contains no CodeDeploy agent. What should the engineer add to instance bootstrapping?

    Show the answer

    Correct answerB. Install and start the CodeDeploy agent, and enable it to start at boot.

    AWhy not this: The CloudWatch agent collects telemetry; it does not execute CodeDeploy lifecycle events.

    BWhy this is right: The CodeDeploy agent receives deployment work and executes lifecycle events on EC2 targets.

    CWhy not this: The ECS agent manages container tasks on ECS container instances, not CodeDeploy EC2 lifecycle events.

    DWhy not this: SSM Agent supports Systems Manager operations but does not replace the CodeDeploy agent.

    CodeDeploy EC2 deployments require a running CodeDeploy agent on each target instance. SSM Agent can help install or manage that agent, but it does not replace it.

    Open this question
  33. Question 33

    SDLC Automation

    An AWS CodeBuild project generates JUnit XML test results. Developers need CodeBuild to display individual test failures and test-duration metrics rather than only retain downloadable files. What should they configure?

    Show the answer

    Correct answerC. A buildspec reports entry that includes the JUnit XML files

    AWhy not this: Artifacts preserve the XML files but do not provide structured CodeBuild test results.

    BWhy not this: Build logs capture output but do not parse JUnit XML into test reports.

    CWhy this is right: The reports section identifies test-result files for CodeBuild to process into structured reports.

    DWhy not this: Build caching reuses files across builds rather than publishing test results.

    A buildspec reports entry lets CodeBuild process supported test-result files into test reports with failure details and duration metrics. An artifacts entry preserves files but does not turn them into structured CodeBuild test reports.

    Open this question
  34. Question 34

    SDLC Automation

    A team wants one CodeBuild batch build to compile a shared library, then run Linux and Windows validation builds concurrently only if compilation succeeds. Which batch configuration should the team use?

    Show the answer

    Correct answerA. A build graph with both validation builds depending on the compilation build

    AWhy this is right: A build graph expresses dependencies and allows the validation builds to run concurrently after compilation succeeds.

    BWhy not this: A build list runs independent builds concurrently without the required compilation dependency.

    CWhy not this: Build fanout distributes work across parallel builds rather than defining this dependency graph.

    DWhy not this: A build matrix generates combinations of settings rather than expressing dependencies between build tasks.

    A build graph supports explicit dependencies, so both validation builds can wait for successful compilation and then run concurrently. A build list runs independent builds in parallel and does not express the required dependency.

    Open this question
  35. Question 35

    SDLC Automation

    A CodeBuild project in account A must retrieve a rotating Secrets Manager secret from account B at build time without assuming another role or copying the secret. The secret uses account B's AWS managed aws/secretsmanager key, and no cross-account permissions exist; which configuration meets these requirements?

    Show the answer

    Correct answerD. Use a customer managed key; authorize the CodeBuild role through the secret resource policy, identity policy, and key policy.

    AWhy not this: The AWS managed aws/secretsmanager key cannot be used for cross-account secret access.

    BWhy not this: Cross-account retrieval also requires a secret resource policy that authorizes the CodeBuild role.

    CWhy not this: CodeBuild retrieves the secret using its service role; permissions for the pipeline role do not authorize that retrieval.

    DWhy this is right: This authorizes the actual caller to retrieve the secret and decrypt it across accounts using a customer managed key.

    Direct cross-account retrieval requires secret access in the CodeBuild role's identity policy and the secret resource policy, plus decrypt authorization for a customer managed KMS key. The AWS managed aws/secretsmanager key cannot support cross-account secret access.

    Open this question
  36. Question 36

    SDLC Automation

    A staging pipeline tracks the staging branch, while approved changes reside on main. Which action integrates those changes into staging through version control?

    Show the answer

    Correct answerD. Merge the approved commits from main into staging

    AWhy not this: Copying build output does not update the source branch tracked by the staging pipeline.

    BWhy not this: A runtime version controls the build environment, not which source changes the staging branch contains.

    CWhy not this: Rollback settings control deployment recovery, not source integration.

    DWhy this is right: Merging brings the approved source changes into the branch tracked by the staging pipeline.

    Merging the approved commits into staging updates the branch that the staging pipeline tracks. Copying an artifact moves build output but does not integrate source changes into the environment's branch.

    Open this question
  37. Question 37

    SDLC Automation

    A CodeBuild health-check wrapper pipes probe output through a logging utility and then performs cleanup; unhealthy probes currently produce successful builds. Which changes together preserve failure detection while retaining logging and cleanup? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersA. Enable shell pipefail behavior for the probe-and-logging pipeline.B. Save the pipeline status before cleanup and return it afterward.E. Make the probe return a nonzero status for an unhealthy application.

    AWhy this is right: Pipefail prevents a successful logging utility from masking a failed probe in the pipeline.

    BWhy this is right: Saving and returning the pipeline status prevents successful cleanup from replacing the health-check result.

    CWhy not this: Successful cleanup could mask an unhealthy application's failed probe.

    DWhy not this: A report exposes results but does not restore an exit status masked by logging or cleanup.

    EWhy this is right: A nonzero probe status gives the shell a failure signal when application health checks fail.

    The probe must signal failure, pipefail must preserve that failure through the logging pipeline, and the wrapper must retain it across cleanup. Publishing a report provides visibility but does not repair a masked process exit status.

    Open this question
  38. Question 38

    SDLC Automation

    A CodeBuild project runs unit tests for a Java service. The team wants line coverage trends shown in CodeBuild for every build, and builds must fail automatically when line coverage drops below 80%. Which configuration meets these requirements?

    Show the answer

    Correct answerB. Add a reports section with the JaCoCo XML coverage file, and run the tests with the coverage tool's 80% check so a shortfall returns a nonzero exit code.

    AWhy not this: Report groups collect and display coverage; they have no setting that fails a build below a threshold.

    BWhy this is right: The reports section gives coverage trends, and the coverage tool's check fails the build command when coverage is below 80%.

    CWhy not this: A build artifact is not a coverage report, and an alarm cannot fail a build that has already finished.

    DWhy not this: A manual approval depends on people reading the report rather than failing the build automatically.

    A coverage report in the buildspec's reports section lets CodeBuild show line and branch coverage over time. CodeBuild does not enforce coverage thresholds itself, so the test command must fail when coverage is too low; a nonzero exit code fails the build.

    Open this question
  39. Question 39

    SDLC Automation

    A pipeline's custom test action launches a standalone Amazon ECS task containing a test runner and a log-forwarding sidecar, then reports success when RunTask succeeds. How should the action determine whether the tests passed?

    Show the answer

    Correct answerB. Wait for STOPPED and require a zero exit code from the test runner.

    AWhy not this: The sidecar's exit code describes log forwarding, not the test runner's result.

    BWhy this is right: The completed test runner's zero exit code signals test success; missing or nonzero results must not pass.

    CWhy not this: Successful submission and placement do not establish the result of tests that run later.

    DWhy not this: RUNNING confirms startup, while the image digest identifies code; neither establishes test completion.

    RunTask success confirms task submission, not successful test completion. The action must wait for completion and evaluate the test runner's exit code; a successful logging sidecar does not establish that the tests passed.

    Open this question
  40. Question 40

    SDLC Automation

    A team must verify that a service starts successfully on an instance launched from the AMI produced by EC2 Image Builder, rather than only on the original build instance. Where should the team place this check?

    Show the answer

    Correct answerB. In the test phase of a test component

    AWhy not this: The validate phase checks the build instance before the resulting image is created.

    BWhy this is right: The test phase runs checks against an instance launched from the newly created image.

    CWhy not this: Distribution configuration controls image delivery, not service checks on a launched test instance.

    DWhy not this: Infrastructure configuration defines build resources and networking rather than executable service checks.

    Image Builder runs the test stage against an instance launched from the created image, verifying the resulting AMI. A build component's validate phase checks the build instance before image creation and does not establish that a fresh launch works.

    Open this question
  41. Question 41

    SDLC Automation

    An AWS CodeBuild project uses a standard AWS-managed Linux image in a VPC to build containers with the Docker daemon and push them to Amazon ECR. Dependency downloads must be cached across builds that run on different hosts; assuming network access and IAM permissions are configured, which project configuration meets these requirements?

    Show the answer

    Correct answerD. Enable privileged mode and use an Amazon S3 cache for dependency directories.

    AWhy not this: Local custom caches remain on a build host and cannot provide dependency reuse across different hosts.

    BWhy not this: Docker layer caching is not dependency-directory caching, and CodeBuild local caching is unsupported for VPC builds.

    CWhy not this: Docker daemon builds using this managed Linux environment in a VPC require privileged mode.

    DWhy this is right: Privileged mode supports the Docker daemon, and S3 caching makes cached dependencies available across build hosts.

    Privileged mode supports Docker daemon builds in a VPC, and an S3 cache can restore dependency directories on different build hosts. Local custom caching depends on host reuse and therefore does not satisfy the cross-host requirement.

    Open this question
  42. Question 42

    SDLC Automation

    A team is configuring an EC2 Image Builder pipeline to install software on a base AMI, build in a designated subnet, and copy the resulting AMI to selected AWS Regions. Which configurations should the team use? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersA. An infrastructure configuration specifying the subnet and instance profileD. An image recipe specifying the parent image and build componentsE. A distribution configuration specifying the destination Regions

    AWhy this is right: The infrastructure configuration selects build infrastructure, including the subnet and EC2 instance profile.

    BWhy not this: CodeBuild buildspecs configure CodeBuild jobs, not the installation components of an Image Builder recipe.

    CWhy not this: ECR replication distributes container repository images rather than EC2 AMIs.

    DWhy this is right: The image recipe identifies the base image and components that install and configure software.

    EWhy this is right: The distribution configuration defines the Regions where Image Builder distributes the AMI.

    An image recipe defines the parent image and components, an infrastructure configuration controls build resources, and a distribution configuration controls regional AMI delivery. ECR replication distributes container images, not AMIs.

    Open this question
  43. Question 43

    SDLC Automation

    An EC2 Image Builder pipeline runs nightly but must create an AMI only when a newer parent image or component version is available. Its recipe currently pins every dependency to an exact version; which change meets the requirement?

    Show the answer

    Correct answerD. Use version-wildcard dependencies and configure the schedule to build only when dependency updates are available.

    AWhy not this: Building at every scheduled execution creates images even when dependencies have not changed.

    BWhy not this: Distribution events describe completed image delivery, not the availability of newer dependencies.

    CWhy not this: Exact version pins prevent newer dependency versions from being selected.

    DWhy this is right: Wildcards permit newer versions, while the dependency-update condition limits builds to eligible dependency changes.

    Version wildcards let Image Builder resolve newer eligible dependencies, and the dependency-update schedule condition avoids unnecessary builds. Exact version pins prevent the recipe from selecting newer versions even when those versions exist.

    Open this question
  44. Question 44

    SDLC Automation

    A team must quarantine a CodeArtifact package version so that neither dependency resolution nor requests for its exact version can download it, while retaining its assets for possible restoration. After the investigation, the team must either restore downloads or permanently remove the assets while retaining the version record; which lifecycle sequence meets these requirements?

    Show the answer

    Correct answerA. Archive the version, then change its status back to Published or to Disposed.

    AWhy this is right: Archiving blocks downloads reversibly; changing the status back to Published restores downloads, while Disposed removes the assets and keeps the record.

    BWhy not this: Disposal removes the assets permanently, so a later status change cannot make the original package downloadable again.

    CWhy not this: Deletion removes the version and its assets, so there is no quarantined version left to restore or dispose of.

    DWhy not this: Unlisted versions can still be downloaded by exact version, and deletion removes the version record.

    Archived versions keep their assets but cannot be downloaded; their status can later be changed back to Published, or to Disposed. Disposal permanently removes assets while keeping the version record. Unlisted versions can still be downloaded when their exact version is requested.

    Open this question
  45. Question 45

    SDLC Automation

    A versioned S3 bucket stores deployment artifacts under reusable object keys. A lifecycle rule expires current versions after 30 days, but storage charges for older versions continue to grow; what should the engineer add to remove those older versions after a retention period?

    Show the answer

    Correct answerA. A noncurrent version expiration action

    AWhy this is right: Noncurrent version expiration targets older object versions and permanently deletes them after the specified period.

    BWhy not this: A storage-class transition changes storage placement and pricing, not retention of older versions.

    CWhy not this: Multipart upload cleanup removes unfinished upload parts rather than completed object versions.

    DWhy not this: Delete marker cleanup removes eligible markers, not the stored noncurrent artifact data.

    Noncurrent version expiration permanently removes older object versions after the configured retention period. Expiring a current version in a versioned bucket normally creates a delete marker; delete marker cleanup does not remove retained artifact versions.

    Open this question
  46. Question 46

    SDLC Automation

    A pipeline must compile an AWS SAM application with native dependencies for the Lambda runtime, then produce a template that another account can deploy without access to the build workspace. Which approach meets these requirements?

    Show the answer

    Correct answerA. Run SAM build in a compatible container, then package the built template and upload its artifacts to Amazon S3.

    AWhy this is right: The build produces compatible deployment content, and packaging replaces local artifact references with S3 locations.

    BWhy not this: Template validation neither builds dependencies nor replaces local paths with remotely accessible artifact references.

    CWhy not this: Uploading source does not produce runtime-compatible native dependencies or correctly package each function.

    DWhy not this: Packaging uploads artifacts but does not compile dependencies; packaging first would capture unbuilt content.

    A container-based SAM build creates runtime-compatible dependencies; packaging uploads local artifacts and produces a template with S3 references. Uploading source alone does not compile native dependencies or create the required deployment packages.

    Open this question
  47. Question 47

    SDLC Automation

    An Amazon ECR repository contains obsolete multi-architecture releases whose untagged platform image manifests meet an expiration rule, but those manifests remain referenced by retained image indexes. What should the engineer change so that ECR can expire the obsolete platform images without affecting retained releases?

    Show the answer

    Correct answerC. Expire the obsolete image indexes before expiring their referenced platform manifests.

    AWhy not this: Replication does not remove references between an image index and its platform manifests.

    BWhy not this: Meeting a shorter age threshold does not allow deletion while a manifest list still references the image.

    CWhy this is right: Removing obsolete indexes first allows their platform manifests to expire once no remaining index references them.

    DWhy not this: Tag immutability controls tag replacement; it does not remove image-index references that prevent expiration.

    ECR cannot expire an image referenced by a manifest list until the referencing list is deleted. Retiring obsolete image indexes first releases their platform manifests for cleanup. Shortening the age threshold does not remove the reference constraint.

    Open this question
  48. Question 48

    SDLC Automation

    An EC2 application uses immutable releases with the previous fleet retained for immediate rollback, and both fleets share an RDS database. A release must rename a database column without interrupting service or preventing rollback; which approach is BEST?

    Show the answer

    Correct answerD. Add a compatible column, migrate usage, and defer removing the original.

    AWhy not this: The previous application version can fail if it still requires the original column.

    BWhy not this: Updating both fleets removes the unchanged rollback target and does not preserve schema compatibility.

    CWhy not this: Restoring a snapshot is not an immediate application rollback and can discard subsequent writes.

    DWhy this is right: Keeping the original column preserves compatibility while application usage transitions.

    An expand-and-contract migration preserves compatibility with both application versions during deployment and rollback. Retaining the previous fleet alone does not make a destructive shared-database change reversible.

    Open this question
  49. Question 49

    SDLC Automation

    An EC2 application must retain its existing instances because licenses are bound to instance identities. Brief maintenance downtime is acceptable; which deployment pattern meets this constraint?

    Show the answer

    Correct answerA. Install the new application version on existing instances.

    AWhy this is right: Updating software on the existing instances preserves the identities required by the licenses.

    BWhy not this: A parallel environment introduces new instances and does not preserve the licensed identities.

    CWhy not this: A replacement fleet has new instance identities and would violate the licensing constraint.

    DWhy not this: An instance refresh replaces instances rather than preserving their identities.

    A mutable deployment updates existing instances, preserving their identities. Replacing instances gradually still changes those identities, even if service availability is maintained.

    Open this question
  50. Question 50

    SDLC Automation

    An Auto Scaling group deploys a release by gradually replacing instances with instances launched from a tested, versioned AMI; no running instance is modified. An engineer calls this mutable because old and new versions coexist temporarily; which assessment is correct?

    Show the answer

    Correct answerA. It is immutable because deployed instances are replaced.

    AWhy this is right: Each release replaces instances with a tested image instead of changing running instances.

    BWhy not this: Version coexistence during replacement does not establish separate blue and green environments.

    CWhy not this: Batch size describes rollout sequencing, not whether existing instances are modified.

    DWhy not this: Keeping the Auto Scaling group does not make updates to its replaceable instances mutable.

    Immutability concerns replacing deployed instances rather than modifying them in place. Rolling replacement can be immutable; temporary coexistence does not by itself establish separate blue and green environments.

    Open this question