Question 1 of 65
0% complete
Review your answers
0 of 65 correct
-
Question 1
Correct IncorrectEvery step is safe to run more than once, and nobody looks up an individual execution in the console after it finishes; failure details written to Amazon CloudWatch Logs are enough. Which change handles the peak rate at the lowest cost?
Keep the Standard workflow and request higher StartExecution and StateTransition quotas for the account in that Region. Correct answer Your answerRecreate reading-normalize as an asynchronous Express workflow and send its execution history to a CloudWatch Logs log group. Correct answer Your answerKeep the Standard workflow and merge validation, conversion and the database write into a single Task state. Correct answer Your answerKeep the Standard workflow and feed it through Amazon EventBridge Pipes from an SQS queue to smooth the peaks. Correct answer Your answerExplanation
Express workflows are built for high-volume, short-lived executions: they run for up to five minutes, accept far higher start rates than Standard workflows, and are billed by request count and duration instead of per state transition. Asynchronous Express executions are at-least-once, which is acceptable because every step is idempotent, and their history goes to CloudWatch Logs rather than the console, which is what the team wants. Raising the Standard quotas lets executions start but keeps the per-transition pricing that drives the bill. Merging the steps into one Task state trims a few transitions but leaves the Standard start-rate throttling and per-transition billing in place and loses per-step retries. Feeding executions through Pipes from a queue only delays the throttled starts, adding latency without lowering cost.
-
Question 2
Correct IncorrectWhich configuration lets both apps obtain tokens securely while following current OAuth 2.0 guidance for public clients?
Create an app client without a client secret, enable the authorization code grant, and have each app send a PKCE code challenge and later redeem the code with its code verifier. Correct answer Your answerCreate an app client with a client secret, enable the authorization code grant, and have each app download the secret at startup from an unauthenticated API before redeeming the code. Correct answer Your answerKeep the implicit grant but shorten the ID and access token validity to five minutes, so that a token leaked from the URL fragment or the browser history expires quickly. Correct answer Your answerEnable the client credentials grant on an app client without a secret, and have each app request tokens directly from the token endpoint with the user's chosen scopes. Correct answer Your answerExplanation
Code running in a browser or on a phone cannot keep a secret, so the recommended flow for these public clients is the authorization code grant with Proof Key for Code Exchange: the app sends a hashed code challenge on the authorize request and proves possession of the matching code verifier when it redeems the code, so an intercepted authorization code is useless, and the app client has no secret to leak. Downloading the secret from an unauthenticated API just hands the secret to anyone who calls that API, which is the same exposure as embedding it. Shortening token lifetimes under the implicit grant still delivers tokens in the URL fragment, where browser history, logs and referrers can capture them, and the implicit grant is no longer recommended. The client credentials grant is for machine-to-machine access, requires a client secret, and issues tokens that represent the app rather than a signed-in user.
-
Question 3
Correct IncorrectWhich two changes reduce the size of the image that the tasks pull, without changing application code?
Add an Amazon ECR lifecycle policy that expires untagged images older than 14 days so the repository holds fewer image versions. Correct answer Your answerTurn on the local Docker layer cache in the CodeBuild project so unchanged layers are reused from earlier builds instead of rebuilt. Correct answer Your answerUse a multi-stage build that compiles in a node:22 stage and copies only dist and production dependencies into a slim runtime stage. Correct answer Your answerAppend a final RUN instruction that deletes the TypeScript compiler, test tools and fixtures after the build step has finished. Correct answer Your answerAdd a .dockerignore file that excludes .git, node_modules, the test fixtures and local environment files from the build context. Correct answer Your answerExplanation
A multi-stage build keeps only the layers of the final stage, so the compiler, devDependencies and full base image stay in a discarded builder stage while the runtime stage ships a slim base, the compiled dist folder and production dependencies. A .dockerignore file keeps .git, node_modules and the fixtures out of the build context, so COPY . . can no longer bake them into a layer. An ECR lifecycle policy only removes old images from the repository to save storage; the image each task pulls is unchanged. The CodeBuild layer cache makes builds faster but produces exactly the same layers. A later RUN that deletes files only adds a layer that hides them, because the earlier layers still contain the files and are still pulled.
-
Question 4
Correct IncorrectWhich diagnosis and remedy match the evidence in the two REPORT lines?
Both invocations ran out of memory, so raising the memory setting to 2,048 MB fixes both failures because CPU also scales with it. Correct answer Your answerBoth invocations timed out, so raising the timeout to 120 seconds fixes both failures without changing the memory setting. Correct answer Your answerThe first invocation timed out while using little memory, and the second ran out of memory early, so each one needs a different fix. Correct answer Your answerThe first invocation ran out of memory and the second timed out, so the first needs more memory and the second a longer timeout. Correct answer Your answerExplanation
A Duration equal to the configured 30,000 ms with Max Memory Used far below Memory Size is the signature of a timeout, while Max Memory Used equal to Memory Size on an invocation that ended well before the timeout is the signature of an out-of-memory exit, so the first needs a longer timeout or a faster dependency and the second needs more memory or a smaller working set. Raising memory for both treats the first invocation as a memory problem although it used only 388 MB of 1,024 MB. Raising the timeout for both ignores that the second stopped after 6.4 seconds, far inside the limit. Swapping the diagnoses reads each signal backward: the run that hit 30 seconds was not short of memory, and the run that hit 1,024 MB was not near the timeout.
-
Question 5
Correct IncorrectWhich approach processes every image in parallel with the least custom code?
Split the key list into chunks of 1,000 keys and start a separate Standard execution with an inline Map for each chunk. Correct answer Your answerWrite a Lambda function that lists the prefix and invokes page-ocr asynchronously once for every key that it finds. Correct answer Your answerUse a Distributed Map state with an S3 ItemReader on the prefix, a MaxConcurrency value, and a ResultWriter to S3. Correct answer Your answerKeep the inline Map state, raise its MaxConcurrency to 0, and store the key list in a Pass state Result field instead. Correct answer Your answerExplanation
A Distributed Map state reads its items directly from S3 with an ItemReader, so the 4.2 million keys never pass through the state payload, and it runs each batch of items as a separate child workflow with its own history, so the parent execution stays far below the 25,000-event limit. MaxConcurrency controls how many child workflows run at once (up to 10,000), and a ResultWriter writes per-item success and failure results to S3. Chunking the list into many Standard executions means writing and operating custom splitting and tracking code. A listing-and-invoking Lambda function needs its own pagination, throttling and result tracking, and listing millions of keys and invoking for each risks its 15-minute timeout. An inline Map keeps every iteration in one history, and a Pass state Result is part of the definition and state data, so both limits still apply.
-
Question 6
Correct IncorrectWhich two actions should the developer take?
Add the corporate SAML provider to a Cognito identity pool as an authentication provider, and give the authenticated role permission to invoke the API. Correct answer Your answerAdd a SAML identity provider to the user pool from the customer's metadata document, mapping the email and name assertion attributes to user pool attributes. Correct answer Your answerEnable the SAML provider on the front end's app client, and register the user pool's SAML response URL and entity ID with the customer's identity provider. Correct answer Your answerCreate an IAM SAML identity provider from the metadata document, and have the front end call AssumeRoleWithSAML and sign each API request with the returned keys. Correct answer Your answerConfigure a user migration Lambda trigger that checks each dispatcher's password against the customer's directory and creates the user in the pool at first sign-in. Correct answer Your answerExplanation
A user pool federates a SAML 2.0 identity provider natively: creating the SAML provider in the pool from the metadata document, with attribute mapping from assertion attributes to user pool attributes, lets Cognito create a federated user and issue its own ID and access tokens, so the existing user pool authorizer keeps working. The provider must then be enabled on the app client so managed login offers it, and the customer's identity provider must trust the pool by registering its saml2/idpresponse URL and its urn:amazon:cognito:sp entity ID. An identity pool with a SAML provider issues temporary AWS credentials, not user pool tokens, so the authorizer would reject the requests. AssumeRoleWithSAML likewise returns IAM credentials for SigV4 signing, which a Cognito authorizer does not accept. A user migration trigger receives each password through Cognito, which breaks the rule that the vendor never handles them, and it is a one-time migration rather than single sign-on.
-
Question 7
Correct IncorrectWhere in the source bundle should the team place the script so that Elastic Beanstalk runs it at the correct point of each application deployment?
In an .ebextensions configuration file, as an entry in the commands section that calls the script. Correct answer Your answerIn the .platform/hooks/prebuild directory, as an executable script whose first line is #!/bin/bash. Correct answer Your answerIn the Procfile, as an additional named process that runs the script alongside the web process. Correct answer Your answerIn the .platform/hooks/predeploy directory, as an executable script whose first line is #!/bin/bash. Correct answer Your answerExplanation
On Amazon Linux 2023 platforms, files in .platform/hooks/predeploy run after the platform has set up the application, including the requirements.txt packages, and before the new version moves to its final location, and a nonzero exit aborts the deployment. Hooks in .platform/hooks/prebuild run before the application is set up, so Django is not installed yet. The commands section of an .ebextensions file runs earlier still, before the application and web server are set up; only its container_commands section runs after setup in the staging directory, just before predeploy hooks, and would also work, but platform hooks are the mechanism these platforms recommend: a plain executable file with no YAML wrapper. A Procfile entry defines a long-running process started after deployment, so a one-off script would run too late and be relaunched whenever it exits.
-
Question 8
Correct IncorrectWhich design delivers each event to all three consumers in order and without duplicates, with the least producer code?
Publish to an SNS standard topic and subscribe the three existing SQS FIFO queues to it with raw message delivery turned on. Correct answer Your answerPublish to an SNS FIFO topic with content-based deduplication and prescription ID as the group ID, and subscribe the three FIFO queues. Correct answer Your answerPublish to an SNS FIFO topic and replace the three FIFO queues with SQS standard queues that are subscribed to the topic. Correct answer Your answerPublish to an Amazon EventBridge custom event bus with one rule per consumer that targets that consumer's FIFO queue. Correct answer Your answerExplanation
An SNS FIFO topic orders messages within each message group and deduplicates publishes within a five-minute window, using content-based deduplication or an explicit deduplication ID, so a retried Publish of the same event is accepted but not delivered again,, and it delivers to subscribed SQS FIFO queues in that same order, so one Publish call reaches all three consumers in prescription order. Using the prescription ID as the group keeps each prescription ordered while different prescriptions flow in parallel. An SNS standard topic cannot have SQS FIFO queues subscribed to it, so that design cannot be built. SNS FIFO topics can deliver to SQS standard queues, but standard queues offer best-effort ordering and at-least-once delivery, losing both guarantees at the consumer. EventBridge does not guarantee delivery order across events, so rules targeting the queues can enqueue amendments out of sequence.
-
Question 9
Correct IncorrectWhich alarm configuration meets this requirement?
An anomaly detection alarm on the Errors metric with the Sum statistic, so the expected band learns the daily traffic pattern and widens each morning. Correct answer Your answerA composite alarm that enters ALARM only when an alarm on Errors above 50 and an alarm on Invocations above 5,000 are both in ALARM. Correct answer Your answerA metric math expression of 100 times Errors divided by Invocations, both with the Sum statistic over 5 minutes, alarming above 2. Correct answer Your answerAn alarm on the Errors metric with the Sum statistic and the threshold raised to 1,200 per 5 minutes, sized for the morning peak. Correct answer Your answerExplanation
A metric math expression that divides the Sum of Errors by the Sum of Invocations over the same period yields the failure percentage directly, so the threshold of 2 means the same thing at 2,000 invocations an hour as at 60,000, and the alarm evaluates the expression rather than either raw metric. Anomaly detection still models the raw error count, so it judges whether the count is unusual for the time of day, not whether more than 2 percent of calls failed. A composite alarm only combines the states of other alarms with AND, OR and NOT; it cannot compute a ratio, and both child alarms still use raw thresholds. Raising the count threshold to 1,200 silences the mornings but lets an overnight failure rate of 50 percent pass unnoticed, because 1,000 errors in 2,000 calls never reaches it.
-
Question 10
Correct IncorrectWhich token should the app send to catalog-svc for authorization, without adding any Lambda triggers?
The ID token, after configuring the app client to request the catalog/write scope, so that the granted scope is added to the claims of the ID token. Correct answer Your answerThe access token, because it carries the scope and client_id claims and a token_use of access, marking it as the token meant for authorizing API calls. Correct answer Your answerThe refresh token, because it stays valid for 30 days and the service can present it to the token endpoint to look up the user's granted scopes on each request. Correct answer Your answerThe ID token, because its aud claim equals the app client ID, which lets the service confirm that the token was issued for this particular application. Correct answer Your answerExplanation
The access token is the one meant for resource servers: it carries the granted OAuth scopes, including custom resource server scopes such as catalog/write, plus client_id and token_use set to access, and libraries such as aws-jwt-verify check exactly those claims when configured for access tokens. Requesting the scope on the app client does not put it into the ID token, because Cognito writes scopes only to the access token, and the ID token describes who the user is for the client app. The refresh token is an opaque, encrypted value that only the Cognito token endpoint can read, so the service cannot validate it locally, and redeeming it on every request would mint new tokens rather than authorize a call. The ID token's aud claim does identify the app client, but that proves which app the user signed in to, not what the caller is permitted to do, and it still contains no scope.
-
Question 11
Correct IncorrectWhich change lets the task definition register and run the job at the lowest cost?
Keep the task-level values and set the container-level cpu to 512 and memoryReservation to 7680 so the container limits match the task. Correct answer Your answerRemove the task-level cpu and memory values and size the task through the container-level cpu and memory settings only. Correct answer Your answerKeep the task-level memory at 8192 and raise the task-level cpu to 2048, which supports between 4 GB and 16 GB of memory. Correct answer Your answerKeep the task-level memory at 8192 and raise the task-level cpu to 1024, which supports between 2 GB and 8 GB of memory. Correct answer Your answerExplanation
Fargate bills for the task-level size and accepts only fixed CPU and memory pairs: 512 CPU units allow 1 GB to 4 GB, while 1024 units (1 vCPU) allow 2 GB to 8 GB, so 1024 with 8192 is the smallest valid size that still gives the job its 7.5 GB, and the 7,680 MiB container limit fits inside it. Changing only the container-level cpu and memoryReservation leaves the invalid 512/8192 task-level pair in place, so registration still fails. Fargate requires task-level cpu and memory, so a definition that sizes only its containers is rejected for the FARGATE launch type. A task-level cpu of 2048 with 8 GB is also a valid pair and would run, but it pays for twice the vCPU the job needs, which fails the lowest-cost requirement.
-
Question 12
Correct IncorrectWhich change lets any instance serve any request without losing carts during scale-in?
Store session and cart data in Amazon ElastiCache or a DynamoDB table keyed by session ID, and turn off target group stickiness. Correct answer Your answerLengthen the stickiness duration and raise the target group deregistration delay so that sessions drain first. Correct answer Your answerWrite session data to a file on an Amazon EBS volume attached to each instance and snapshot the volume hourly. Correct answer Your answerAdd a scale-in lifecycle hook that copies the in-memory sessions to a surviving instance before termination completes. Correct answer Your answerExplanation
Moving session and cart state to a shared store such as ElastiCache (Valkey or Redis OSS) or a DynamoDB table keyed by session ID makes every instance interchangeable: any instance can read the session, a terminated instance takes nothing with it, and with stickiness off the load balancer spreads load to new instances immediately. A DynamoDB TTL attribute or a cache TTL can expire abandoned sessions. A longer stickiness duration and deregistration delay only postpone the loss, because in-flight connections drain but the memory holding the sessions is still destroyed at termination, and stickiness keeps starving new instances. An EBS file is still per-instance state, and hourly snapshots do not make it readable by other instances. A lifecycle hook that copies sessions between instances is custom, fragile code that still leaves the tier stateful.
-
Question 13
Correct IncorrectWhich approach meets these requirements with the least operational overhead?
Enable IAM database authentication and create one database user per tenant, so that each request opens a connection with an authentication token for its own tenant's user. Correct answer Your answerAdd a default scope to the ORM models that appends the tenant_id condition to every query, and add a unit test that fails whenever a raw SQL query omits the condition. Correct answer Your answerCreate a separate view for each tenant that filters on its tenant_id, and grant each tenant's own database role access to only the views that belong to that tenant. Correct answer Your answerEnable row-level security with a policy on each table comparing tenant_id to current_setting('app.tenant_id'), set per transaction with SET LOCAL by the API. Correct answer Your answerExplanation
PostgreSQL row-level security lets one policy per table restrict every SELECT, UPDATE and DELETE to rows whose tenant_id matches a session setting, and setting app.tenant_id with SET LOCAL scopes the value to the current transaction, so a pooled connection never carries one tenant's value into another request; because app_rw neither owns the tables nor holds BYPASSRLS, the policies apply to it, whereas an owning role would also need FORCE ROW LEVEL SECURITY. IAM database authentication controls who may connect, not which rows a query returns, and 1,800 database users would defeat the shared connection pool. An ORM default scope with a unit test still lives in application code, so a raw query or a missed test reintroduces exactly the leak that occurred. Per-tenant views and roles would mean thousands of views to create and migrate, and the single pooled role app_rw cannot switch to a different role for each request without extra connection handling.
-
Question 14
Correct IncorrectWhich change absorbs the bursts and removes the forwarding function with the least operational overhead?
Set reserved concurrency on the forwarding function so that it can no longer consume the whole account limit. Correct answer Your answerReplace the queue with an Amazon Kinesis data stream and keep the forwarding function writing records to it. Correct answer Your answerTurn on API Gateway stage caching for POST /trip-events so that repeated requests skip the forwarding function. Correct answer Your answerReplace the Lambda integration with an AWS service integration that calls SQS SendMessage using an IAM role. Correct answer Your answerExplanation
A REST API can call SQS directly through an AWS service integration: API Gateway assumes an IAM role allowed to call sqs:SendMessage and a mapping template places the request body in the message, so the queue absorbs the burst and no function concurrency is consumed at all. The worker fleet keeps reading at its own pace. Reserved concurrency protects other functions, but the forwarding function is still capped and returns throttling errors to callers during the spike, and the function still exists to operate. Swapping the queue for a Kinesis data stream keeps the same forwarding function and its concurrency problem, and adds shard management. Stage caching is meant for idempotent reads, and every trip event is a distinct write that must reach the queue, so caching would drop events rather than buffer them.
-
Question 15
Correct IncorrectWhich action makes production use the new pricing service while keeping the alias-based release process?
Run update-function-configuration with the version 14 qualifier to set PRICING_URL on that version, so the live alias picks it up. Correct answer Your answerPublish a new version from $LATEST, which captures the updated environment variable, and then point the live alias at that version. Correct answer Your answerWait for the execution environments of version 14 to be recycled, after which newly started environments read the updated value. Correct answer Your answerPoint the API Gateway integration at the unqualified function ARN so that requests run $LATEST and see each saved change. Correct answer Your answerExplanation
A published Lambda version is an immutable snapshot of the code and the configuration, including environment variables, so the console edit changed only $LATEST; publishing a new version captures the new PRICING_URL, and moving the live alias to it switches production without touching API Gateway, while version 14 stays available for rollback. Configuration updates apply only to $LATEST, so a version qualifier cannot be used to edit version 14 in place. Recycled execution environments for version 14 are rebuilt from the same frozen snapshot and keep the old value forever. Pointing the integration at the unqualified ARN would serve the new value, but it abandons the alias, sends every unpublished change straight to production and removes the one-step rollback.
-
Question 16
Correct IncorrectWhat does the rising IteratorAge indicate about this pipeline?
Producers are being throttled with ProvisionedThroughputExceeded errors on PutRecords, so new readings reach the stream late. Correct answer Your answerThe stream retention period is too short, so records are expiring before the function reads them and the age reflects the gaps. Correct answer Your answerThe event source mapping keeps retrying one failing batch, which blocks the shard until the batch succeeds or its records expire. Correct answer Your answerThe function processes records slower than they arrive, so each batch is older, and data is lost if the age reaches 24 hours. Correct answer Your answerExplanation
IteratorAge is the age of the last record in each batch the function has just processed, so a steady climb with no errors or throttles means the consumer is falling behind the producers, here because the new enrichment lookup lengthened each invocation; if the age reaches the 24-hour retention period, unread records expire and are lost. Producer throttling would show in the stream's WriteProvisionedThroughputExceeded metric and delays a record before it enters the stream, which IteratorAge does not measure. Expiring records are a future consequence of the lag, not its cause, and the age is still under an hour. A batch retried in a loop would show in the Errors metric, which has stayed at zero.
-
Question 17
Correct IncorrectWhich design lets clients receive their results reliably with the fewest changes to the analysis logic?
Return 202 with a job ID after queuing the work, run the analysis asynchronously, and add GET /jobs/{id} for polling. Correct answer Your answerRequest an integration timeout increase to 15 minutes so that the synchronous call can wait for the whole contract analysis. Correct answer Your answerMove the endpoint to an HTTP API, whose longer integration timeout covers the full duration of each analysis. Correct answer Your answerSwitch the integration to an asynchronous Lambda invocation so that API Gateway responds within the default timeout. Correct answer Your answerExplanation
The asynchronous request/response pattern decouples the client from the long-running work: the POST stores a job record, starts the analysis (for example through a queue, an asynchronous invocation or a Step Functions execution) and immediately returns 202 Accepted with a job ID, and the client polls GET /jobs/{id} until the stored status shows the result. A dropped mobile connection costs nothing, because the result is waiting when the app polls again. The 29-second default is not a ceiling: since June 2024 Regional and private REST APIs can raise it through a quota request (at the cost of account throttle quota), and REST response streaming can keep a response open for up to 15 minutes. Either way, though, each client holds one connection open for up to 12 minutes, so any cellular drop loses the result, which fails the reliability requirement that polling meets with no change to the analysis logic. HTTP APIs cap the integration timeout at 30 seconds. An asynchronous invocation returns quickly but gives the client no job ID or way to fetch the finished analysis.
-
Question 18
Correct IncorrectWhich approach gives the developers CLI and SDK access with short-term credentials and the least operational overhead?
Have each developer run aws configure sso to create a named profile per account and permission set, sign in with aws sso login, and select the profile with AWS_PROFILE. Correct answer Your answerKeep the IAM users, enforce MFA on them, and have each developer call aws sts get-session-token every morning to write temporary keys into a separate named profile. Correct answer Your answerSet up IAM Roles Anywhere with a private certificate authority, issue each laptop an X.509 certificate, and configure its credential helper as a credential_process command. Correct answer Your answerRotate every developer's access key every 30 days with a scheduled Lambda function that creates a new key pair and emails it to the IAM user's owner. Correct answer Your answerExplanation
Because the studio already runs IAM Identity Center, aws configure sso writes an sso-session and a named profile for each account and permission set, aws sso login opens the corporate sign-in in a browser, and both the CLI and boto3 then obtain role credentials that expire automatically, with no IAM users or access keys left to manage. Requiring MFA with get-session-token still depends on each IAM user keeping a long-lived access key to call it, which is exactly what the audit flagged. IAM Roles Anywhere does issue temporary credentials, but it adds a certificate authority, certificate distribution and renewal, and trust anchors and profiles, duplicating identities that Identity Center already holds. Rotating keys every 30 days leaves long-lived credentials in place, and emailing secret keys creates a new path for them to leak.
-
Question 19
Correct IncorrectWhich approach meets these requirements with the least operational overhead?
Add a CloudWatch alarm on checkout errors as a deployment monitor so AppConfig rolls the deployment back when the alarm enters ALARM. Correct answer Your answerReplace the all-at-once strategy with a linear strategy and a 30-minute bake time so that a bad version reaches only part of the fleet. Correct answer Your answerAdd validation logic to each function that rejects a malformed configuration and keeps using the last configuration that parsed. Correct answer Your answerAttach a JSON Schema validator to the profile that requires maxBasketItems as an integer from 1 to 200 and lists the required keys. Correct answer Your answerExplanation
A configuration profile can carry up to two validators, JSON Schema or Lambda, and AppConfig runs them when StartDeployment is called, so a version that violates the schema's type, minimum, maximum or required rules fails validation and AppConfig refuses to deploy it to any environment, even though saving the hosted version itself succeeds; the schema is declarative and needs no code. An alarm used as a deployment monitor reacts only after the bad version has reached functions and broken enough checkouts to trip the alarm, then rolls back. A linear strategy with bake time limits the blast radius, but some functions still receive the broken version. Validation inside each function changes function code, which the requirement rules out, and it runs after the bad version has already been deployed.
-
Question 20
Correct IncorrectHow should the developer deliver each new bid to the connected watchers with the least additional infrastructure?
Have each browser call placeBid every second with an empty bid so that the reply carries the latest bids. Correct answer Your answerStore connection IDs per auction on $connect, delete them on $disconnect, and POST to each through @connections. Correct answer Your answerPublish each bid to an Amazon SNS topic that has every browser connection ID subscribed as an HTTPS endpoint. Correct answer Your answerReturn the bid from placeBid in a route response so that API Gateway broadcasts it to every open connection on the API. Correct answer Your answerExplanation
API Gateway WebSocket APIs give each client a connection ID, and a backend pushes to a client by calling the @connections callback URL for that ID (PostToConnection in the API Gateway Management API) with execute-api:ManageConnections permission. Recording connection IDs per auction on $connect and removing them on $disconnect gives placeBid the list to fan out to, and a 410 GoneException identifies stale IDs to delete. Making browsers send empty bids every second turns the push channel back into polling, multiplies invocations, and a route response is returned only to the caller anyway. A connection ID is not an addressable HTTPS endpoint, so it cannot be subscribed to an SNS topic. A route response goes only to the connection that sent the message; API Gateway has no built-in broadcast to all connections.
-
Question 21
Correct IncorrectWhich CloudWatch Logs Insights query groups the error lines into recurring message templates and shows how many lines match each, without defining the formats in advance?
filter @message like /ERROR/ | pattern @message | sort @sampleCount desc | limit 25 Correct answer Your answerfilter @message like /ERROR/ | stats count(*) as lines by @message | sort lines desc Correct answer Your answerfilter @message like /ERROR/ | parse @message 'invoice * for carrier *' as inv, carrier | stats count(*) by carrier Correct answer Your answerfilter @message like /ERROR/ | dedup @message | fields @timestamp, @message | sort @timestamp desc Correct answer Your answerExplanation
The pattern command clusters log events that share a text structure and replaces the parts that vary, such as invoice numbers and carrier IDs, with tokens, returning each template as @pattern with its @sampleCount and @ratio, so sorting on @sampleCount ranks the recurring messages without any format being declared first. Grouping with stats count(*) by @message treats every distinct line as its own group, and because each line embeds unique IDs the counts are almost all 1. The parse query only extracts fields from lines that match the one format it names, so it counts a single known template and drops everything else. The dedup query removes exact duplicate messages, which barely exist here, and it returns raw lines with no grouping or counts.
-
Question 22
Correct IncorrectWhat explains the behavior, and what fixes it without changing application code?
The SDK queries the instance metadata service before container credentials, so remove the instance profile from the container instances to let the task role take effect. Correct answer Your answerMove the ci-builder keys from the ENV lines into a shared credentials file in the image, because the chain reads that file only after the task role credentials. Correct answer Your answerThe SDK uses container credentials only when the code builds a container provider explicitly, so set AWS_CONTAINER_CREDENTIALS_RELATIVE_URI in the task definition. Correct answer Your answerEnvironment variables come before container credentials in the default chain, so remove the ENV lines from the Dockerfile and redeploy so the SDK uses the task role. Correct answer Your answerExplanation
The default chain stops at the first provider that returns credentials, and it checks environment variables before the shared profile files, then container credentials, then the instance metadata service, so the ci-builder keys baked into the image win over the task role; removing them lets the chain reach the container credentials endpoint that ECS exposes for the task role. Instance metadata is the last provider, after container credentials, so removing the instance profile changes nothing here and would break the ECS agent. Moving the keys into a shared credentials file in the image changes nothing, because the profile file is also read before container credentials, so the SDK would still sign as ci-builder. ECS already sets AWS_CONTAINER_CREDENTIALS_RELATIVE_URI for every task with a task role, and the default chain uses it without any explicit provider, so setting it again has no effect while the environment keys remain.
-
Question 23
Correct IncorrectWhich approach meets these requirements with the least additional infrastructure?
Wrap the boto3 clients with botocore's Stubber, queue canned responses with expected request parameters, and call assert_no_pending_responses. Correct answer Your answerStart a LocalStack container in the CodeBuild environment and point the boto3 clients at its endpoint through an endpoint URL override. Correct answer Your answerRun the handler with sam local invoke and an event file so that it executes in a local Lambda container instead of the shared account. Correct answer Your answerGive CodeBuild an IAM role in a dedicated test account and delete the records that the tests create in a teardown step after each run. Correct answer Your answerExplanation
botocore's Stubber intercepts calls on a client inside the test process: add_response queues a canned reply together with expected_params, a call with different parameters raises an error, and assert_no_pending_responses proves every expected call happened, all without credentials or network; moto, or aws-sdk-client-mock for JavaScript, fills the same role. LocalStack can emulate both services offline, but it is an extra container that must run beside the tests, and it does not check the parameters sent to Publish. sam local invoke runs the handler in a local Lambda container, yet the SDK calls inside it still go to real AWS endpoints with real credentials. A dedicated test account isolates the data but keeps the network calls, the credential dependency and the slow runs.
-
Question 24
Correct IncorrectWhich change pushes location updates only to the customers tracking that order, with the least new infrastructure?
Build an API Gateway WebSocket API that a DynamoDB Streams Lambda function uses to push each location change. Correct answer Your answerSend each location change to the customer's phone as an Amazon SNS mobile push notification addressed to its device token. Correct answer Your answerAdd a subscription field annotated with @aws_subscribe on the updateCourierLocation mutation, filtered on an orderId argument. Correct answer Your answerTurn on AppSync server-side caching for getOrder so that the repeated polling requests are served from the cache. Correct answer Your answerExplanation
AppSync subscriptions are triggered by mutations made through the same API: annotating a subscription field with @aws_subscribe(mutations: ["updateCourierLocation"]) makes AppSync push each mutation result over its managed WebSocket connection, and an orderId argument (or an enhanced subscription filter) ensures each customer receives only the courier for their order. Because couriers already call the mutation through AppSync, no new service is needed. A separate WebSocket API with a stream-driven function would work, but it duplicates connection management and authorization that AppSync already provides. Mobile push notifications are for user-visible alerts and are not designed for a continuous stream of map coordinates every few seconds. Server-side caching cuts resolver cost but keeps the polling, and cached responses make the marker even staler.
-
Question 25
Correct IncorrectWhich change lets the job complete without introducing long-lived credentials?
Raise MaxSessionDuration on the export-runner task role to 12 hours, so that the source session lasts long enough to permit a chained session of four hours. Correct answer Your answerRaise MaxSessionDuration on finance-reader to 14,400 seconds and keep requesting DurationSeconds=14400, so that the request fits the role's configured maximum. Correct answer Your answerCreate an IAM user in the finance account, keep its access key in Secrets Manager, and call AssumeRole with the user keys so that the 12-hour maximum applies instead. Correct answer Your answerRequest a DurationSeconds of 3,600 or less, and have the job assume finance-reader again before each session expires and refresh its SDK clients each time. Correct answer Your answerExplanation
Task role credentials are themselves a role session, so assuming finance-reader with them is role chaining, and IAM caps a chained session at one hour whatever the target role's MaxSessionDuration says; only a first assumption from user credentials and applications on EC2 using instance profiles are exempt. The trust policy fix was right, and the job must now work in hourly sessions, which the SDK's STS assume-role credentials provider handles by refreshing before expiry. Raising the MaxSessionDuration of finance-reader to four hours would admit a 14,400-second request from a non-chained caller, but this chained request still fails. The MaxSessionDuration of the task role does not limit sessions that ECS obtains for the task, and it has no bearing on the chaining cap. An IAM user in the finance account would avoid chaining, but its access key is exactly the long-lived credential the requirement rules out, and storing it in Secrets Manager does not make it temporary.
-
Question 26
Correct IncorrectWhich change lets the app read these error responses with the least effort?
Add the Access-Control-Allow-Origin header to the error responses that each Lambda function returns in code. Correct answer Your answerAdd Access-Control-Allow-Origin and related headers to the DEFAULT_4XX and DEFAULT_5XX gateway responses. Correct answer Your answerAdd an OPTIONS method with a mock integration on every resource that returns the CORS preflight headers. Correct answer Your answerMap 4XX status patterns in each method's integration response to add the CORS headers to error replies. Correct answer Your answerExplanation
Errors raised by API Gateway before or instead of the integration, such as authorizer failures, missing API keys and throttling, are generated from gateway responses, and by default they carry no CORS headers. Adding Access-Control-Allow-Origin (and any other needed CORS headers) to the DEFAULT_4XX and DEFAULT_5XX gateway responses and redeploying the stage applies the headers to every such error at once, so the browser exposes the status code to the app. Adding headers in the Lambda error paths does nothing here, because these requests are rejected before any function runs. An OPTIONS method answers the preflight request only; the actual failed request still returns without the header. Integration response mappings are not used with Lambda proxy integrations, and requests rejected by the authorizer or throttling never reach an integration response.
-
Question 27
Correct IncorrectWhich approach meets these requirements?
Deploy each rule to a temporary event bus with a CloudWatch Logs target, send the samples with PutEvents, and check the log group. Correct answer Your answerCall the EventBridge TestEventPattern API for each pattern and sample, and fail the build when its Result differs from the label. Correct answer Your answerTurn on schema discovery for the event bus, generate code bindings from the discovered schemas, and compile the consumers against them. Correct answer Your answerRun cfn-lint against the SAM template during the build so that it validates each AWS::Events::Rule EventPattern before deployment. Correct answer Your answerExplanation
TestEventPattern takes an event pattern and a sample event, which must include id, account, source, time, region, resources and detail-type, and returns a Result of true or false, so a build script can assert each labeled sample and fail on any mismatch without creating a single resource. Deploying rules to a temporary bus with a log target would test real matching, but it creates exactly the rules, buses and targets the team wants to avoid and adds delivery delays to the build. Schema discovery records the structure of events that arrive on a bus and generates code bindings; it never evaluates a pattern. cfn-lint checks that the template and the EventPattern property are well formed, but it cannot tell whether a pattern matches a given event.
-
Question 28
Correct IncorrectWhich approach locates the slow tier using only data that API Gateway already publishes, without enabling new features or redeploying the stage?
Turn on execution logging at the INFO level for the stage and read the per-request timing entries that API Gateway writes for each call. Correct answer Your answerGraph IntegrationLatency p99 beside Latency p99 for the stage; a small gap points to the backend, a large one to API Gateway and its authorizer. Correct answer Your answerCompare the Average and p99 statistics of the stage's Latency metric; a wide spread between them shows the delay comes from API Gateway. Correct answer Your answerCompare the stage's CacheHitCount and CacheMissCount metrics; a high miss count shows the requests are waiting on the backend service. Correct answer Your answerExplanation
Latency measures from the moment API Gateway receives the request until it returns the response, while IntegrationLatency covers only the time between relaying the request to the backend and receiving its answer, so the difference between the two at the same percentile is time spent before and after the backend call, and both are published by default. Because every method here uses a Lambda TOKEN authorizer, that gap includes the authorizer function's run time as well as API Gateway's own processing, so a large gap points first at the authorizer, which its own Duration metric can confirm. Execution logging would also expose timings, but enabling it changes the stage configuration and adds logging cost, which the constraint rules out. The spread between Average and p99 Latency describes how the latency is distributed, not which tier contributes it. The cache hit and miss metrics are published only when stage caching is enabled, and even then a miss says nothing about how long the backend took.
-
Question 29
Correct IncorrectWhich change delivers the messages while meeting the security requirement?
Add a statement to the topic access policy that allows the principal sqs.amazonaws.com to perform sns:Publish, with aws:SourceArn set to the loyalty-points queue ARN. Correct answer Your answerCreate an IAM role that trusts sns.amazonaws.com and allows sqs:SendMessage on the queue, and set it as the subscription role on the SQS subscription to the topic. Correct answer Your answerAdd a queue policy that allows the principal sns.amazonaws.com to perform sqs:SendMessage, with an ArnEquals condition on aws:SourceArn set to the order-events topic ARN. Correct answer Your answerAdd a queue policy that allows the principal sns.amazonaws.com to perform sqs:SendMessage on the queue, and switch its encryption to the AWS managed key aws/sqs. Correct answer Your answerExplanation
SNS delivers to SQS by calling SendMessage as the sns.amazonaws.com service principal, so the queue resource policy must allow that, and an ArnEquals condition on aws:SourceArn limits the grant to the order-events topic, which prevents any other topic, including one in another account, from using SNS to write to the queue. A statement on the topic policy controls who may publish to the topic, and SQS never publishes, so it leaves the queue denying delivery. SNS has no delivery role for SQS endpoints; a subscription role exists for Amazon Data Firehose subscriptions, and delivery to a queue is authorized only by the queue policy. Allowing sns.amazonaws.com without a source condition lets every topic send, and the AWS managed key aws/sqs would break delivery outright, because its key policy cannot be edited to let SNS use the key.
-
Question 30
Correct IncorrectWhich change stops these duplicate payouts with the fewest code changes?
Set MessageGroupId to the payout ID so that SQS delivers no more than one message for each message group. Correct answer Your answerRaise the queue's DelaySeconds to 60 so that a retried send waits until the first message has been fully processed. Correct answer Your answerSet MessageDeduplicationId to the payout ID on every SendMessage call, overriding content-based deduplication. Correct answer Your answerTurn off content-based deduplication and rely on the FIFO queue's built-in exactly-once processing instead. Correct answer Your answerExplanation
Content-based deduplication derives the deduplication ID from a SHA-256 hash of the message body, and the rebuilt message carries a new sentAt timestamp, so each retry hashes differently and is accepted as new. An explicit MessageDeduplicationId takes precedence over the content hash, so using the payout ID makes SQS accept the retry but not deliver it again within the five-minute deduplication interval. A message group ID controls ordering, not deduplication; every message in a group is still delivered, one after another. A queue delay postpones delivery of both copies equally and removes neither. FIFO exactly-once processing is itself the deduplication mechanism: with content-based deduplication off, every send must supply a deduplication ID, so the change fails or relies on the same missing key.
-
Question 31
Correct IncorrectWhich approach meets these requirements most efficiently?
Call the TestState API with the EnrichAddress definition, the captured input and the DEBUG inspection level, then read inspectionData. Correct answer Your answerStart an execution of a copy of the state machine with the captured input and read each state's input and output in the event history. Correct answer Your answerRun the workflow in Step Functions Local with a mocked Lambda response, and compare the output of each state with the expected value. Correct answer Your answerInvoke the Lambda function with sam remote invoke and the captured input, then work out by hand what ResultPath should produce from it. Correct answer Your answerExplanation
TestState runs a single state definition, or one named state from a full definition, with the input provided and without creating or updating a state machine; at the DEBUG level its inspectionData shows the input, afterInputPath, afterParameters, the task result, afterResultSelector and afterResultPath, which pinpoints the field that writes the wrong key. Running a copy of the state machine creates a new resource and starts at the first state, so the 20-minute run and the partner calls happen again. Step Functions Local is unsupported, lacks feature parity, and still needs a local emulator and a full workflow run. Invoking the function with sam remote invoke shows only the raw Lambda response and none of the state's processing, leaving the faulty step to guesswork.
-
Question 32
Correct IncorrectWhich approach prevents duplicate processing while letting a crashed worker's job be retried within minutes?
Set the visibility timeout to the 12-hour maximum and have workers delete each message as soon as they receive it. Correct answer Your answerMove to an SQS FIFO queue so that a received message cannot be given to a second worker until it is deleted. Correct answer Your answerAdd a dead-letter queue with maxReceiveCount set to 1 so that a reappearing job is moved aside, not reprocessed. Correct answer Your answerKeep a short visibility timeout and have workers call ChangeMessageVisibility periodically to extend it while a job runs. Correct answer Your answerExplanation
A visibility heartbeat solves both problems: the worker keeps a short timeout, such as 10 minutes, and while the job is still running it calls ChangeMessageVisibility every few minutes to push the timeout out again, up to 12 hours from the original receipt. A healthy long job never reappears, and a crashed worker stops sending heartbeats, so its message becomes visible within minutes. Deleting messages on receipt removes the duplicate, but a crash then loses the job entirely. FIFO queues use the same visibility timeout model; a message whose timeout lapses becomes available again, so FIFO alone changes nothing. A dead-letter queue with a maxReceiveCount of 1 would move every long-running job aside the moment it reappears, and it would also stop a crashed worker's job from being retried at all.
-
Question 33
Correct IncorrectWhich approach produces a draft policy from the role's real activity with the least manual effort?
Run IAM Access Analyzer policy validation on the two attached managed policies, and apply its suggested changes to remove the overly broad actions from the role. Correct answer Your answerUse IAM Access Analyzer policy generation on the execution role with the trail and a 90-day window, then review the draft policy and fill in the resource ARNs. Correct answer Your answerRun the IAM policy simulator against the role for every S3 and DynamoDB action, and keep each action that the simulator reports as allowed for the role. Correct answer Your answerOpen the role's last accessed data in the IAM console, and write a new policy by hand from the services and actions that the console lists for the period. Correct answer Your answerExplanation
Access Analyzer policy generation reads the CloudTrail events recorded for a role over a chosen window of up to 90 days and returns a policy listing the actions the role actually called, with resource placeholders to tighten before attaching it, which is the activity-based least-privilege draft the review asks for. Policy validation checks a policy for grammar errors, security warnings and best-practice suggestions; it knows nothing about which actions were used, so it cannot shrink a full-access policy to the used set. The policy simulator reports whether actions are allowed, and with full-access policies attached every action is, so it would keep everything. Last accessed data is real usage information, but turning it into a policy is manual authoring, which the generator already does from the same trail.
-
Question 34
Correct IncorrectWhich step reveals the denied action, the resource and whether an explicit deny caused the failure, with the least effort?
Simulate the role's policies for ec2:RunInstances with the IAM policy simulator, entering the same AMI, subnet and instance type the script used. Correct answer Your answerSearch CloudTrail event history for the failed RunInstances event and read its errorMessage field for the denying policy statement. Correct answer Your answerRetry the RunInstances call with the DryRun parameter set to true and read the extra detail that the dry-run response returns. Correct answer Your answerPass the encoded message to aws sts decode-authorization-message and read the action, resource, conditions and explicit deny. Correct answer Your answerExplanation
DecodeAuthorizationMessage turns the encoded text that EC2 returns into JSON stating whether the request was allowed, whether an explicit deny matched, and the principal, action, resource and condition key values that were evaluated, which answers all three questions from the failure the developer already has. The policy simulator evaluates the policies it is shown and the request context typed into it, so it can miss the exact tags and condition values the script sent and needs manual setup. CloudTrail records the failed call with an errorCode and errorMessage, but for EC2 that message carries the same encoded blob rather than naming the denying statement. A DryRun call only reports whether the request would have succeeded, returning UnauthorizedOperation again with the same encoded message.
-
Question 35
Correct IncorrectWhich template change meets these requirements?
Define an IsProd condition with Fn::Equals on EnvType, add Condition: IsProd to the topic and alarm, and pick the variables with Fn::If. Correct answer Your answerAdd a Mappings section keyed by EnvType with a CreatePager value of true or false, and read it with Fn::FindInMap on the topic and alarm. Correct answer Your answerAdd a Rules section with an assertion that EnvType equals prod for the topic and alarm, so that other environments skip those resources. Correct answer Your answerMove the topic and alarm into a nested stack and pass EnvType to it, so that the nested stack creates them only when the value is prod. Correct answer Your answerExplanation
A condition built with Fn::Equals on EnvType and attached to a resource through its Condition attribute makes CloudFormation create that resource only when the condition is true, and Fn::If on the same condition returns a Variables map containing PAGER_TOPIC_ARN with a Ref to the topic in prod and a map without it elsewhere, which is also the only safe way to reference a resource that may not exist. Mappings return values for properties but cannot decide whether a resource exists, so a CreatePager flag would still create the topic everywhere. A Rules assertion validates parameter values and fails the whole stack operation when it is false; it never skips resources. A nested stack adds a second template and would still need its own condition to skip the resources.
-
Question 36
Correct IncorrectWhich change fixes both problems with the least custom code?
Use the list_objects_v2 paginator to iterate every page, and call the table_exists waiter before writing to the table. Correct answer Your answerPass MaxKeys=500000 to list_objects_v2, and catch ResourceNotFoundException to retry PutItem with exponential backoff. Correct answer Your answerConfigure the clients with adaptive retry mode and max_attempts of 10 so that both calls are retried until they work. Correct answer Your answerCall list_objects instead of list_objects_v2, and poll describe_table in a loop until the reported TableStatus becomes ACTIVE. Correct answer Your answerExplanation
SDK paginators handle continuation tokens for any paginated operation, so iterating the list_objects_v2 paginator yields every page until all 380,000 keys are returned, and SDK waiters poll a describe call on a built-in schedule, so the table_exists waiter returns only when the table is ACTIVE and ready for writes. Both replace hand-rolled loops with tested SDK code. MaxKeys is capped at 1,000 per call, so a larger value still returns one page, and retrying PutItem on errors is the same sleep loop in a different form. Adaptive retry mode retries throttling and transient errors, but it never fetches the next page of a listing, and ResourceNotFoundException is not a retryable error. The older list_objects call also returns at most 1,000 keys per page, and polling describe_table by hand recreates exactly what the waiter already does.
-
Question 37
Correct IncorrectWhich solution meets these requirements with the least custom code?
Map Cognito groups to IAM roles through an identity pool, and grant each role IAM permissions for the API Gateway methods that the members of its group may call. Correct answer Your answerStore the rules as a JSON document in AWS AppConfig, and write a shared Lambda layer that evaluates the rules against the user and document of each request. Correct answer Your answerMove the if statements into one API Gateway Lambda authorizer that loads the metadata of each document and returns an IAM policy that allows or denies the method. Correct answer Your answerWrite the rules as Cedar policies in a Verified Permissions policy store, and have each function call IsAuthorized with the principal, action and resource. Correct answer Your answerExplanation
Amazon Verified Permissions stores fine-grained rules as Cedar policies in a policy store, evaluates them with one IsAuthorized call per request, using entity attributes such as practice group and context such as engagement dates, and lets the team change and test policies without touching function code. IAM roles mapped from Cognito groups can allow or deny API methods, but they cannot express rules about individual documents, practice groups or engagement dates, because those are application records rather than AWS resources. An AppConfig document with a shared evaluator layer centralizes the data but means writing and maintaining a policy engine. A single Lambda authorizer moves the if statements to one place, yet the rules are still code that must be redeployed to change, and it has to fetch document metadata for every method call.
-
Question 38
Correct IncorrectWhich stage logging change produces the required log lines with the least ongoing processing?
Lower execution logging on the prod stage to the ERROR level, so that API Gateway writes only one summary line for each request that it handles. Correct answer Your answerEnable full request and response data logging alongside execution logging, so that every log entry carries the complete request and response. Correct answer Your answerEnable detailed CloudWatch metrics on the prod stage, so that latency, status and caller details are published separately for every method. Correct answer Your answerEnable access logging on the prod stage with a JSON format built from $context variables, such as $context.requestId and $context.status. Correct answer Your answerExplanation
Access logging writes one line per request in a format the team defines, so a JSON template with $context.requestId, $context.identity.sourceIp, $context.status, $context.integrationLatency and $context.authorizer.principalId produces exactly the structured record the pipeline needs. Lowering execution logging to ERROR keeps the same unstructured, API Gateway-defined lines and drops every successful request, so most requests leave no record at all. Full request and response data logging adds bodies and headers to the execution logs, making them larger, noisier and more sensitive without making them structured. Detailed CloudWatch metrics publish aggregated counts and latencies per method, not a record per request, and they never carry a source IP or principal ID.
-
Question 39
Correct IncorrectWhich command should the build stage run?
sam validate, which confirms that the file is a well-formed AWS SAM template without applying any additional linting rules. Correct answer Your answersam validate --lint, which runs cfn-lint on the template and checks resource property names, allowed values and attribute references. Correct answer Your answeraws cloudformation validate-template, which sends the template to CloudFormation and checks its syntax ahead of a deployment. Correct answer Your answersam build, which resolves each function's CodeUri and dependencies and stops when it finds a resource it cannot build. Correct answer Your answerExplanation
The --lint flag makes sam validate run cfn-lint, which checks every resource against the CloudFormation resource specification, so it reports the misspelled VisibilityTimout property, the ON_DEMAND value outside BillingMode's allowed values of PAY_PER_REQUEST and PROVISIONED, and the Fn::GetAtt to an attribute the resource type does not expose, all locally in seconds. Plain sam validate checks only that the file is a valid AWS SAM template that the SAM transform can process, so property-level errors on standard CloudFormation resources pass. aws cloudformation validate-template checks that the template is valid JSON or YAML with a correct overall structure, not that property names and values are right. sam build packages function code and dependencies and does not inspect resource properties.
-
Question 40
Correct IncorrectWhich two actions make the uploads succeed and stop the charges for the leftover data? (Select TWO.)
Enable S3 Transfer Acceleration on the bucket so that the large PutObject calls complete within the size limit. Correct answer Your answerUpload each file with multipart upload, for example through the SDK transfer manager with parallel part uploads. Correct answer Your answerEnable S3 Versioning on the bucket so that an interrupted upload can resume from the last saved object version. Correct answer Your answerAdd a lifecycle rule with AbortIncompleteMultipartUpload so that unfinished uploads are removed after a few days. Correct answer Your answerMove the bucket's objects to the S3 Intelligent-Tiering storage class so that the unlisted data shifts to a cheaper tier. Correct answer Your answerExplanation
A single PutObject request is limited to 5 GB, while multipart upload splits a file into parts that upload in parallel, can be retried individually, and are assembled into one object by CompleteMultipartUpload, which is what the SDK transfer manager does automatically above a size threshold. Parts of uploads that were never completed or aborted are stored and billed but do not appear in object listings, and a lifecycle rule with AbortIncompleteMultipartUpload deletes them a set number of days after initiation, now and for future crashes. Transfer Acceleration speeds long-distance transfers through edge locations but does not raise the single-request size limit. Versioning keeps prior versions of completed objects and has no effect on incomplete uploads. Intelligent-Tiering applies to stored objects, and orphaned parts are not objects it can move.
-
Question 41
Correct IncorrectWhich two actions enforce client certificate authentication on every request?
Upload a PEM truststore holding the private CA certificate chain to an S3 bucket, and enable mutual TLS on the custom domain with that truststore URI. Correct answer Your answerGenerate a client certificate for the API stage in API Gateway, and give each bank its PEM-encoded certificate to present when it sends requests to the API. Correct answer Your answerAdd a Lambda authorizer that reads the certificate from a custom request header and rejects any request whose certificate the private CA did not issue. Correct answer Your answerDisable the default execute-api endpoint of the API, so that banks cannot reach it through a hostname that does not ask for a client certificate. Correct answer Your answerConvert the custom domain name to an edge-optimized endpoint, so that CloudFront validates each client certificate at the edge location nearest the bank. Correct answer Your answerExplanation
API Gateway enforces mutual TLS on a Regional custom domain name that uses TLS 1.2, validating each client certificate during the handshake against a PEM truststore stored in Amazon S3, so the truststore with the private CA chain is the core step. Mutual TLS applies only to the custom domain, however, and the default execute-api hostname still accepts requests without a certificate, so disabling it closes the bypass. A stage client certificate is the certificate API Gateway presents to the backend integration, the opposite direction, and it authenticates nothing about the banks. A Lambda authorizer reading a certificate from a header proves nothing, because a header can carry any certificate without the private key that a TLS handshake requires. Edge-optimized custom domains do not support mutual TLS, so the change would remove the capability instead of adding it.
-
Question 42
Correct IncorrectWhich change handles the spikes with the least ongoing capacity management?
Switch match-telemetry to on-demand capacity mode so that Kinesis scales shard capacity from observed traffic. Correct answer Your answerStay in provisioned mode and raise the stream to 25 shards so that every spike fits within provisioned capacity. Correct answer Your answerRegister the consumers for enhanced fan-out so that each receives its own dedicated read throughput per shard. Correct answer Your answerChange the partition key to a constant game ID so that producers can batch more records per PutRecords call. Correct answer Your answerExplanation
On-demand capacity mode is designed for unpredictable traffic: Kinesis manages the shards, accommodates up to double the peak write throughput seen in the previous 30 days and scales automatically within those bounds, and charges for data written and read rather than for provisioned shards, so no scaling jobs are needed. It does not promise zero throttling: a spike that more than doubles the prior peak within 15 minutes can still be throttled while capacity grows, so producers should keep retrying throttled writes. Provisioning 25 shards would cover the spikes but pays for idle shards most of the week and still leaves the team adjusting the count by hand as the game grows. Enhanced fan-out adds dedicated read throughput for consumers, while the errors here are on the write side. A constant partition key sends every record to a single shard, creating a hot shard and making throttling far worse.
-
Question 43
Correct IncorrectWhich two actions should the developer take to meet these requirements with the least operational overhead?
Generate an API Gateway client certificate for the v1 stage and give it to the DNS team as the TLS certificate for the custom name. Correct answer Your answerCreate a CloudFront distribution with the name as an alternate domain and the execute-api endpoint plus the v1 path as its origin. Correct answer Your answerAdd a claims resource to the API with an HTTP proxy integration and redeploy the stage, so the path exists inside the API itself. Correct answer Your answerRequest a public ACM certificate for the name in eu-west-1 and create a Regional custom domain name in API Gateway that uses it. Correct answer Your answerCreate an API mapping on the custom domain name that maps the base path claims to the v1 stage of the claims-api REST API. Correct answer Your answerExplanation
A Regional custom domain name needs an ACM certificate in the same Region as the API, so a DNS-validated certificate in eu-west-1 lets API Gateway serve the partner hostname and hand the DNS team a target domain name for the alias record, and an API mapping routes the claims base path to the v1 stage, so the backend can later be remapped without partners noticing. A client certificate is what API Gateway presents to a backend so the backend can verify the caller; it cannot serve TLS for a custom hostname. A self-managed CloudFront distribution could front the API, but it needs a certificate in us-east-1, cache and origin settings and path handling, which is more to operate. Adding a claims resource changes the API's routes, not the hostname partners call.
-
Question 44
Correct IncorrectWhat should the developer do to serve the domain over HTTPS with automatic certificate renewal?
Upload the certificate and its private key to the IAM certificate store under the /cloudfront/ path, and select it as the custom certificate on the distribution. Correct answer Your answerAttach the eu-west-1 certificate to an Application Load Balancer origin, and add the alternate domain name to the distribution with its default CloudFront certificate. Correct answer Your answerRequest a public certificate for media.wanderly.example in ACM in the us-east-1 Region, validate it with DNS records, and select it as the custom SSL certificate on the distribution. Correct answer Your answerGrant the CloudFront service principal access to the certificate with an ACM resource policy, so that the distribution can use certificates from eu-west-1. Correct answer Your answerExplanation
CloudFront is a global service that reads ACM certificates only from US East (N. Virginia), so the certificate must be requested or imported in us-east-1; a DNS-validated ACM certificate there renews automatically as long as its validation record stays in place. The IAM certificate store does work with CloudFront, but it needs the private key, which ACM does not release for this certificate, and certificates in IAM never renew automatically. A certificate on a load balancer origin secures only the connection from CloudFront to the origin, and CloudFront refuses an alternate domain name unless the distribution has a certificate that covers it. ACM offers no resource policy that lets CloudFront read certificates from another Region, so the eu-west-1 certificate can never appear in the distribution settings.
-
Question 45
Correct IncorrectWhich change makes the worker's spans join the producer's traces?
Raise the X-Ray sampling rule for the worker service to 100 percent, so that every message the worker processes is recorded in a trace. Correct answer Your answerRecord the producer's trace ID as an indexed annotation on each worker span, so a filter expression returns both traces for a request. Correct answer Your answerRequest the AWSTraceHeader system attribute in ReceiveMessage, extract it with the ADOT X-Ray propagator and make it the parent of the worker span. Correct answer Your answerCreate an X-Ray group whose filter expression matches both services, so the producer's and the worker's segments are displayed together. Correct answer Your answerExplanation
ReceiveMessage returns message system attributes only when they are requested, so the worker must ask for AWSTraceHeader, pass its value through the AWS X-Ray propagator to rebuild the producer's trace context, and start the processing span with that context as its parent, after which the spans carry the producer's trace ID; only Lambda consumers get this propagation automatically. A 100 percent sampling rule records more worker traces, but each still starts with a new trace ID because no context is read from the message. An annotation holding the producer's trace ID makes the two traces findable together with a filter expression, yet they remain two traces. An X-Ray group filters which traces appear in its view and in its metrics; it does not merge segments from different traces.
-
Question 46
Correct IncorrectWhich approach replaces the function with the least custom code?
Route OrderPacked events to an Amazon SNS topic that has the partner webhook subscribed as an HTTPS endpoint. Correct answer Your answerTarget a Step Functions Express workflow whose HTTP Task calls the partner webhook with the partner credentials. Correct answer Your answerTarget an API destination that uses an OAuth client-credentials connection and an invocation rate limit of 20. Correct answer Your answerTarget an SQS queue drained by a Lambda function with reserved concurrency of 20 that posts each event onward. Correct answer Your answerExplanation
An EventBridge API destination is a rule target for an HTTP endpoint: its connection handles authorization, including OAuth client credentials, by obtaining and refreshing the token and storing secrets in AWS Secrets Manager, and the API destination's invocation rate limit holds delivery at 20 requests per second while EventBridge retries failures and can send exhausted events to a dead-letter queue. No function code remains. An SNS HTTPS subscription can throttle delivery, but it cannot obtain or attach an OAuth client-credentials token. A Step Functions HTTP Task can authenticate through an EventBridge connection, but it adds a workflow per event and has no invocation rate limit, so bursts still exceed what the partner accepts. A queue drained by a capped function keeps all of the token, posting and retry code the team wants to remove, and concurrency does not translate into a requests-per-second limit.
-
Question 47
Correct IncorrectWhich endpoint type best fits these clients?
Edge-optimized, because routing every request through the nearest CloudFront point of presence gives the lowest latency for any client. Correct answer Your answerRegional, because the clients are concentrated in the same geography as the Region and can reach it directly without a CloudFront hop. Correct answer Your answerPrivate, because the gateways form a closed device fleet and a private endpoint keeps the API off the public internet for them. Correct answer Your answerEdge-optimized with stage caching turned on, because cached responses served from edge locations remove the extra network hop. Correct answer Your answerExplanation
A Regional endpoint is meant for clients in or near the API's Region: requests go straight to eu-central-1 without the AWS-managed CloudFront distribution, which removes the extra hop for a client base concentrated in one country. Edge-optimized endpoints help geographically dispersed clients by carrying their traffic over the AWS network from the nearest point of presence; for clients already next to the Region, that detour adds latency rather than removing it. A private endpoint is reachable only from a VPC through an interface VPC endpoint, so home gateways on consumer internet connections could not call it at all. Stage caching stores responses in the API's Region, not at edge locations, so it cannot remove the CloudFront hop and suits read traffic rather than writes of new readings.
-
Question 48
Correct IncorrectWhich change cuts the KMS request volume with the fewest application changes?
Change the default encryption of the bucket to SSE-S3, which encrypts objects with keys that Amazon S3 manages and so makes no KMS requests at all. Correct answer Your answerRequest an increase to the KMS cryptographic request quota for the Region, so that the uploads stop being throttled during the peak hours of the day. Correct answer Your answerEnable S3 Bucket Keys in the default encryption settings of the bucket, so that S3 uses a bucket-level key from KMS to generate data keys for new objects. Correct answer Your answerChange the default encryption of the bucket to DSSE-KMS with the same customer managed key, which applies two independent layers of encryption to each object. Correct answer Your answerExplanation
With S3 Bucket Keys enabled, S3 obtains a short-lived bucket-level key from KMS and uses it to create the data keys for many objects, which AWS says can cut KMS request traffic and cost by up to 99 percent while the customer managed key and its key policy stay in charge; it is a bucket setting, so the uploading code does not change, and it applies to objects written after it is enabled. SSE-S3 removes the KMS requests by removing the customer managed key, which the security team has ruled out. A quota increase can stop the throttling, but every object would still cost a KMS request, so the bill would keep growing. DSSE-KMS performs more cryptographic work per object, and it does not support S3 Bucket Keys, so it would raise KMS usage rather than reduce it.
-
Question 49
Correct IncorrectWhich option provides the endpoint with the least operational overhead?
Create an Amazon API Gateway REST API with a Lambda proxy integration and AWS_IAM authorization on the POST method. Correct answer Your answerCreate a function URL with the NONE auth type and have the function compare a shared secret sent in a header. Correct answer Your answerCreate a function URL with the AWS_IAM auth type, and grant the callers' task roles both Lambda invoke actions. Correct answer Your answerRegister the function as the target of an internal Application Load Balancer that has an HTTPS listener. Correct answer Your answerExplanation
A Lambda function URL is a dedicated HTTPS endpoint built into the function, and with the AWS_IAM auth type Lambda rejects any request that is not SigV4-signed by a principal with permission. For callers in the same account, granting lambda:InvokeFunctionUrl and lambda:InvokeFunction in the task roles' identity policies is enough (function URLs created since October 2025 require both actions), so there is nothing else to deploy. An API Gateway REST API with IAM authorization also works, but it adds an API, stages and deployments that provide features the team said it does not need. A NONE function URL accepts requests from anyone who has the URL, and a hand-checked shared secret has to be stored, rotated and compared in code. An internal load balancer needs a VPC, a certificate and hourly charges, and it performs no IAM authentication.
-
Question 50
Correct IncorrectWhich two actions meet these requirements? (Select TWO.)
Set the log format in the function's logging configuration to JSON on both the staging and the production functions. Correct answer Your answerAdd an environment variable named LOG_LEVEL with the value WARN to the production function and DEBUG to the staging function. Correct answer Your answerSet the application log level in the logging configuration to WARN on production and to DEBUG on the staging function. Correct answer Your answerSet the system log level in the logging configuration to WARN on production and to DEBUG on the staging function. Correct answer Your answerAdd a subscription filter to the production log group whose filter pattern matches only WARN and ERROR log events. Correct answer Your answerExplanation
Lambda advanced logging controls let the function configuration set the log format to JSON, which makes the Python runtime emit each logging call as a JSON object with level, message and request ID fields, and set an application log level, which Lambda enforces on supported runtime loggers without code changes; log-level filtering requires the JSON format, so both settings are needed. An environment variable named LOG_LEVEL does nothing unless code or a library reads it, and this handler reads nothing. The system log level filters the platform records Lambda itself writes, such as START and REPORT, and leaves application logs untouched. A subscription filter forwards matching events to a destination such as Kinesis or Lambda, while the log group still ingests and stores every DEBUG and INFO line.
-
Question 51
Correct IncorrectWhich deployment configuration meets the capacity requirement and finishes fastest?
CodeDeployDefault.HalfAtATime, which deploys to up to half of the instances at a time while the other half keep serving. Correct answer Your answerCodeDeployDefault.AllAtOnce with load balancing enabled, so the instances are deregistered and updated together in one pass. Correct answer Your answerA custom deployment configuration with a minimum healthy hosts value of 75 percent of the fleet, which is 9 of the 12 instances. Correct answer Your answerA custom deployment configuration with a minimum healthy hosts value of 25 percent, so that a quarter of the fleet updates at a time. Correct answer Your answerExplanation
Minimum healthy hosts is the number of instances that must stay available, and CodeDeploy deploys to as many instances at once as that floor allows, so 75 percent of 12 keeps 9 serving and updates up to 3 at a time, about four times faster than one at a time. HalfAtATime keeps only 50 percent healthy, so 6 instances could be out of service together, which breaks the 9-instance floor. AllAtOnce tries to update every instance in one pass, which can leave no instance serving behind the load balancer. A minimum healthy hosts value of 25 percent does not mean deploying to a quarter at a time; it lets CodeDeploy take up to 9 instances out of service together, leaving only 3 serving. OneAtATime meets the floor but is the slowest option.
-
Question 52
Correct IncorrectWhich change lets exports of these sizes start downloading quickly with the fewest architecture changes?
Set the function URL invoke mode to RESPONSE_STREAM and write each page of rows to the response stream as it is read. Correct answer Your answerRaise the function memory to 10,240 MB so that it can assemble and return the complete 40 MB response much more quickly. Correct answer Your answerGzip the finished CSV in memory before returning it so that the compressed body fits in the buffered response. Correct answer Your answerPut an Amazon CloudFront distribution in front of the function URL so that CloudFront caches every export. Correct answer Your answerExplanation
Response streaming lets a function send its payload as it is produced: with the function URL invoke mode set to RESPONSE_STREAM and the handler wrapped in streamifyResponse on the Node.js managed runtime, each page of rows reaches the client immediately, improving time to first byte, and streamed responses can be up to 200 MB instead of the 6 MB buffered limit. After the first 6 MB, which streams without a bandwidth cap, the rate is capped at 2 MBps, so the first bytes arrive quickly while a 40 MB export still takes several more seconds to finish downloading. More memory adds CPU, but a buffered response is still limited to 6 MB, so 40 MB exports keep failing and users still wait for the whole file. Compressing the finished file still waits for the entire export and cannot guarantee that a large CSV shrinks below 6 MB. CloudFront caching helps only identical repeat requests, and each export is unique and still subject to the function's payload limit.
-
Question 53
Correct IncorrectWhich approach meets these requirements?
Create an HMAC KMS key, generate a tag for each document with GenerateMac, and give the brokers the key ID so that their systems can check each tag with VerifyMac. Correct answer Your answerCreate an asymmetric KMS signing key, sign each document digest with the Sign API, and give the brokers the public key from GetPublicKey to verify offline. Correct answer Your answerCreate a symmetric KMS key, encrypt the hash of each document with the Encrypt API, and have the brokers decrypt the hash with the key and compare it to their own hash. Correct answer Your answerCreate an asymmetric KMS key for signing, sign each document with the Sign API, and have the brokers call the Verify API through a cross-account grant on the key. Correct answer Your answerExplanation
An asymmetric KMS key with the SIGN_VERIFY key usage keeps its private key inside the KMS hardware security modules, the Lambda function calls Sign on a digest of each document, and anyone holding the public key returned by GetPublicKey can verify the signature with standard cryptographic libraries and no AWS access. An HMAC key is symmetric and cannot be exported, so checking a tag requires calling VerifyMac in KMS, which brokers without AWS accounts or connectivity cannot do. Encrypting a hash with a symmetric key is not a signature scheme, and decrypting it would again require KMS access and the right to decrypt. Having brokers call Verify requires AWS credentials, network access and a grant, all of which they lack, even though the signing side of that design is correct.
-
Question 54
Correct IncorrectWhich two actions cut cold-start latency while keeping booking references unique and connections usable? (Select TWO.)
Turn on SnapStart, publish a version, and point API Gateway at an alias for that version instead of the bare ARN. Correct answer Your answerTurn on SnapStart for $LATEST so that API Gateway can keep invoking the unqualified ARN without any change. Correct answer Your answerAdd provisioned concurrency to the alias alongside SnapStart so that restored environments also stay warm. Correct answer Your answerMove the generator seeding and the connection pool into a static initializer block so that both are captured in the snapshot. Correct answer Your answerRegister CRaC runtime hooks that reseed the generator and re-create the connection pool in afterRestore. Correct answer Your answerExplanation
SnapStart initializes the function when a version is published, snapshots the initialized execution environment, and resumes new environments from that snapshot, cutting framework start-up from seconds to as low as sub-second at no extra cost on Java runtimes; it works only on published versions and aliases that point to them. Because every environment resumes from the same memory, state created during initialization is shared, so an afterRestore runtime hook (the CRaC interface on Java) must reseed the generator and rebuild the connection pool after each restore. SnapStart cannot be enabled on $LATEST, so the unqualified ARN would get no benefit. SnapStart does not support provisioned concurrency. Moving the seeding and pool into static initialization puts them into the snapshot, which is exactly what makes references repeat across environments and connections go stale.
-
Question 55
Correct IncorrectWhich pipeline setting ensures that every revision is deployed, one at a time, in the order it was merged?
Set the execution mode to QUEUED, so waiting executions line up at each locked stage and run in order without overtaking. Correct answer Your answerSet the execution mode to PARALLEL, so every execution runs through all stages independently and none is superseded. Correct answer Your answerKeep SUPERSEDED mode and disable the inbound transition to the deploy stage until each running deployment has finished. Correct answer Your answerKeep SUPERSEDED mode and move the manual approval into its own stage, so every revision waits for approval before deploying. Correct answer Your answerExplanation
In QUEUED mode, available on V2 pipelines, a stage still processes one execution at a time, but waiting executions form a queue in arrival order and never overtake one that started earlier, so every revision and its migration is deployed in sequence. PARALLEL mode runs executions independently and at the same time, so two migrations could hit the same database concurrently and finish out of order. In SUPERSEDED mode, an execution waiting at a disabled transition can still be superseded by a newer one, so disabling the transition skips revisions in the same way. Moving the approval into its own stage only adds another place where executions wait between stages, and waiting executions in SUPERSEDED mode are exactly the ones a newer run replaces.
-
Question 56
Correct IncorrectWhich change reduces the KMS requests within those limits with the least code?
Request a higher KMS request quota for GenerateDataKey in the Region, so that each record can keep using its own data key without being throttled. Correct answer Your answerConfigure the AWS SDK client used by the keyring with the adaptive retry mode and more attempts, so that throttled GenerateDataKey requests succeed on retry. Correct answer Your answerEnable data key caching in the Encryption SDK with a local cache, and set a maximum age of 5 minutes and a maximum of 10,000 messages for each data key. Correct answer Your answerGenerate one data key when the function is deployed, store its plaintext in an encrypted environment variable, and encrypt every record with it using AES-GCM. Correct answer Your answerExplanation
In the AWS Encryption SDK for JavaScript, data key caching wraps the KMS keyring in a NodeCachingMaterialsManager backed by a local cache, which reuses data keys within the maxAge and maxMessagesEncrypted thresholds set on it, so a 5-minute maximum age and a 10,000-message limit turn thousands of GenerateDataKey calls a second into a handful while the SDK still handles the envelope format. A quota increase removes the throttling but keeps one paid request per record, so the cost problem stays. Adaptive retries slow the function down until requests succeed; they do not remove any request, and at sustained peak load they add latency. A single data key generated at deployment has no age or message limit, sits in plaintext in the function configuration, and replaces the SDK with hand-written AES-GCM code, which breaks the agreed limits and adds custom cryptography.
-
Question 57
Correct IncorrectHow much concurrency will geo-lookup need at the peak, and what must the team do before the campaign to avoid throttling?
About 2,500 concurrent executions, one per request arriving each second; request a quota increase to at least 3,000 and reserve 2,500 for geo-lookup. Correct answer Your answerAbout 1,000 concurrent executions, which with the other functions exceeds the 1,000 quota; raise the quota, then reserve for geo-lookup. Correct answer Your answerAbout 400 concurrent executions, since each takes 400 ms; this fits in the current quota, so reserving 400 for geo-lookup prevents throttling. Correct answer Your answerAbout 6,250 concurrent executions, from 2,500 divided by 0.4 seconds; configure provisioned concurrency of 6,250 on the function alias instead. Correct answer Your answerExplanation
Required concurrency is the request rate multiplied by the average duration in seconds, so 2,500 requests per second times 0.4 seconds is about 1,000 concurrent executions; added to the 150 the other functions use, that exceeds the default quota of 1,000, so the team must raise the quota first, and only then can reserved concurrency set aside capacity for geo-lookup while leaving the required 100 unreserved. Treating requests per second as concurrency ignores that each execution environment finishes a 400 ms request and takes another, serving 2.5 requests each second. Equating the duration in milliseconds with concurrency has no basis in the arithmetic. Dividing the rate by the duration inverts the formula and would provision six times the needed environments at a large standing cost.
-
Question 58
Correct IncorrectWhich change reduces the read capacity consumed with the fewest code changes?
Move the date condition into the KeyConditionExpression as vehicleId = :v AND openedAt >= :since. Correct answer Your answerAdd a ProjectionExpression so that the Query returns only the attributes that the dashboard displays. Correct answer Your answerSet Limit to 50 so that DynamoDB stops reading as soon as it has found 50 matching work orders. Correct answer Your answerReplace the Query with a parallel Scan that keeps the same FilterExpression across four segments. Correct answer Your answerExplanation
A Query consumes read capacity for every item its key condition selects, and a FilterExpression is applied only afterward, so the current call reads and pays for 12 years of work orders and then discards most of them. Because openedAt is the sort key, a range condition on it belongs in the KeyConditionExpression, and DynamoDB then reads only the last 30 days of items for that vehicle. A ProjectionExpression trims the response, but capacity is still calculated on the full size of every item read. Limit caps the number of items evaluated before the filter runs, not the number of matches, so the dashboard would receive a partial page and need more calls. A Scan reads the entire table across every vehicle, which consumes far more capacity than even the current Query.
-
Question 59
Correct IncorrectHow should the team wire the smoke-test function into the deployment?
List it under the AfterAllowTraffic hook in the AppSpec file, and have it call PutLifecycleEventHookExecutionStatus with the test result. Correct answer Your answerList it under the ValidateService hook in the AppSpec file, and have it exit with a nonzero status when the synthetic order fails. Correct answer Your answerCreate a CloudWatch alarm on the smoke-test function's Errors metric and add it to the deployment group's alarm-based rollback list. Correct answer Your answerList it under the BeforeAllowTraffic hook in the AppSpec file, and have it call PutLifecycleEventHookExecutionStatus with the test result. Correct answer Your answerExplanation
In a Lambda AppSpec file, the BeforeAllowTraffic hook runs after the new version is published but before the alias sends it any traffic, and the hook function reports Succeeded or Failed with PutLifecycleEventHookExecutionStatus, so a Failed status stops the deployment while the alias still points entirely at the old version. AfterAllowTraffic runs only after all traffic has shifted, so customers would already have hit the broken version. ValidateService is a lifecycle event of EC2 and on-premises deployments that runs scripts on instances; it does not exist in a Lambda AppSpec, and a Lambda hook signals its result through the API rather than an exit code. An alarm on the smoke-test function's errors still acts only through alarm-based rollback, which reacts after traffic shifting has begun.
-
Question 60
Correct IncorrectHow should the developer rotate the signing key?
Enable automatic key rotation on the existing key with a rotation period of 365 days, so that KMS generates new key material each year under the same key ID. Correct answer Your answerCreate an EventBridge Scheduler schedule that calls RotateKeyOnDemand on the key every 12 months, so that the key material changes while the alias stays the same. Correct answer Your answerCreate a new asymmetric key, point the service configuration at its key ARN, and replace the old public key at the JWKS endpoint with the new one at the same moment. Correct answer Your answerCreate a new RSA_3072 signing key, publish its public key at the JWKS endpoint, then repoint the alias with UpdateAlias and keep the old public key published. Correct answer Your answerExplanation
Asymmetric KMS keys, like HMAC keys and keys in custom key stores, support neither automatic nor on-demand rotation, and a symmetric key with imported key material cannot auto-rotate either, so the documented method is manual rotation: create a new key of the same type and key usage, then repoint the alias with UpdateAlias, which the code already uses; publishing the new public key first and leaving the old one for at least 8 hours means every token in flight still verifies. Automatic rotation with a 365-day period can be enabled only on symmetric encryption keys with KMS-generated key material, so the request fails on this key. RotateKeyOnDemand is likewise limited to symmetric encryption keys and fails on an asymmetric one. Switching to a key ARN needs a configuration change and deployment, and removing the old public key at once makes every unexpired token signed with it fail verification for up to 8 hours.
-
Question 61
Correct IncorrectWhich design lists the flagged claims efficiently at the lowest cost?
Create a GSI with status as the partition key and flaggedAt as the sort key, keeping status on every item. Correct answer Your answerCreate a local secondary index with flaggedAt as its sort key, and query it with a FilterExpression on status. Correct answer Your answerEnable DynamoDB Streams and have a Lambda function copy flagged claims into a separate FlaggedClaims table. Correct answer Your answerWrite reviewQueue and flaggedAt attributes only on flagged claims, remove them on clearance, and index both in a GSI. Correct answer Your answerExplanation
DynamoDB writes an item into a global secondary index only when the item has the index key attributes, so adding reviewQueue and flaggedAt to flagged claims alone creates a sparse index holding just the 3,000 flagged items. A Query on the index with reviewQueue as partition key returns them sorted by flaggedAt, and deleting the attributes on clearance removes the claim from the index automatically. A GSI keyed on a status attribute present on every item replicates all 55 million claims, paying index storage and writes for every claim, with the CLEAR value forming one enormous partition. A local secondary index can only be created with the table and shares the claimId partition key, so it cannot list claims across the table. A stream-fed copy table works, but it adds a function, its error handling and a second table to keep consistent.
-
Question 62
Correct IncorrectWhich approach makes every release reach readers immediately while keeping a high cache hit ratio?
Publish content-hashed names such as app.3f9c2a.js with long cache lifetimes, and serve the index.html that references them with a short TTL. Correct answer Your answerKeep the file names and create a CloudFront invalidation for the path /* at the end of every deployment, so edge locations fetch the new files. Correct answer Your answerSet the default, minimum and maximum TTL to 0 seconds for the distribution, so every request is revalidated with the S3 origin before serving. Correct answer Your answerKeep the file names and reference them from index.html with a release query string, such as app.js?v=20261003, that changes on each deployment. Correct answer Your answerExplanation
A content-hashed file name is a new object to every cache, so CloudFront and browsers fetch it on first request and can keep each version for a year, while the small index.html that names the current files is the only object that needs a short TTL, giving instant releases and a high hit ratio. An invalidation of /* removes objects from CloudFront edge caches only; browsers still hold app.js under its one-day lifetime, and every deployment also discards the whole edge cache. A TTL of 0 makes CloudFront go back to S3 on every request, which collapses the hit ratio and adds latency for the static files. A release query string changes nothing at the edge here, because the cache policy leaves query strings out of the cache key, so CloudFront keeps serving the old object.
-
Question 63
Correct IncorrectWhat must the team do so that the functions use the fixed fonts?
Delete version 8 of the layer with delete-layer-version, so each function falls forward to the newest remaining version of pdf-fonts. Correct answer Your answerUpdate each function's $LATEST configuration to the version 9 layer ARN with update-function-configuration and leave the aliases. Correct answer Your answerUpdate each function's configuration to the version 9 layer ARN, then publish new function versions and move the live aliases to them. Correct answer Your answerChange each function's layer reference to the ARN without a version suffix, so that Lambda always resolves the latest version of pdf-fonts. Correct answer Your answerExplanation
Each layer version is immutable and has its own ARN, and a function configuration pins the exact version ARN it lists, so the functions must be updated to the version 9 ARN; because the aliases point to published versions, which freeze the layer list, the team must also publish new function versions and move the live aliases. Deleting version 8 only stops it from being added to new configurations, and functions that already use it keep working with their copy. Updating only $LATEST to the version 9 ARN fixes the unpublished configuration, but the live aliases still point at published versions whose layer list still names version 8, so production traffic keeps the bug. Lambda requires a versioned layer ARN in a function configuration, and there is no unversioned reference that resolves to the latest version automatically.
-
Question 64
Correct IncorrectWhich change meets these requirements with the least code?
Resolve the secret into an environment variable with a CloudFormation dynamic reference at deployment, and read the password from that variable in the handler. Correct answer Your answerAdd the AWS Parameters and Secrets Lambda Extension layer, and read the secret from its local HTTP endpoint on port 2773, which caches values for 300 seconds by default. Correct answer Your answerMove the GetSecretValue call into the initialization code outside the handler, so that each execution environment fetches the secret only once when it starts. Correct answer Your answerCache the secret in an Amazon ElastiCache for Redis cluster, and have the function read it from the cache and fall back to Secrets Manager on a cache miss. Correct answer Your answerExplanation
The AWS Parameters and Secrets Lambda Extension runs in the execution environment and serves secrets over a local HTTP endpoint on port 2773, authenticated with the X-Aws-Parameters-Secrets-Token header set from AWS_SESSION_TOKEN, and it caches each value for a default 300 seconds, so most invocations make no Secrets Manager call and a rotated password is picked up within 5 minutes. A dynamic reference resolves only when the stack deploys, stores the password in plaintext in the function configuration, and keeps the old value after rotation until the next deployment. Fetching the secret in initialization code calls Secrets Manager once per environment, but warm environments can live for hours and would keep using the old password after rotation. An ElastiCache cluster adds infrastructure and a network hop on every invocation, and it puts a copy of the secret in a second store to secure.
-
Question 65
Correct IncorrectWhich caching change keeps prices current after updates and stops unused records from piling up in the cache?
Keep lazy loading alone and add a 5-minute TTL so that a stale record is refreshed on the first miss after expiry. Correct answer Your answerAdd write-through so the admin service updates the cache when it writes the database, and set a TTL on every key. Correct answer Your answerReplace ElastiCache with DynamoDB Accelerator so that updates written to the database pass through the cache. Correct answer Your answerSwitch the cluster to Memcached on larger nodes so that the extra records no longer cause cache evictions. Correct answer Your answerExplanation
Write-through updates the cache in the same code path that writes the database, so a price change is visible to shoppers immediately, and keeping lazy loading for misses fills in anything not yet cached. Adding a TTL to every key bounds how long any entry can be stale if a write ever bypasses the cache, and lets records that are never read again, such as discontinued products, expire instead of accumulating. Lazy loading with a 5-minute TTL only shortens the stale window; shoppers can still see an old price for up to five minutes after every change. DynamoDB Accelerator is a write-through cache for DynamoDB tables only and cannot sit in front of an RDS for PostgreSQL database. Moving to Memcached on bigger nodes changes the engine and the capacity but neither the staleness nor the unbounded growth.