Soru

Zorluk: Çok zorModernizing Workloads with Serverless Architectures (Lambda and API Gateway)

A financial services firm is refactoring a legacy, on-premises stock-trading API into a serverless microservices architecture on AWS. The modernized solution uses Amazon API Gateway (regional endpoint) and AWS Lambda functions deployed inside private subnets of a VPC. The Lambda functions must execute trades by writing to an Amazon Aurora PostgreSQL database and must also communicate with a third-party regulatory compliance endpoint over the public internet.

The architecture must meet the following requirements:
- Prevent the trade-processing Lambda functions from exhausting the Aurora database's connection pool during peak market hours.
- Prevent trade-processing traffic spikes from consuming the entire regional Lambda concurrency pool, which would throttle other critical services in the same AWS account.
- Ensure high availability for all outbound internet traffic from the Lambda functions.
- Securely store and decrypt regulatory API credentials using AWS Systems Manager Parameter Store. The decryption key must support custom key policy modifications to delegate read-only access to a separate security auditing AWS account.
- Deploy updates to the Lambda function safely using gradual traffic shifting, with automatic rollback if CloudWatch alarms detect errors.

Which design strategy should the Solutions Architect implement to satisfy these requirements?

  1. A
    Deploy a single NAT Gateway in one Availability Zone to route all outbound internet traffic. Set up Amazon RDS Proxy in the VPC to manage database connections for the Lambda functions. Assign a reserved concurrency limit to the trade-processing Lambda function. Store the credentials as SecureString parameters in Parameter Store, encrypted with the default AWS-managed KMS key (aws/ssm), and attach an IAM policy to the auditing account allowing decryption of this key. Configure AWS CodeDeploy to perform a canary or linear deployment for Lambda function updates, with CloudWatch alarms configured to automatically roll back on errors.
  2. B
    Deploy redundant NAT Gateways across multiple Availability Zones in public subnets, and configure private subnet route tables to direct internet-bound traffic through their local NAT Gateway. Set up Amazon RDS Proxy in the VPC to manage database connections for the Lambda functions. Do not configure a reserved concurrency limit for the trade-processing Lambda function, allowing it to scale dynamically using the account's unreserved concurrency pool. Store the credentials as SecureString parameters in Parameter Store, encrypted with the default AWS-managed KMS key (aws/ssm), and configure the key policy of the aws/ssm key to permit decryption by the auditing account. Configure AWS CodeDeploy to perform a canary or linear deployment for Lambda function updates, with CloudWatch alarms configured to automatically roll back on errors.
  3. Deploy redundant NAT Gateways across multiple Availability Zones in public subnets, and configure private subnet route tables to direct internet-bound traffic through their local NAT Gateway. Set up Amazon RDS Proxy in the VPC to manage database connections for the Lambda functions. Assign a reserved concurrency limit to the trade-processing Lambda function. Store the credentials as SecureString parameters in Parameter Store, encrypted with a KMS Customer Managed Key (CMK), and configure the CMK's key policy to permit decryption by the auditing account and the Lambda execution role. Configure AWS CodeDeploy to perform a canary or linear deployment for Lambda function updates, with CloudWatch alarms configured to automatically roll back on errors.Cevap
  4. D
    Deploy redundant NAT Gateways across multiple Availability Zones in public subnets, and configure private subnet route tables to direct internet-bound traffic through their local NAT Gateway. Set up Amazon RDS Proxy in the VPC to manage database connections for the Lambda functions. Assign a reserved concurrency limit to the trade-processing Lambda function. Store the credentials as SecureString parameters in Parameter Store, encrypted with a KMS Customer Managed Key (CMK), and configure the CMK's key policy to permit decryption by the auditing account and the Lambda execution role. Configure AWS CodeDeploy to perform an all-at-once deployment for Lambda function updates, relying on manual rollbacks if CloudWatch alarms detect errors.

Cevap

Deploy redundant NAT Gateways across multiple Availability Zones, use Amazon RDS Proxy to manage database connections, set a reserved concurrency limit on the Lambda function, encrypt Parameter Store secrets using a Customer Managed Key with delegated key policy permissions, and use an AWS CodeDeploy canary or linear deployment configuration with automatic rollbacks.
The correct solution addresses every requirement in accordance with the AWS Well-Architected Framework: redundant NAT Gateways ensure high availability; Amazon RDS Proxy pools relational database connections; reserved concurrency limits the function's maximum capacity to protect the rest of the account; a KMS Customer Managed Key supports the custom key policy modifications needed for cross-account auditing; and AWS CodeDeploy canary or linear configurations shift traffic gradually with automatic rollbacks.

Adım Adım Çözüm

1
Configure redundant NAT Gateways across multiple Availability Zones in public subnets and update private subnet route tables.
Outbound traffic to the regulatory compliance endpoint remains highly available and resilient to a single Availability Zone failure.
Deploying only a single NAT Gateway introduces a single point of failure for private subnet egress.
2
Deploy Amazon RDS Proxy between the Lambda functions and the Aurora database.
Database connections are pooled and shared, reducing overhead and preventing connection exhaustion during traffic bursts.
AWS Lambda scales out rapidly, which can easily exhaust the connection limits of a relational database.
3
Set a reserved concurrency limit on the trade-processing Lambda function.
The function is capped at a specific concurrency limit, preserving the remainder of the regional pool for other services in the account.
Uncapped functions can consume the entire account's regional concurrency pool, causing throttling for other critical functions.
4
Create a KMS Customer Managed Key (CMK) and configure its key policy to delegate decryption permissions to both the Lambda execution role and the security auditing account.
The Systems Manager Parameter Store SecureString parameters are decrypted securely, and the auditing account can verify the key.
AWS-managed KMS keys do not support policy modification and cannot be used for cross-account delegation.
5
Configure AWS CodeDeploy with a Canary or Linear deployment configuration, linking CloudWatch alarms to the deployment group.
Traffic shifts gradually to the new Lambda version, and any spike in error rates triggers an automatic rollback.
All-at-once deployments do not satisfy the requirement for gradual shifting and risk substantial downtime if errors occur.

Anahtar Kavram

Modernizing legacy transactional applications with AWS Lambda and Amazon API Gateway requires careful orchestration of database connection pooling (RDS Proxy), concurrency management (Reserved Concurrency), redundant egress networking (multi-AZ NAT Gateways), cross-account security controls (KMS Customer Managed Key policies), and safe deployment automation (CodeDeploy gradual traffic shifting).
Bu soruyu puanla