Soru

Zorluk: OrtaModernizing Workloads with Serverless Architectures (Lambda and API Gateway)

A financial services company is modernizing its on-premises core transaction processing API by refactoring it to a serverless architecture on AWS. The new architecture uses an Amazon API Gateway regional REST API integrated with AWS Lambda functions deployed in private subnets, which write transactions to an Amazon RDS for PostgreSQL database. The database is hosted in a dedicated database account, while the API Gateway and Lambda functions are hosted in an application account. During peak hours, transaction volume spikes unpredictably. The company must ensure that database connection limits are not exceeded, Lambda executions do not exhaust the regional concurrency limit, and database credentials stored in AWS Secrets Manager in the database account are automatically rotated using a cross-account IAM role.

Which architectural design meets these requirements?

  1. A
    Configure Amazon RDS Proxy in the database account. Store the database credentials in AWS Secrets Manager in the database account, encrypted with the default AWS-managed key (aws/secretsmanager). Grant the application account's Lambda execution role permission to decrypt using this AWS-managed key, and configure the Lambda functions with a reserved concurrency limit.
  2. B
    Configure Amazon RDS Proxy in the database account. Store the database credentials in AWS Secrets Manager in the database account, encrypted with an AWS KMS Customer Managed Key (CMK) configured with a cross-account key policy. Allow the Lambda functions to execute with unconstrained concurrency to maximize throughput, relying on API Gateway throttling and the RDS Proxy connection queue to manage database load.
  3. Configure Amazon RDS Proxy in the database account. Store the database credentials in AWS Secrets Manager in the database account, encrypted with an AWS KMS Customer Managed Key (CMK) configured with a cross-account key policy. Configure the Lambda functions in the application account to connect via the RDS Proxy, and set a specific reserved concurrency limit on the Lambda functions. Configure the Secrets Manager rotation Lambda to decrypt the credentials using the CMK.Cevap
  4. D
    Configure Amazon RDS Proxy in the database account. Store the database credentials in AWS Secrets Manager in the database account, encrypted with an AWS KMS Customer Managed Key (CMK) configured with a cross-account key policy. Deploy the Lambda functions in the application VPC across multiple Availability Zones, routing all outbound internet and cross-account traffic through a single NAT Gateway located in one Availability Zone to minimize NAT Gateway hourly costs, and set a reserved concurrency limit.

Cevap

Configure Amazon RDS Proxy in the database account. Store the credentials in AWS Secrets Manager encrypted with an AWS KMS Customer Managed Key (CMK) with a cross-account key policy. Set a reserved concurrency limit on the application account Lambda functions to protect regional concurrency pools, and configure the rotation Lambda to decrypt credentials using the CMK.
The correct design uses Amazon RDS Proxy to pool database connections and protect PostgreSQL from exhaustion. A Customer Managed Key (CMK) is used to encrypt database credentials in AWS Secrets Manager because it supports custom cross-account key policies, enabling the application account's Lambda functions to decrypt the secret. Setting a reserved concurrency limit on the Lambda function prevents it from scaling out of control, protecting both the database proxy connection limits and the regional Lambda concurrency pool.

Adım Adım Çözüm

1
Address database connection exhaustion during peak traffic bursts.
Introduce Amazon RDS Proxy to establish connection pooling and reuse database connections.
Lambda functions scale rapidly and can easily exceed PostgreSQL connection limits if they establish direct connections.
2
Ensure secure, cross-account access and automatic rotation of database credentials.
Use AWS Secrets Manager with a Customer Managed Key (CMK) and set up cross-account policies.
AWS-managed KMS keys cannot have their key policies modified to allow access from other accounts, necessitating a Customer Managed Key.
3
Implement concurrency protection to secure the regional account limit.
Configure a reserved concurrency limit on the Lambda functions in the application account.
Reserved concurrency isolates the function's scaling capability, preventing it from consuming the entire regional concurrency pool (which would throttle other services).

Anahtar Kavram

Cross-account KMS policies, Amazon RDS Proxy connection pooling, and AWS Lambda reserved concurrency management.
Tahmini Süre:2m 30s
Bu soruyu puanla