Tüm alıştırma soruları
1542 soru
A developer is configuring a local development workstation to run a Python script that uses the AWS SDK (Boto3) to upload files to Amazon S3. To adhere to security best practices, the developer must avoid hardcoding AWS credentials directly within the script. Which two methods should the developer use to securely provide the required credentials to the AWS SDK? (Select TWO.)
Geçerli olan tümünü seçin
A developer is implementing an AWS Lambda function in AWS Account (Account A) that must write messages to an Amazon SQS queue in AWS Account (Account B). The security team requires using temporary security credentials via IAM role assumption for cross-account access. The Lambda function is configured with an execution role named `LambdaExecutionRole` in Account A.
The developer attempts to set up an IAM role in Account B named `QueueWriterRole` with the following trust policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
Which of the following actions are required to successfully and securely establish this cross-account access? (Select TWO.)
Geçerli olan tümünü seçin
A developer is writing a local script using the AWS SDK to read messages from an Amazon SQS queue. The script needs to run locally on the developer's workstation for testing. According to the AWS SDK default credential provider chain, which of the following is the recommended and most secure way to supply the AWS credentials during local testing?
An application deployed on an Amazon EC2 instance uses the AWS SDK to retrieve secrets from AWS Secrets Manager. The EC2 instance has an IAM instance profile attached with the required permissions. However, when the application runs, it fails to authenticate and throws an AccessDenied exception, attempting to use credentials belonging to a different IAM user. Which of the following is the most likely cause of this credential conflict based on the AWS SDK default credential provider chain order of precedence?
A developer is deploying a containerized application to AWS and wants to use the AWS SDK to interact with Amazon S3. To ensure security and flexibility across environments, the developer decides to use the Default Credential Provider Chain to locate AWS credentials.
Which two of the following locations or sources are checked by the Default Credential Provider Chain to obtain these credentials?
Geçerli olan tümünü seçin
A developer is building a mobile application that allows users to upload high-resolution photos directly to a private Amazon S3 bucket. The application must authenticate users using an enterprise OpenID Connect (OIDC) identity provider. The developer wants to use Amazon Cognito to facilitate authorization, ensuring that users can only upload files to their own prefix (folder) within the S3 bucket using temporary, least-privilege credentials, without exposing any long-lived credentials. Which TWO configuration steps should the developer perform to meet these requirements?
Geçerli olan tümünü seçin
A developer is deploying a Go application to run in an Amazon ECS task using the AWS Fargate launch type. The application uses the AWS SDK to retrieve configuration data from Amazon Systems Manager Parameter Store. The developer wants to ensure that the application can authenticate with AWS services securely during local development and in the production ECS environment without code modifications. Which two actions should the developer take to configure the credential retrieval process correctly? (Select TWO.)
Geçerli olan tümünü seçin
A developer is writing an AWS Lambda function that needs to write data to an Amazon DynamoDB table using the AWS SDK. How should the developer configure the AWS SDK client in the function code to authenticate securely with the database?
A developer is writing a Node.js application on a local development workstation that uses the AWS SDK for JavaScript (v3) to access resources in a development AWS account. To comply with security best practices, the developer must run the application locally by assuming a specific IAM role () using the temporary credentials of a local IAM user profile named `dev-user`.
Which combination of configuration steps will allow the AWS SDK to automatically assume the target IAM role and retrieve temporary credentials without modifying the application code? (Select TWO.)
Geçerli olan tümünü seçin
A developer is running a containerized Java application inside an Amazon Elastic Container Service (Amazon ECS) task on an Amazon EC2 host. The ECS task is assigned an IAM Task Role (`ECS-Task-Role`) that has permission to write to an Amazon DynamoDB table. The hosting EC2 instance profile has an IAM role (`EC2-Host-Role`) that does not have DynamoDB permissions.
During execution, the application fails to write to DynamoDB and logs an `AccessDeniedException`. Further inspection of the log output shows that the AWS SDK is resolving credentials associated with `EC2-Host-Role` rather than `ECS-Task-Role`.
Which of the following is the most likely root cause of this credential resolution behavior?
A developer is configuring a local workstation to run a script that uses the AWS SDK to retrieve files from Amazon S3. To adhere to security best practices and avoid hardcoding credentials within the application, which two locations can the developer use to store the credentials so they are automatically detected by the default credential provider chain? (Select TWO.)
Geçerli olan tümünü seçin
A developer is deploying a Go-based daemon to an on-premises server. The daemon must interact with Amazon DynamoDB and AWS Secrets Manager. To comply with strict security policies, no long-term AWS credentials can be stored on the server's local disk. The enterprise has an existing internal authentication service running at `http://internal-auth.local` that generates temporary AWS credentials upon successful authentication. Which two actions should the developer take to configure the AWS SDK in the Go application to automatically retrieve and use these credentials?
Geçerli olan tümünü seçin
A developer is packaging a Node.js application to run in an Amazon ECS container on AWS Fargate. During local testing on developer workstations, the application accesses AWS resources using credentials retrieved from the AWS IAM Identity Center (via the AWS CLI `aws sso login` command). In the production Fargate environment, the application must access an Amazon DynamoDB table. The developer wants the application to automatically resolve the correct credentials in both environments using the AWS SDK's default credential provider chain without any code changes or hardcoded credentials.
Which two configuration actions must the developer take to meet these requirements?
Geçerli olan tümünü seçin
A developer is writing a Node.js application that will run on an Amazon EC2 instance. The application needs to retrieve objects from an Amazon S3 bucket using the AWS SDK. To follow security best practices, the developer wants to avoid managing long-term AWS credentials on the instance.
Which configuration should the developer use to allow the AWS SDK to access the S3 bucket securely?
An application deployed on an Amazon EC2 instance uses the AWS SDK to perform read and write operations on an Amazon DynamoDB table. An IAM instance profile named `DynamoDB-Write-Role` is attached to the EC2 instance. However, the developer has also configured a shared credentials file under `/home/ec2-user/.aws/credentials` that contains a default profile with static credentials that only allow read-only access to DynamoDB. The environment variable `AWS_PROFILE` is not set. During application execution, all write operations to DynamoDB fail with an `AccessDeniedException`. Which of the following describes the root cause of this failure and the correct resolution?
A developer has configured a Lambda proxy integration in Amazon API Gateway. When testing the API, they receive a 502 (Bad Gateway) error. The Lambda function execution logs in Amazon CloudWatch show that the function ran successfully and returned the intended result. Which of the following is the most likely cause of this error?
A developer is deploying a containerized Python application to Amazon ECS on AWS Fargate. The application needs to access an Amazon S3 bucket. During local development, the developer configured the AWS SDK (Boto3) by setting the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables in the local shell. In the ECS task definition, the developer assigned an IAM role with the correct permissions to the `taskRoleArn` parameter. However, when the container runs in Fargate, the application receives authorization errors because it tries to use the developer's local credentials, which have expired.
Which of the following actions should the developer take to resolve this issue and ensure the application securely accesses Amazon S3? (Select TWO.)
Geçerli olan tümünü seçin
A developer is deploying a Go-based microservice to AWS Lambda. The microservice uses the AWS SDK for Go to retrieve items from an Amazon DynamoDB table.
Which of the following is the most secure and standard way to configure the AWS SDK client to authenticate requests?
A developer is configuring a REST API in Amazon API Gateway that integrates with a backend AWS Lambda function. The developer needs the Lambda function to directly control the HTTP status code and headers returned to the API client. Which two configurations must be implemented to achieve this?
Geçerli olan tümünü seçin
A developer is designing a serverless ordering system where an AWS Lambda function processes message batches from an Amazon SQS queue. The function is configured with a timeout of 2 minutes and is placed inside private subnets of a custom VPC to write data to an Amazon Aurora DB cluster. The function also needs to call a public endpoint of an external payment gateway. During initial testing under load, the developer observes that the Lambda function fails to reach the external payment gateway, resulting in connection timeouts. Furthermore, the Aurora database cluster runs out of available database connections very quickly, and SQS messages are being received and processed multiple times by different Lambda invocations, even though the executions complete successfully in 90 seconds. Which combination of steps should the developer take to resolve these issues?