表示モード
画像位置
文字位置
理解度の自動記録
Q1AWS Certified Developer Associate
Q1. An engineer at a startup is building an application composed of an Amazon API Gateway API, an AWS Lambda function, and an Amazon DynamoDB table.
The engineer uses the AWS Serverless Application Model (AWS SAM) to build and run the serverless application on AWS.
Even when only the Lambda function is modified and pushed, every artifact in the application is rebuilt each time.
The engineer wants to adopt AWS SAM Accelerate so that running a single command redeploys only the Lambda functions that have changed.
Which command meets this requirement?
Show answer
Correct answer: D. sam sync –watch
sam sync –watch enables AWS SAM Accelerate, detecting local changes and quickly applying only the differing resources.The –watch flag automatically monitors source code changes, and only changed resources such as the Lambda function are synced to the cloud, avoiding a full rebuild and complete redeployment of all artifacts.
sam deploy –force-upload (A) forcibly uploads all artifacts, which is counterproductive.
sam deploy –no-execute-changeset (B) only creates a change set without executing it.
sam package (C) only packages the artifacts and performs neither deployment nor incremental sync.
sam sync is the best fit for speeding up iterative updates during development.
AWS SAM CLI sam sync command reference
Q2AWS Certified Developer Associate
Q2. An engineer at a weather-data venture is building an application that processes data delivered to an Amazon S3 bucket.
Data is delivered roughly 10 times a day, and processing is expected to complete in under a minute on average.
How should the engineer deploy and invoke this application at the lowest cost and lowest latency?
Show answer
Correct answer: B. Deploy the application as an AWS Lambda function and invoke it using an S3 event notification as the trigger.
S3 event notifications invoke the Lambda function immediately after object creation, achieving the lowest latency.Because the application runs only about 10 times a day for about a minute each, Lambda—which is billed only for execution time—is far cheaper than EC2, which incurs charges even while idle.
A CloudWatch alarm (A) is intended for monitoring metric thresholds and is not suited to instantly triggering on object uploads.
A scheduled event (C) only fires at fixed intervals, so a delay occurs between data arrival and execution.
EC2 polling (D) is disadvantageous on both fronts: the cost of always-on operation and the delay caused by the polling interval.
Using AWS Lambda with Amazon S3
Q3AWS Certified Developer Associate
Q3. A nationwide retail chain operates a sales analytics application that uses an AWS Lambda function to process transaction data stored in Amazon DocumentDB.
The application aggregates daily sales data from 500 stores and produces reports for executives.
Recently, users have reported that report generation is slow and that requests occasionally time out.
Upon investigation, the developer confirmed that the average response time for report generation has increased from 3 seconds to roughly 25 seconds or more.
The developer needs to identify the application’s performance bottleneck.
Which solution meets this requirement with the least operational overhead?
Show answer
Correct answer: A. Enable AWS X-Ray tracing on both the Lambda function and the DocumentDB cluster. Implement custom subsegments that track query execution to identify slow queries.
In a configuration where a Lambda function calls a downstream database (DocumentDB), distributed tracing is the best way to pinpoint where time is being spent with minimal effort.AWS X-Ray provides end-to-end request tracing and a timing breakdown, making it possible to see whether the latency originates in Lambda initialization, a downstream call, or a database query.
Adding custom subsegments around DocumentDB operations lets you measure the exact time taken for each query execution or connection acquisition, so you can quickly identify slow queries.
B is centered on errors and generic metrics and cannot precisely isolate the cause of the added 20-plus seconds.
C is a performance-improvement measure applied before confirming the root cause, which does not meet the requirement of identifying the bottleneck first.
D requires detailed logging implementation and queries, increasing overhead in both development effort and log cost.
Using AWS X-Ray with AWS Lambda
Q4AWS Certified Developer Associate
Q4. A healthcare company stores personally identifiable information (PII) in an Amazon DynamoDB table named PII in Account A.
A developer is building an application that runs on an Amazon EC2 instance in Account B.
This application in Account B needs access to the PII table.
The administrator of Account A has created an IAM role named AccessPII that has access to the PII table.
They have also created a trust policy that designates Account B as a principal allowed to assume the role.
Which combination of steps should the developer take in Account B so that the application can access the PII table?
(Choose two.)
Show answer
Correct answer: A, D
This is the classic cross-account access pattern using AWS STS AssumeRole.Account A permits Account B through the trust policy on the role side, but that alone is not enough; the caller—the EC2 role in Account B—also needs permission to perform sts:AssumeRole (A).
In addition, to actually obtain the temporary credentials, the application must call the AssumeRole API within its code (D).
B is incorrect because granting permissions directly on the Account A-owned table from the Account B side has no effect.
C is wrong because merely obtaining the EC2 role’s credentials does not grant Account A’s permissions; assuming the cross-account role is mandatory.
E’s GetSessionToken is for MFA sessions of IAM users and is not used for assuming a cross-account role.
AWS STS AssumeRole API reference
Q5AWS Certified Developer Associate
Q5. A power company has deployed smart meters at all customer sites.
The smart meters measure electricity usage at one-minute intervals and send the readings to a remote collection endpoint.
The company needs to build an endpoint that receives the smart meter readings and stores them in a database.
The stored data should include the location ID and timestamp information.
In addition, customers must be able to access their current and historical usage on demand with low latency.
Demand is expected to grow significantly in the future.
The solution must not impact performance, and there must be no downtime during writes.
Which solution meets these requirements most cost-effectively?
Show answer
Correct answer: B. Store the smart meter readings in an Amazon DynamoDB table. Compose a composite key from the location ID and timestamp columns and use those columns to filter customer data.
A DynamoDB table with a composite key using the location ID as the partition key and the timestamp as the sort key can write and retrieve time-series usage data with low latency and high throughput, and it scales seamlessly as demand grows.DynamoDB is serverless with no downtime during writes, making it well suited to combining high-frequency writes with per-location range queries.
RDS (A) has an upper limit on write scaling and increases operational burden and cost.
ElastiCache for Redis (C) is in-memory, so it is not suited to durable storage and is costly for long-term historical retention.
S3 + Athena (D) is inexpensive but scans on every query, making it unsuitable for low-latency, on-demand access to current usage.
Working with queries in DynamoDB
Q6AWS Certified Developer Associate
Q6. A company plans to deploy an application behind an Elastic Load Balancing (ELB) load balancer.
The application uses HTTP/HTTPS listeners and must be able to obtain the client’s IP address.
Which load balancing solution meets these requirements?
Show answer
Correct answer: A. Use an Application Load Balancer and obtain the client’s address from the X-Forwarded-For header.
When using HTTP/HTTPS listeners, an Application Load Balancer operating at Layer 7 adds the original client IP to the X-Forwarded-For header and forwards it, so the application can obtain the client IP from this header.The ALB terminates HTTP/HTTPS traffic and inserts headers such as X-Forwarded-For, X-Forwarded-Proto, and X-Forwarded-Port by default.
The NLB’s Proxy Protocol (B) is a mechanism for Layer 4 TCP connections and does not match the requirement of obtaining the client IP via HTTP/HTTPS headers.
Instance ID registration in C concerns the target registration method and is unrelated to obtaining the client IP.
An NLB does not add the X-Forwarded-For header (D), so it is incorrect.
X-Forwarded-For header on Application Load Balancers
Q7AWS Certified Developer Associate
Q7. A developer needs to build an API that provides access to an application and its resources.
The developer already possesses a TLS certificate.
The API’s default base URL must be able to be changed to a custom domain name.
The API’s users are distributed around the world.
The solution must minimize API latency.
Show answer
Correct answer: C. Create an Amazon API Gateway REST API and use the edge-optimized endpoint type. Import the TLS certificate into AWS Certificate Manager, create a custom domain name for the REST API, and route traffic to it. Disable the REST API’s default endpoint.
API Gateway’s edge-optimized endpoint automatically uses Amazon CloudFront’s global edge network, minimizing latency for users distributed around the world.By associating the TLS certificate imported into ACM with the custom domain name, you can provide secure connections on any domain.
Disabling the default endpoint enforces access only through the custom domain.
Approaches like A and D, which separately build CloudFront and process requests with Lambda@Edge or CloudFront Functions, merely duplicate capabilities that an edge-optimized API Gateway provides out of the box and are unnecessary.
The private endpoint in B is intended for use from within a VPC and does not meet the requirement of global, low-latency access.
Custom domain names for Amazon API Gateway
Q8AWS Certified Developer Associate
Q8. A developer wants to insert a record into an Amazon DynamoDB table immediately after a new file is added to an Amazon S3 bucket.
Which combination of steps is required to achieve this?
Show answer
Correct answer: B. Configure an S3 event that invokes an AWS Lambda function, and insert the record into DynamoDB within that function.
Configuring an S3 event notification to invoke a Lambda function lets you insert a record into DynamoDB the moment a new file is added to the bucket, with no server management required.Because an S3 object-creation event serves as the trigger, processing runs almost simultaneously with the addition.
EventBridge (A) can also achieve this, but the option’s description is vague about the specific processing mechanism, and S3 event → Lambda is the most direct and standard method.
Polling with Lambda (C) incurs continuous polling cost and delay.
A cron job (D) runs on a schedule and does not meet the immediacy requirement of “as soon as it is added.”
Tutorial: Using an Amazon S3 trigger to invoke a Lambda function
Q9AWS Certified Developer Associate
Q9. A company has an application that uses an Amazon S3 bucket for object storage.
A developer needs to configure in-transit encryption for this S3 bucket.
In addition, all S3 objects containing personal data must be encrypted at rest with an AWS KMS key that can be rotated on demand.
Which combination of steps meets these requirements?
(Choose two.)
Show answer
Correct answer: C, D
The requirements are two-fold: in-transit encryption and at-rest encryption with a KMS key that can be rotated on demand.At-rest encryption can be satisfied by encrypting objects with an AWS KMS customer managed key (C). Customer managed keys can be rotated on demand.
In-transit encryption can be enforced by using the aws:SecureTransport condition in a bucket policy to allow only HTTPS connections (D). This is the standard method recommended by AWS.
The permissions boundary in A is for controlling IAM policies and cannot be used to enforce transport encryption in a bucket policy.
B is incorrect because an S3 bucket policy cannot enforce client-side encryption.
Block Public Access in E is a feature for preventing public exposure and is unrelated to enforcing encryption.
Using server-side encryption with AWS KMS keys
Q10AWS Certified Developer Associate
Q10. A company needs to configure secure database credentials for all of its AWS cloud resources.
The target resources include Amazon RDS DB instances, Amazon DocumentDB clusters, and Amazon Aurora DB instances.
The company’s security policy mandates that database credentials be encrypted at rest and rotated at regular intervals.
Which solution meets these requirements most securely?
Show answer
Correct answer: D. In the AWS Secrets Manager console, create an AWS Lambda function using the SecretsManagerRotationTemplate template. Create a secret for the database credentials in Secrets Manager and configure schedule-based rotation.
AWS Secrets Manager encrypts credentials at rest with AWS KMS and achieves schedule-based automatic rotation using rotation templates (SecretsManagerRotationTemplate) that support RDS, DocumentDB, and Aurora.This meets the requirements of encryption and rotation in the most secure and managed way.
IAM database authentication in A is not necessarily available for all engines and has a different purpose than the required credential rotation.
Parameter Store (SecureString) in B can encrypt at rest but does not natively provide automatic secret rotation.
S3 storage in C rotates the encryption key rather than the credentials themselves, and access management becomes cumbersome.
Rotating AWS Secrets Manager secrets
