Tüm alıştırma soruları

1542 soru

Soru 1141Soru

A developer is setting up an AWS CodeBuild project that needs to pull dependency packages from a third-party private repository. The credentials for this repository must be rotated automatically every 30 days. The developer needs to configure the build environment to securely retrieve these credentials during the build process.

Which configuration should the developer implement to meet these requirements with the lowest operational overhead?

Cevabı ve açıklamayı göster

Cevap: Store the credentials in AWS Secrets Manager with automatic rotation. In the buildspec.yml file, reference the secret using the secrets-manager mapping under the env sequence.

Cevap

Store the credentials in AWS Secrets Manager with automatic rotation. In the buildspec.yml file, reference the secret using the secrets-manager mapping under the env sequence.
Storing the credentials in AWS Secrets Manager is the correct approach because it natively supports automatic rotation of secrets. Referencing the secret in the env/secrets-manager section of the buildspec.yml file allows CodeBuild to securely retrieve the credentials at build time without exposing them in plaintext.

Adım Adım Çözüm

1
Select the appropriate storage service for secrets requiring automatic rotation.
AWS Secrets Manager is chosen because it supports built-in automatic rotation using AWS Lambda, whereas Systems Manager Parameter Store does not.
Meeting the rotation requirement with the lowest operational overhead requires utilizing native service features.
2
Configure reference to the stored secret in the build definition.
Add the secret under the env/secrets-manager section of the buildspec.yml file.
This allows CodeBuild to fetch the credential dynamically at runtime, avoiding hardcoded values.
3
Ensure correct IAM permissions are attached to the CodeBuild service role.
Attach a policy with the secretsmanager:GetSecretValue permission to the CodeBuild execution role.
CodeBuild needs permission to retrieve the secret value from Secrets Manager during the build execution.

Anahtar Kavram

Secure credential retrieval and buildspec configuration in AWS CodeBuild
Tahmini Süre:2m 0s
Soru 1142Soru

A developer is attempting to deploy a new application stack using AWS CloudFormation for the first time. The stack creation fails during the creation of an Amazon S3 bucket due to a naming conflict, and the stack status changes to ROLLBACK_COMPLETE. Which two actions should the developer take to successfully deploy the stack with the corrected S3 bucket name?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Delete the CloudFormation stack that is in the ROLLBACK_COMPLETE state.; Update the bucket name in the CloudFormation template to a unique value and create a new stack.

Cevap

To resolve the issue, delete the failed stack in the ROLLBACK_COMPLETE state, update the bucket name in the CloudFormation template to a globally unique value, and create a new stack.
When a CloudFormation stack fails initial creation and enters the ROLLBACK_COMPLETE status, it cannot be updated. The developer must delete the failed stack. To resolve the root cause, which is a naming conflict for the S3 bucket (S3 requires globally unique bucket names across all AWS accounts), the developer must modify the bucket name in the template to be unique and create a new stack.

Adım Adım Çözüm

1
Check the CloudFormation console stack events to confirm the resource failure reason.
The events show that the S3 bucket creation failed because the bucket name is already occupied globally.
This identifies the root cause of the stack creation failure.
2
Delete the failed stack which is in the ROLLBACK_COMPLETE status.
The stack resources are cleaned up and the stack is removed.
AWS CloudFormation does not allow stack updates on stacks that failed during their initial creation.
3
Change the bucket name in the CloudFormation template to a unique string and create a new stack.
The template is successfully validated and the new stack is created without errors.
S3 buckets require globally unique names, and a new stack must be initiated since the previous one was deleted.

Anahtar Kavram

CloudFormation initial stack creation failure recovery and S3 naming requirements.
Tahmini Süre:1m 0s
Soru 1143Soru

A developer has deployed a Python web application on an Amazon EC2 instance. The developer wants to use AWS X-Ray to trace incoming HTTP requests and downstream AWS service calls. Which two actions must the developer take to instrument the application and successfully send trace data to X-Ray? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Install and run the AWS X-Ray daemon on the Amazon EC2 instance to collect and upload trace data.; Use the AWS X-Ray SDK to patch supported libraries in the Python code to record outgoing HTTP and AWS SDK calls.

Cevap

Install and run the AWS X-Ray daemon on the Amazon EC2 instance to collect and upload trace data, and use the AWS X-Ray SDK to patch supported libraries in the Python code to record outgoing HTTP and AWS SDK calls.
For an application hosted on an Amazon EC2 instance to use AWS X-Ray, the host must run the X-Ray daemon to collect and forward trace segment documents to the AWS X-Ray API. Additionally, the application code must use the AWS X-Ray SDK to patch outgoing libraries (such as boto3) to capture downstream context and API calls.

Adım Adım Çözüm

1
Deploy and execute the AWS X-Ray daemon on the EC2 instance.
The daemon starts running and listens on UDP port 2000 to collect trace data segments.
EC2 is an unmanaged hosting environment, so the X-Ray daemon must be manually run to aggregate and upload trace data.
2
Use the AWS X-Ray SDK in the Python code to patch libraries like boto3.
The SDK automatically intercepts outgoing calls and generates trace segments.
Explicit patching or instrumentation is required in Python code to automatically propagate tracking IDs and capture metadata for downstream dependencies.

Anahtar Kavram

To enable X-Ray tracing on Amazon EC2, the developer must manually install and run the X-Ray daemon and instrument the application code using the X-Ray SDK.
Soru 1144Soru

An engineering team is setting up a CI/CD pipeline using AWS CodeDeploy to deploy a Node.js web application to a fleet of Amazon EC2 instances. The deployment configuration must ensure that the application is fully running and able to handle traffic before the deployment is marked as successful. Additionally, CodeDeploy requires authorization to interact with EC2 auto-scaling groups and load balancers during the deployment process.

Which of the following configurations must be implemented to meet these requirements? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Configure an IAM service role for AWS CodeDeploy with a trust policy that allows the codedeploy.amazonaws.com service principal to assume the role.; Use the ValidateService lifecycle hook in the appspec.yml file to execute a script that checks the application's local health endpoint.

Cevap

Configure an IAM service role for AWS CodeDeploy with a trust policy that allows the codedeploy.amazonaws.com service principal to assume the role, and use the ValidateService lifecycle hook in the appspec.yml file to execute a script that checks the application's local health endpoint.
To allow AWS CodeDeploy to perform deployments on EC2/On-Premises instances, it needs a service role that trusts the 'codedeploy.amazonaws.com' service principal. This role grants the service permission to interact with other AWS services like EC2, Auto Scaling, and Elastic Load Balancing. To verify the service health post-deployment, the 'ValidateService' lifecycle hook in the EC2 AppSpec file must be used to run validation scripts before CodeDeploy marks the deployment as successful.

Adım Adım Çözüm

1
Determine the necessary IAM configuration for AWS CodeDeploy authorization.
Identify that AWS CodeDeploy must be configured with an IAM service role (not an EC2 instance profile) whose trust policy explicitly lists the 'codedeploy.amazonaws.com' service principal. This allows CodeDeploy to interact with EC2, Auto Scaling, and Elastic Load Balancing APIs.
Without this service role, CodeDeploy lacks the permissions to execute deployments across the target instances and infrastructure.
2
Map the correct AppSpec lifecycle hook for post-deployment verification on Amazon EC2.
Select the 'ValidateService' lifecycle hook inside the EC2 'appspec.yml' file to execute local verification scripts.
In EC2/On-Premises deployment groups, ValidateService is the proper hook for service validation, whereas hooks like BeforeAllowTraffic are restricted to ECS and Lambda deployment types.
3
Rule out incorrect trust policies and mismatched API permissions.
Discard modifications to the EC2 instance profile's trust policy (which must trust EC2, not CodeDeploy) and correct Systems Manager Parameter Store permissions (which require SSM API permissions rather than Secrets Manager permissions).
This isolates the correct configurations for service trust boundaries and parameter store access.

Anahtar Kavram

Configuring AWS CodeDeploy service roles and understanding EC2-specific AppSpec lifecycle hooks.
Tahmini Süre:2m 0s
Soru 1145Soru

A developer is troubleshooting an AWS Lambda function that performs real-time currency conversion for a financial auditing application. The function is configured to run inside a VPC and is associated with two private subnets. It must read transaction data from an Amazon Aurora MySQL database cluster in the same VPC and fetch the latest exchange rates from a public API endpoint over the internet. While the database queries succeed, all HTTP requests to the public exchange rate API fail with connection timeout errors. Which of the following actions should the developer take to resolve this connectivity issue?

Cevabı ve açıklamayı göster

Cevap: Deploy a NAT Gateway in a public subnet of the VPC, and add a route in the private subnets' route table directing outbound internet traffic (0.0.0.0/0) to the NAT Gateway.

Cevap

Deploy a NAT Gateway in a public subnet of the VPC, and add a route in the private subnets' route table directing outbound internet traffic (0.0.0.0/0) to the NAT Gateway.
The correct answer is to deploy a NAT Gateway in a public subnet and add a route in the private subnets' route table. Since Lambda functions inside a VPC only receive private IP addresses from the subnets they are associated with, they cannot communicate with the internet directly. By routing outbound traffic through a NAT Gateway in a public subnet, the Lambda function can securely access the public API.

Adım Adım Çözüm

1
Analyze the network configuration of the Lambda function.
The Lambda function is associated with private subnets in a VPC. It can access internal resources like the database but lacks internet connectivity.
Since Lambda functions do not receive public IP addresses, they cannot communicate directly with the internet even if associated with a public subnet.
2
Identify the resource needed to route private subnet traffic to the internet.
A NAT Gateway must be deployed in a public subnet of the VPC.
A NAT Gateway translates private IP addresses to a public IP to enable outbound internet connectivity for private resources.
3
Configure routing for the private subnets.
Add a route for 0.0.0.0/0 pointing to the NAT Gateway in the private subnets' route table.
This directs all non-VPC internet-bound traffic from the private subnets through the NAT Gateway.

Anahtar Kavram

VPC Networking for AWS Lambda Functions
Tahmini Süre:2m 0s
Soru 1146Soru

A developer is troubleshooting an AWS Lambda function that processes large CSV data exports uploaded to an Amazon S3 bucket. The function is currently configured with 256 MB256\text{ MB} of memory and a timeout of 10 seconds10\text{ seconds}. During initial testing with small files, the function executes successfully. However, when processing larger files, the function consistently fails, and Amazon CloudWatch Logs show a `Task timed out after 10.00 seconds` error. Which action should the developer take to resolve this execution timeout issue?

Cevabı ve açıklamayı göster

Cevap: Increase the Lambda function's timeout configuration to allow more execution time, and allocate more memory to proportionally scale the CPU performance.

Cevap

Increase the Lambda function's timeout configuration to allow more execution time, and allocate more memory to proportionally scale the CPU performance.
The correct action is to increase the Lambda function's timeout setting and allocate additional memory. Increasing the timeout directly extends the allowed run time of the function. Additionally, since AWS Lambda allocates CPU power proportionally to the configured memory size, increasing the memory allocation will speed up CPU-bound tasks like file parsing, preventing the function from timing out.

Adım Adım Çözüm

1
Analyze the error message from CloudWatch Logs.
The log message `Task timed out after 10.00 seconds` indicates the function is hitting its configured execution time limit before completing the CSV processing.
Identifying the root cause as a timeout configuration limit is necessary before selecting the correct remediation strategy.
2
Evaluate the resource demands of the processing logic.
Processing larger files requires both more time and more compute power. In AWS Lambda, CPU performance scales proportionally with the allocated memory.
Understanding that increasing memory provides more CPU resources helps optimize processing speed for CPU-bound tasks like parsing CSV files.
3
Adjust the Lambda configuration settings.
Increasing the timeout limit beyond 10 seconds10\text{ seconds} and increasing the memory configuration beyond 256 MB256\text{ MB} allows the function to complete successfully.
This dual adjustment ensures the execution environment has both the raw computing power and the time limit necessary to handle larger payloads.

Anahtar Kavram

AWS Lambda resource allocation and execution limits
Tahmini Süre:1m 30s
Soru 1147Soru

A developer is configuring an AWS CodePipeline with an AWS CodeDeploy stage to deploy a containerized application to an Amazon ECS service using a blue/green deployment strategy. The deployment fails. The developer observes two issues:
1. The CodeDeploy deployment fails immediately with an error indicating an invalid AppSpec file configuration, where the developer specified `BeforeInstall` and `AfterInstall` lifecycle hooks.
2. The ECS tasks fail to start because they cannot download the application configuration file from an Amazon S3 bucket, despite the developer having attached the S3 read permissions to the ECS Task Execution Role.

Which two actions should the developer take to resolve these deployment issues? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Replace the `BeforeInstall` and `AfterInstall` lifecycle hooks in the AppSpec file with `BeforeAllowTraffic` and `AfterAllowTraffic` hooks.; Move the S3 read permission policy from the ECS Task Execution Role to the ECS Task Role.

Cevap

Replace the `BeforeInstall` and `AfterInstall` hooks with `BeforeAllowTraffic` and `AfterAllowTraffic`, and move the S3 read permission policy from the ECS Task Execution Role to the ECS Task Role.
The correct options modify the AppSpec hooks to use ECS-supported lifecycle hooks (`BeforeAllowTraffic` and `AfterAllowTraffic`) and assign S3 read permissions to the ECS Task Role, which is the role that containerized applications use to access AWS resources.

Adım Adım Çözüm

1
Analyze the AppSpec lifecycle hook failure.
Identify that `BeforeInstall` and `AfterInstall` hooks are specific to EC2/On-Premises CodeDeploy deployments.
ECS deployments use specific hooks like `BeforeAllowTraffic` and `AfterAllowTraffic` for running lifecycle validation Lambda functions.
2
Analyze the Amazon S3 access failure from within the ECS tasks.
Determine that the application running inside the container needs permissions to access S3.
Permissions for containerized applications must be attached to the ECS Task Role, whereas the ECS Task Execution Role is for container agent operations like pulling images from ECR.
3
Select the correct combination of fixes.
The option to use ECS-supported hooks and the option to use the correct Task Role for S3 access are selected.
These steps address the invalid AppSpec structure and the permission mismatch.

Anahtar Kavram

Understanding ECS Task Roles vs Task Execution Roles, and ECS-specific CodeDeploy AppSpec lifecycle hooks.
Soru 1148Soru

An application deployed on Amazon EC2 instances streams its log files to an Amazon CloudWatch Logs log group named `/aws/ec2/app-logs` using the Unified CloudWatch Agent. The application logs are structured as JSON objects, with the following format:

{
"timestamp": "2026-07-14T10:00:00Z",
"status": "FAIL",
"errorCode": 401,
"latency_ms": 150
}

A developer needs to configure a CloudWatch metric filter to track the number of failed login attempts where the `status` is `"FAIL"` and the `errorCode` is `401`. Additionally, the developer needs to run a CloudWatch Logs Insights query to find the 90th percentile of `latency_ms` for these specific failed login events, grouped into 15-minute intervals over the last 24 hours.

Which two options should the developer use to accomplish these tasks? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: A CloudWatch metric filter with the pattern `{ .status = "FAIL" && .errorCode = 401 }` to track the occurrences of failed logins; A CloudWatch Logs Insights query:

fields @timestamp, latency_ms
| filter status = "FAIL" and errorCode = 401
| stats pct(latency_ms, 90) by bin(15m)

Cevap

The correct configurations are the metric filter with the pattern `{ .status = "FAIL" && .errorCode = 401 }` and the CloudWatch Logs Insights query that uses the `pct(latency_ms, 90)` function grouped `by bin(15m)`.
The correct metric filter configuration uses the correct JSON filter syntax `{ .status = "FAIL" && .errorCode = 401 }` to inspect JSON log properties. The correct CloudWatch Logs Insights query filters for the failed status and error code, then uses the `pct()` function to find the 90th percentile of latency grouped in 15-minute intervals using `by bin(15m)`.

Adım Adım Çözüm

1
Analyze the JSON log format to identify the property names: status, errorCode, and latency_ms.
Identified the target JSON paths as .status,.status, .errorCode, and $.latency_ms.
Metric filters for JSON logs require referencing properties using the $. notation.
2
Construct the CloudWatch Logs metric filter pattern to match failed logins.
Created the pattern `{ .status = "FAIL" && .errorCode = 401 }`.
JSON metric filters must be enclosed in curly braces and use comparison/logical operators to evaluate JSON properties.
3
Construct the CloudWatch Logs Insights query to calculate the 90th percentile of latency grouped by 15-minute intervals.
Created the query `fields @timestamp, latency_ms | filter status = "FAIL" and errorCode = 401 | stats pct(latency_ms, 90) by bin(15m)`.
CloudWatch Logs Insights queries use the pct() or percentiles() function to calculate percentiles and by bin() for grouping time intervals.

Anahtar Kavram

CloudWatch Logs Metric Filter syntax for structured JSON logs and CloudWatch Logs Insights query syntax for calculating percentiles.
Tahmini Süre:2m 0s
Soru 1149Soru

A developer is deploying an application to a fleet of Amazon EC2 instances in an Auto Scaling group. The application needs to retrieve two configuration settings: a database password for an Amazon Aurora PostgreSQL database that must be rotated automatically every 30 days, and a non-sensitive external API endpoint URL. The developer wants to minimize operational overhead and cost. Which combination of actions should the developer take to store these configurations? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Store the database password in AWS Secrets Manager and configure automatic rotation using an AWS Lambda function.; Store the external API endpoint URL as a Standard parameter in AWS Systems Manager Parameter Store.

Cevap

Store the database password in AWS Secrets Manager with Lambda-based automatic rotation, and store the non-sensitive external API endpoint URL as a Standard parameter in AWS Systems Manager Parameter Store.
Storing the database password in AWS Secrets Manager allows the developer to easily schedule and automate rotation using AWS Lambda. Storing the non-sensitive API endpoint URL as a Standard parameter in Systems Manager Parameter Store is the most cost-effective approach since Parameter Store's Standard tier does not charge for storage or API interactions under normal limits, whereas Secrets Manager charges per secret.

Adım Adım Çözüm

1
Determine the storage for the sensitive database credentials that require rotation.
AWS Secrets Manager is selected because it natively integrates with Amazon Aurora and supports automated rotation through AWS Lambda.
Systems Manager Parameter Store lacks native rotation scheduling.
2
Determine the storage for the non-sensitive configuration endpoint URL.
AWS Systems Manager Parameter Store (Standard tier) is selected.
Standard parameters in Parameter Store have no storage cost, making it the most cost-effective solution for non-sensitive data.

Anahtar Kavram

Distinguishing between AWS Secrets Manager and Systems Manager Parameter Store based on rotation requirements and cost-efficiency.
Tahmini Süre:1m 30s
Soru 1150Soru

An application development team is migrating their continuous integration process to AWS CodeBuild. The build environment needs to compile a Node.js application, install packages, and build a container image. To optimize build performance, the team wants to cache both the downloaded node modules and the intermediate Docker image layers using local caching on the build host.

Which combination of actions must the developer perform to configure the required caching? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: In the buildspec.yml file, add a cache block specifying the path to the node packages (e.g., node_modules/**/*).; In the CodeBuild project configuration, enable local cache and select both custom cache and Docker layer cache.

Cevap

In the buildspec.yml file, add a cache block specifying the path to the node packages (e.g., node_modules/**/*), and in the CodeBuild project configuration, enable local cache and select both custom cache and Docker layer cache.
To cache custom paths such as dependency folders, the developer must specify the target directory in the buildspec.yml cache block. To use local host caching for both custom buildspec paths and intermediate Docker layers, the developer must also configure local cache in the project settings, explicitly enabling the custom cache and Docker layer cache types.

Adım Adım Çözüm

1
Configure the buildspec file to define the custom folder to be cached.
A cache section is added to the buildspec.yml with the path 'node_modules/**/*'.
This instructs CodeBuild's caching mechanism which files to look for and package at the end of a build.
2
Configure the CodeBuild project's local caching behavior.
The project is configured to use local caching with 'Custom cache' and 'Docker layer cache' enabled.
This tells CodeBuild to store the custom path specified in buildspec.yml and intermediate Docker layers locally on the build host rather than uploading them to S3.

Anahtar Kavram

AWS CodeBuild Caching Configurations
Tahmini Süre:2m 0s
Soru 1151Soru

A developer is updating an existing AWS CloudFormation stack. The update fails due to a configuration error in a new resource, and the stack rolls back to its last known stable state, transitioning to the `UPDATE_ROLLBACK_COMPLETE` status. The developer corrects the error in the template.

Which action should the developer take to successfully deploy the corrected template changes?

Cevabı ve açıklamayı göster

Cevap: Apply the corrected template to the existing stack by running a new update operation.

Cevap

Apply the corrected template to the existing stack by running a new update operation.
Applying the corrected template directly to the existing stack is the correct path forward because when an update fails and rolls back, the stack is in the UPDATE_ROLLBACK_COMPLETE state. This state is stable and allows direct update operations to be executed.

Adım Adım Çözüm

1
Analyze the stack status and find that it is in the UPDATE_ROLLBACK_COMPLETE state.
The stack is confirmed to be in a stable, active state after a failed update, rather than a failed initial creation.
Determining the stack state is crucial because UPDATE_ROLLBACK_COMPLETE stacks can be updated directly, whereas ROLLBACK_COMPLETE stacks from initial creation must be deleted.
2
Resolve the configuration error in the template or parameters locally.
A valid, corrected template is ready for deployment.
The deployment failed due to a configuration error, so the root cause must be corrected before initiating another update.
3
Initiate a new stack update operation using the corrected template.
The update is executed against the existing stack, applying only the necessary resource changes.
Running a stack update directly on the existing stack avoids the downtime and overhead of recreation.

Anahtar Kavram

Handling failed CloudFormation stack updates and understanding the UPDATE_ROLLBACK_COMPLETE state.
Tahmini Süre:1m 0s
Soru 1152Soru

A developer is troubleshooting an AWS Lambda function that processes transaction data from an Amazon Kinesis Data Stream. The Lambda function is configured with a timeout of 1010 seconds. The developer notices that the Kinesis stream's `GetRecords.IteratorAgeMilliseconds` metric is steadily increasing, and the same transaction records are appearing multiple times in the application logs. The Lambda function's CloudWatch logs indicate that some invocations are terminated after running for 1010 seconds. Which configuration change should the developer make to resolve this issue?

Cevabı ve açıklamayı göster

Cevap: Increase the timeout of the Lambda function and decrease the BatchSize in the Kinesis event source mapping.

Cevap

Increase the timeout of the Lambda function and decrease the BatchSize in the Kinesis event source mapping.
Increasing the Lambda function's timeout configuration allows the function more time to process the batch of records before being terminated. Decreasing the BatchSize reduces the number of records Lambda retrieves in a single invocation, decreasing the total processing time per invocation. Together, these actions ensure that the Lambda function can successfully process each batch within the timeout limit, preventing execution terminations, retries of the same batch, duplicate processing, and a rising IteratorAgeMilliseconds metric.

Adım Adım Çözüm

1
Analyze the symptoms from CloudWatch Metrics and logs.
The increasing `IteratorAgeMilliseconds` shows the consumer is falling behind the stream. Invocations terminating at 1010 seconds indicate execution timeouts, which cause the Lambda service to retry the same batch, leading to duplicate processing.
Identifying that the Lambda function is timing out while processing a full batch explains why records are processed repeatedly without advancing the stream pointer.
2
Adjust the Lambda configuration to ensure batches complete within the timeout limits.
Increasing the timeout parameter gives the function more execution headroom. Decreasing the batch size (e.g., from 100100 to 5050 records) reduces the processing time required for each individual invocation.
By resolving the timeout, executions complete successfully, allowing the Lambda service to commit the shard checkpoint and decrease the iterator age.

Anahtar Kavram

Lambda integration with Kinesis Data Streams and execution timeout handling
Tahmini Süre:1m 30s
Soru 1153Soru

A developer is building a worker application running on Amazon ECS with Fargate. The application polls an Amazon SQS queue for messages, downloads the referenced files from Amazon S3, and writes processing metadata to an Amazon DynamoDB table. The ECS task role has the AWSXRayDaemonWriteAccess IAM policy attached, and the X-Ray daemon runs as a sidecar container in the task definition. Although trace segments for S3 and DynamoDB calls are generated, they appear as separate, disconnected traces in the AWS X-Ray console, and the relationship between the SQS message producer and the worker application's processing activities is not correlated. Which two actions must the developer take to resolve this issue and achieve end-to-end distributed tracing?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Extract the AWS X-Ray trace header from the SQS message system attributes in the worker application, and use the SDK to create a segment context using that header as the parent.; Instrument the AWS SDK clients for S3 and DynamoDB within the worker application code using the AWS X-Ray SDK.

Cevap

To resolve the disconnected tracing issue, the developer must extract the AWS X-Ray trace header from the SQS message system attributes to propagate the parent tracing context, and instrument the S3 and DynamoDB SDK clients using the AWS X-Ray SDK to capture downstream requests.
The correct actions involve manually extracting the parent trace context from the SQS message system attributes to bridge the tracing gap across the queue, and instrumenting the AWS SDK clients (S3 and DynamoDB) using the AWS X-Ray SDK to record outgoing service calls.

Adım Adım Çözüm

1
Extract the trace header from SQS messages.
The application retrieves the parent trace ID from the message metadata.
This establishes trace context propagation from the producer to the consumer.
2
Initialize the X-Ray SDK segment using the extracted trace header.
The worker application starts a segment nested under the producer's trace.
This links the SQS message production and the message consumption into a single distributed trace.
3
Instrument the AWS SDK clients for S3 and DynamoDB.
Calls to S3 and DynamoDB are captured as subsegments.
This allows X-Ray to record downstream service calls and link them back to the active tracing segment.

Anahtar Kavram

Distributed tracing correlation across asynchronous boundaries (SQS) and downstream SDK client instrumentation with AWS X-Ray.
Soru 1154Soru

A company is migrating its build pipelines to AWS. A developer is setting up an AWS CodeBuild project that needs to run automated integration tests against a database. The build configuration requires retrieving a database password securely and using a custom build specification file named build-config.yml instead of the default buildspec.yml file.

Which combination of actions must the developer perform to successfully configure this build project? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Store the database password in AWS Systems Manager Parameter Store as a SecureString parameter, and reference it under the parameter-store mapping in the env section of build-config.yml.; In the AWS CodeBuild project configuration, specify build-config.yml in the buildspec build settings.

Cevap

Store the database password as a SecureString in Parameter Store and reference it in the parameter-store section of the custom buildspec file, and specify the custom buildspec filename in the CodeBuild project settings.
To successfully configure this project, the developer must override the default buildspec filename in the AWS CodeBuild project configuration by setting it to build-config.yml. Additionally, the developer must store the password as a SecureString in Systems Manager Parameter Store and reference it in the parameter-store mapping of the env section in the buildspec file. This allows CodeBuild to decrypt and expose the password as an environment variable during the build phases securely.

Adım Adım Çözüm

1
Configure the CodeBuild project to use the custom buildspec file.
Specify the name build-config.yml in the buildspec settings of the project configuration.
By default, CodeBuild looks for a file named buildspec.yml at the root of the source directory. A custom filename must be explicitly defined.
2
Secure the database password using Parameter Store.
Store the database password as a SecureString parameter in Systems Manager Parameter Store.
SecureString ensures the parameter is encrypted at rest using a KMS key, which is standard practice for sensitive credentials like passwords.
3
Reference the parameter securely in the build specification.
Add the parameter-store mapping under the env section of the buildspec and map the environment variable to the Parameter Store parameter name.
This allows CodeBuild to retrieve the decrypted value dynamically during the build execution without hardcoding it in the source repository.

Anahtar Kavram

AWS CodeBuild project configuration including custom buildspec overrides and secure parameter retrieval via Systems Manager Parameter Store.
Soru 1155Soru

A developer has enabled active tracing on an AWS Lambda function. The function calls an external web service using a standard HTTP client library. In the AWS X-Ray console, the trace map displays the Lambda function execution segment, but the downstream HTTP calls to the external web service are missing from the trace. What should the developer do to include the downstream HTTP calls in the X-Ray trace map?

Cevabı ve açıklamayı göster

Cevap: Instrument the HTTP client library inside the application code using the AWS X-Ray SDK.

Cevap

Instrument the HTTP client library inside the application code using the AWS X-Ray SDK.
To trace downstream HTTP calls, the developer must instrument the HTTP client library using the AWS X-Ray SDK. This instrumentation dynamically injects the X-Ray tracing header into outbound requests, allowing downstream services to participate in the trace.

Adım Adım Çözüm

1
Identify why the downstream trace segment is missing.
Downstream HTTP client is not patched or instrumented, so the required tracing header (X-Amzn-Trace-Id) is not propagated.
AWS X-Ray active tracing on Lambda only covers Lambda itself; downstream calls require code instrumentation.
2
Apply the appropriate instrumentation method in the application code.
Use the AWS X-Ray SDK's HTTP instrumentation wrappers to wrap the HTTP client library.
This automatically injects the tracing header into outgoing HTTP requests and creates subsegments for the calls.

Anahtar Kavram

AWS X-Ray Downstream Context Propagation and HTTP Client Instrumentation
Tahmini Süre:45s
Soru 1156Soru

A developer is implementing a client-side decryption module for a batch processing application. The application downloads encrypted data archives (each approximately 18 MB18\text{ MB} in size) from an Amazon S3 bucket. Each archive was previously encrypted using envelope encryption with a customer managed key (CMK) in AWS KMS. The encrypted data key is stored alongside the archive in the Amazon S3 object metadata. What sequence of operations must the developer implement in the application to decrypt each archive?

Cevabı ve açıklamayı göster

Cevap: Call the AWS KMS `Decrypt` API passing the encrypted data key to obtain the plaintext data key, use the plaintext data key to decrypt the archive locally, and then erase the plaintext key from memory.

Cevap

Call the AWS KMS Decrypt API passing the encrypted data key to obtain the plaintext data key, use the plaintext data key to decrypt the archive locally, and then erase the plaintext key from memory.
The correct approach is the envelope decryption workflow. The application sends the encrypted data key to the AWS KMS `Decrypt` API. KMS decrypts it and returns the plaintext data key. The application then uses this plaintext key to decrypt the 18 MB18\text{ MB} file locally, and subsequently deletes the plaintext key from memory to minimize security risks.

Adım Adım Çözüm

1
Retrieve the encrypted data key from the S3 object metadata.
The application obtains the encrypted data key needed for decryption.
The encrypted data key is required to be passed as an input to the AWS KMS Decrypt API.
2
Call the `Decrypt` API of AWS KMS, passing the encrypted data key as the CiphertextBlob parameter.
AWS KMS decrypts the key and returns the plaintext data key in the response payload.
Only AWS KMS has the primary key (CMK) necessary to decrypt the encrypted data key.
3
Use the returned plaintext data key to decrypt the 18 MB18\text{ MB} archive locally using a symmetric encryption library.
The archive is successfully decrypted to its plaintext form.
AWS KMS direct operations are limited to 4 KB4\text{ KB}; the actual payload decryption must occur client-side.
4
Erase the plaintext data key from the application memory.
The plaintext key is cleared from the RAM.
This is a critical security best practice to prevent potential memory leaks or exposure of cryptographic keys.

Anahtar Kavram

AWS KMS Envelope Decryption Workflow
Tahmini Süre:1m 30s
Soru 1157Soru

A development team uses AWS CloudFormation to manage a serverless application consisting of Amazon DynamoDB tables and AWS Lambda functions. The application requires a database API key that must be rotated every 30 days. Additionally, a developer recently modified the read capacity units of one of the DynamoDB tables directly in the AWS Management Console to handle a temporary traffic spike. The team now needs to perform a stack update to deploy new application logic while addressing both the rotation requirement and the manual configuration changes.

Which of the following actions should the team take to meet these requirements? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Store the database API key in AWS Secrets Manager, configure automatic rotation for the secret, and reference the secret in the CloudFormation template using a dynamic reference.; Perform drift detection on the CloudFormation stack, identify the modified DynamoDB read capacity properties, and update the CloudFormation template or the resource to resolve the drift before updating the stack.

Cevap

Store the database API key in AWS Secrets Manager with automatic rotation enabled, reference it via a dynamic reference in the template, and run drift detection to identify and reconcile the manual DynamoDB configurations before updating the stack.
Storing the API key in AWS Secrets Manager is correct because Secrets Manager natively supports automatic rotation of secrets and allows safe retrieval via dynamic references in CloudFormation templates. Performing drift detection on the stack is correct because it identifies manual out-of-band changes, allowing the developer to align the template or resource state before applying the stack update, preventing update failures.

Adım Adım Çözüm

1
Evaluate the secret storage and rotation requirement.
Determine that AWS Secrets Manager must be used because it provides built-in automatic rotation capabilities, unlike Systems Manager Parameter Store, and can be resolved in templates via dynamic references.
Parameter Store does not natively support automated secrets rotation, making Secrets Manager the correct choice.
2
Address the configuration drift from the manual out-of-band modifications.
Detect drift using CloudFormation drift detection, identify the difference in DynamoDB read capacity units, and update either the CloudFormation template or the resource to resolve the drift.
Updating a stack with out-of-band modifications can result in deployment failures or unintended resource configurations unless the template is synchronized with the actual state.

Anahtar Kavram

Managing secrets with rotation and handling resource drift in AWS CloudFormation.
Soru 1158Soru

A developer is troubleshooting an AWS Lambda function that occasionally terminates abruptly. To measure the frequency of these occurrences, the developer wants to create an Amazon CloudWatch metric that increments every time a function execution times out. The Lambda log group contains standard timeout log entries, such as:

`2026-07-14T12:00:00.000Z 88888888-4444-4444-4444-121212121212 Task timed out after 10.03 seconds`

Which log metric filter pattern must the developer configure on the log group to accurately capture only these timeout events?

Cevabı ve açıklamayı göster

Cevap: "Task timed out"

Cevap

"Task timed out"
The correct answer is the option specifying the exact phrase in double quotes. In Amazon CloudWatch Logs, filter patterns for unstructured plain text logs can match an exact phrase by enclosing the phrase in double quotes. Since the standard Lambda timeout message contains the phrase "Task timed out", this pattern will match the line and increment the metric.

Adım Adım Çözüm

1
Identify the format of the target log entry.
The log message is unstructured plain text containing the phrase "Task timed out".
Choosing the correct filter pattern syntax depends on whether the log is structured (JSON), space-delimited, or plain text.
2
Determine the appropriate CloudWatch Logs filter pattern syntax for plain text phrase matching.
A plain text search pattern uses double quotes around the exact phrase to match, resulting in "Task timed out".
Enclosing the phrase in double quotes performs an exact substring match on unstructured logs.

Anahtar Kavram

CloudWatch Metric Filter syntax for unstructured text logs
Tahmini Süre:45s
Soru 1159Soru

A company runs a high-traffic web application on an AWS Elastic Beanstalk environment. The application is highly sensitive to performance degradation, so the deployment of a new version must maintain 100% of the environment's instance capacity to handle traffic at all times. Additionally, if the new version fails health checks, the environment must roll back automatically with minimal rollback time and no manual intervention. The developer wants to avoid configuring a secondary environment or changing DNS records. Which deployment strategy should the developer select to meet these requirements?

Cevabı ve açıklamayı göster

Cevap: Immutable deployment

Cevap

Immutable deployment
The correct strategy is an Immutable deployment. This policy launches a temporary Auto Scaling group with the new application version and tests it. If the instances pass health checks, Elastic Beanstalk moves them to the main Auto Scaling group and terminates the old instances. If they fail, the temporary Auto Scaling group is terminated immediately, achieving a clean and fast rollback without modifying any of the original instances and maintaining 100% capacity throughout the process.

Adım Adım Çözüm

1
Analyze the capacity requirement.
The requirement specifies that the deployment must maintain 100% of the environment's instance capacity. This rules out 'All at once' and 'Rolling' deployments, as they temporarily take instances out of service.
To prevent performance degradation during the deployment process.
2
Analyze the environment and DNS requirements.
The deployment must occur within the existing environment without creating a secondary environment or changing DNS records (CNAME swap), which rules out external Blue/Green deployments.
To simplify management and satisfy the single-environment constraint.
3
Evaluate the rollback and failure recovery requirements.
The strategy must support automatic rollback with minimal recovery time if health checks fail. An immutable deployment creates a temporary Auto Scaling group to test the new version, making rollbacks as simple as terminating the temporary group. A rolling with additional batch deployment would require a slow, manual rollback deployment of the previous version if some instances had already been updated.
To find the strategy that minimizes the blast radius and rollback time within a single environment.

Anahtar Kavram

AWS Elastic Beanstalk deployment policies and their trade-offs regarding capacity, downtime, and rollback mechanisms.
Tahmini Süre:1m 30s
Soru 1160Soru

A web application hosted on a private domain attempts to submit a `PUT` request to a backend API exposed via Amazon API Gateway using a Lambda Proxy integration. The web browser blocks the request and outputs a console error indicating that the CORS preflight request failed because the 'Access-Control-Allow-Origin' header is missing. Which steps should the developer perform to resolve this issue? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Define an OPTIONS method for the API Gateway resource that returns the required 'Access-Control-Allow-Origin' header.; Modify the Lambda function response object to include the 'Access-Control-Allow-Origin' header in its `headers` dictionary.

Cevap

Define an OPTIONS method for the API Gateway resource that returns the required 'Access-Control-Allow-Origin' header, and modify the Lambda function response object to include the 'Access-Control-Allow-Origin' header in its headers dictionary.
To fix a CORS error in API Gateway when using Lambda Proxy integration, two separate adjustments are needed. First, the preflight OPTIONS request must be enabled on the API Gateway resource to respond with the 'Access-Control-Allow-Origin' header. Second, the backend Lambda function must return the 'Access-Control-Allow-Origin' header in its response JSON, because API Gateway does not inject headers into proxy responses.

Adım Adım Çözüm

1
Analyze the error message and integration type.
Identified a CORS failure on an API Gateway endpoint using Lambda Proxy integration.
Since Lambda Proxy integration is used, the backend Lambda response must explicitly return the CORS headers along with the API Gateway resource preflight handling.
2
Configure the preflight OPTIONS request in API Gateway.
Created an OPTIONS method on the API Gateway resource returning the 'Access-Control-Allow-Origin' header.
This allows the browser's preflight check to succeed before initiating the actual PUT request.
3
Modify the Lambda function response.
Updated the returned JSON payload to include 'Access-Control-Allow-Origin' inside the headers block.
In proxy integrations, API Gateway does not modify the response headers, so the backend function must return them.

Anahtar Kavram

Handling CORS in API Gateway with Lambda Proxy Integration
Tahmini Süre:1m 30s
ÖncekiSayfa 58 / 78Sonraki