Tüm alıştırma soruları
1542 soru
A developer is running a Python daemon application on an Amazon EC2 instance. The application processes tasks by retrieving messages from an Amazon SQS queue and making downstream API calls to an external gateway using the `requests` library. The AWS X-Ray daemon is running on the EC2 instance, and the EC2 instance profile has the `AWSXRayDaemonWriteAccess` policy attached. The application code imports `patch_all` from the AWS X-Ray SDK and calls it at startup. However, when the application runs, the external API calls do not appear in the X-Ray console, and the logs display `SegmentNotFoundException` errors.
What is the root cause of this issue?
A developer is configuring an AWS Lambda function that needs to read objects from an Amazon S3 bucket. The developer creates an IAM role containing the following permission policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-app-data/*"
}
]
}
Which configuration must be applied to the trust policy of this IAM role so that the Lambda function can successfully assume it?
A developer has enabled active tracing on an AWS Lambda function that is triggered by an Amazon SQS queue. The Lambda function processes the messages and writes the results to an Amazon DynamoDB table. While reviewing the trace map in the AWS X-Ray console, the developer observes that the Lambda function execution is traced, but the downstream calls to DynamoDB do not appear in the traces. Which of the following actions should the developer take to resolve this issue?
An analytics application utilizes an AWS Lambda function to generate daily reports. The function downloads several source files to the local ephemeral storage (`/tmp`), merges them, and uploads the final report to Amazon S3. The function is configured with of ephemeral storage. While initial test runs succeed, the function intermittently fails during peak hours with a `No space left on device` error, even though the source files for any single invocation never exceed in total. What is the root cause of this failure, and how should the developer resolve it?
A client-side single-page dashboard application hosted on `https://internal-app.net` sends a `DELETE` request to a backend API. The API is hosted on Amazon API Gateway and integrated with a backend AWS Lambda function using a Lambda proxy integration. During testing, the browser console shows that the `DELETE` request is blocked due to a missing CORS header during the preflight check. Furthermore, direct invocations of the endpoint using a command-line tool result in a `502 Bad Gateway` error with the message 'Malformatted Lambda proxy response' in the CloudWatch logs. Which two actions must the developer take to resolve both the CORS preflight block and the integration error?
Geçerli olan tümünü seçin
An order processing service runs on AWS Lambda. To comply with security guidelines, this function is attached to private subnets within a VPC to query an Amazon Aurora database. As part of its execution, the function must also call an external payment gateway API over the internet. Although the database queries succeed, all external API calls timeout. What configuration change is required to allow the function to connect to the external API?
A developer deployed an Amazon EC2 instance and an associated security group using an AWS CloudFormation stack. During a troubleshooting session, the developer manually added a new ingress rule to the security group using the AWS Management Console. The developer now wants to synchronize the CloudFormation stack with these changes to ensure future stack updates do not overwrite or fail due to this modification. Which action should the developer take to resolve this discrepancy?
A developer has updated an API hosted on Amazon API Gateway. To minimize the risk of the new version affecting users, the developer wants to test the update by routing of the incoming API calls to the new version, while the remaining of the traffic goes to the current version. The developer wants to monitor the performance of the new version using CloudWatch and easily promote it to full production once verified. Which approach meets these requirements with the least operational complexity?
A developer is troubleshooting an AWS Lambda function written in Python that is triggered by an Amazon API Gateway REST API. When a client sends a request, the function queries Amazon DynamoDB and then queries an external PostgreSQL database. The developer has enabled active tracing on the Lambda function. Although the API Gateway and Lambda service execution segments appear in the AWS X-Ray service map, downstream calls to DynamoDB and the PostgreSQL database are completely missing. Which two actions must the developer take to capture these downstream calls in the X-Ray trace?
Geçerli olan tümünü seçin
A developer has a distributed application where a producer service running on Amazon ECS Fargate sends tasks to an Amazon SQS queue. A consumer service, also running on Amazon ECS Fargate, polls the queue and processes the tasks. Both services use the AWS SDK and are configured with the AWS X-Ray SDK, with active tracing enabled where applicable and the AWS SDK clients properly patched.
When viewing the traces in the AWS X-Ray console, the developer observes two disconnected traces: one for the producer service sending the message, and another separate trace for the consumer service processing the task. The end-to-end transaction is not correlated.
Which action should the developer take to resolve this issue and trace the request end-to-end?
A developer has built a serverless application where an AWS Lambda function, written in Python, processes payment reports. The Lambda function is configured to run inside a VPC, attached to two private subnets, to securely access a private Amazon RDS PostgreSQL database.
As part of the processing logic, the Lambda function must perform the following actions:
1. Connect to the RDS database to fetch payment transactions.
2. Query a public external credit rating API via HTTPS to validate client records.
3. Download a standard currency conversion schema from a public Amazon S3 bucket.
During testing, the Lambda function consistently runs for its maximum configured timeout of seconds and then terminates with a `Task timed out after 3.00 seconds` error. The Amazon CloudWatch logs indicate that the connection to the RDS database is established successfully, but the connections to both the external credit rating API and Amazon S3 fail to connect.
Which combination of actions should the developer take to resolve these connectivity and execution timeout issues? (Select TWO.)
Geçerli olan tümünü seçin
A developer is implementing client-side decryption in an application. The application receives a data package containing a ciphertext payload and an encrypted data key that was originally generated using an AWS KMS customer managed key. The application has the necessary IAM permissions to access the customer managed key.
Which sequence of steps must the developer perform in the application code to decrypt the payload?
A developer has deployed an AWS Lambda function named `DataProcessor` in Account A () and configured a Function URL with the authorization type set to `AWS_IAM`. An IAM role named `AppRole` in Account B () needs to invoke this function by sending HTTP requests directly to the Function URL. Which combination of configuration steps will successfully and securely grant `AppRole` the necessary permissions to invoke the Function URL?
An organization runs a containerized data processing application on an Amazon ECS cluster using the EC2 launch type. The application uses the AWS SDK to interact with an Amazon DynamoDB table. During a security audit, the security team notices that the application is accessing DynamoDB using the credentials of the container host's EC2 instance profile role, rather than the more restrictive IAM role designed specifically for the ECS task. Which configuration issue explains why the application is using the EC2 instance profile credentials?
A developer is using AWS CloudFormation to deploy a web application. The template requires a database password that must be retrieved securely without being hardcoded or exposed in plaintext. During the deployment testing phase, the developer also needs to ensure that if any resource fails to create or update, the stack does not automatically revert its changes, allowing the developer to investigate the failed resource state.
Which two actions should the developer take to meet these requirements? (Select TWO.)
Geçerli olan tümünü seçin
A software developer is building a SaaS dashboard application that runs on an Amazon ECS cluster. The application displays financial exchange rates retrieved from a third-party API. The exchange rates are updated exactly once every hour. To minimize third-party API usage fees and improve application response times, the developer wants to implement a shared caching solution that automatically invalidates stale data after 1 hour. Which solution meets these requirements with the lowest latency?
A developer is deploying a Node.js application to Amazon ECS on AWS Fargate. The developer wants to instrument the application to send distributed tracing data to AWS X-Ray. The developer includes the AWS X-Ray SDK in the application code and configures the SDK to instrument incoming HTTP requests. However, after deployment, no traces appear in the AWS X-Ray console, and the application logs show errors indicating that connection to the X-Ray daemon on port 2000 failed. Which of the following actions should the developer take to resolve this issue and enable successful tracing?
A developer is maintaining an application stack deployed via AWS CloudFormation. A recent stack update failed because a Security Group managed by the stack was manually deleted via the Amazon EC2 console, causing the stack rollback to fail. The stack is currently stuck in the UPDATE_ROLLBACK_FAILED state. The developer needs to return the stack to a stable state so they can apply a new template. Which two actions must the developer perform to resolve this issue? (Select TWO.)
Geçerli olan tümünü seçin
A developer is configuring a continuous delivery pipeline in AWS CodePipeline. The pipeline has a deploy stage that deploys a serverless API, followed by an integration test stage that runs an AWS Lambda function. The Lambda function must retrieve a database password that requires automatic rotation every 30 days. Additionally, the Lambda function needs permissions to execute and log to Amazon CloudWatch.
Which two configurations should the developer implement to satisfy these requirements? (Select TWO.)
Geçerli olan tümünü seçin
A developer is building a web application that stores user-specific files in a private Amazon S3 bucket. The application uses an Amazon Cognito User Pool for user authentication. The developer wants to authorize users to access their department's files in S3 using temporary AWS credentials. The user's department is stored in a custom attribute named custom:department in the User Pool. The developer has created a separate IAM role for each department. Which approach should the developer use to assign the correct IAM role to each user with the least operational overhead?