Question

Difficulty: Very hardModernizing Workloads with Serverless Architectures (Lambda and API Gateway)

A smart-grid utility provider is modernizing its legacy telemetry collection backend by migrating to a serverless architecture on AWS. The system must process highly bursty, intermittent telemetry payloads from millions of smart meters via an API and write the processed records to an Amazon Aurora PostgreSQL database in a private subnet. The design must satisfy the following requirements:

1. Outbound internet traffic to third-party validation endpoints must be highly available and resilient to single Availability Zone failures.
2. The database must be protected from connection exhaustion during sudden traffic spikes.
3. Other critical microservices running in the same AWS account must be shielded from resource starvation caused by telemetry spikes.
4. Telemetry data must be encrypted with custom security policies and audit controls using AWS KMS.
5. Deployments of the backend code must shift traffic gradually to the new version over 1010 minutes and automatically roll back if errors occur.

Which of the following architectures meets these requirements while adhering to AWS best practices?

  1. Configure Amazon API Gateway with a regional endpoint integration to AWS Lambda. Deploy the Lambda functions in a private VPC spanning multiple Availability Zones, using Amazon RDS Proxy to manage database connection pooling. Deploy a NAT Gateway in each Availability Zone's public subnet to provide redundant outbound routes. Apply reserved concurrency to the ingestion Lambda function. Encrypt the data using an AWS KMS Customer Managed Key. Utilize AWS CodeDeploy with a canary deployment configuration, monitored by Amazon CloudWatch alarms, to shift traffic to new Lambda versions.Answer
  2. B
    Configure Amazon API Gateway with a regional endpoint integration to AWS Lambda. Deploy the Lambda functions in a private VPC spanning multiple Availability Zones, using Amazon RDS Proxy to manage database connection pooling. Deploy a NAT Gateway in each Availability Zone's public subnet to provide redundant outbound routes. Apply provisioned concurrency to the ingestion Lambda function to handle peak burst environments, keeping reserved concurrency unconfigured. Encrypt the data using an AWS KMS Customer Managed Key. Utilize AWS CodeDeploy with a canary deployment configuration, monitored by Amazon CloudWatch alarms, to shift traffic to new Lambda versions.
  3. C
    Configure Amazon API Gateway with a regional endpoint integration to AWS Lambda. Deploy the Lambda functions in a private VPC spanning multiple Availability Zones, using Amazon RDS Proxy to manage database connection pooling. Deploy a single NAT Gateway in one Availability Zone's public subnet to route all outbound validation traffic. Apply reserved concurrency to the ingestion Lambda function. Encrypt the data using an AWS KMS Customer Managed Key. Utilize AWS CodeDeploy with a canary deployment configuration, monitored by Amazon CloudWatch alarms, to shift traffic to new Lambda versions.
  4. D
    Configure Amazon API Gateway with a regional endpoint integration to AWS Lambda. Deploy the Lambda functions in a private VPC spanning multiple Availability Zones, using Amazon RDS Proxy to manage database connection pooling. Deploy a NAT Gateway in each Availability Zone's public subnet to provide redundant outbound routes. Apply reserved concurrency to the ingestion Lambda function. Encrypt the data using the default AWS-managed KMS key for Lambda. Utilize AWS CodeDeploy with a canary deployment configuration, monitored by Amazon CloudWatch alarms, to shift traffic to new Lambda versions.

Answer

The architecture that configures API Gateway with a regional Lambda integration, uses Amazon RDS Proxy, deploys redundant NAT Gateways across multiple Availability Zones, applies reserved concurrency to the ingestion function, encrypts data with an AWS KMS Customer Managed Key, and utilizes AWS CodeDeploy canary shifting with CloudWatch alarms.
The correct architecture leverages a multi-AZ VPC layout with redundant NAT Gateways to ensure that outbound third-party validation traffic is not disrupted by a single AZ outage. Utilizing Amazon RDS Proxy protects the Aurora PostgreSQL database by pooling database connections during telemetry traffic bursts. To prevent telemetry spikes from exhausting the AWS account's execution concurrency and throttling other microservices, the ingestion function is configured with reserved concurrency, which sets a hard limit on its maximum concurrent executions. Security compliance is met by encrypting data using an AWS KMS Customer Managed Key, which allows for custom key policies and audit controls, unlike the default AWS-managed key. Finally, using AWS CodeDeploy with a canary configuration and CloudWatch alarms satisfies the requirement for a gradual, monitored deployment with automated rollbacks.

Step-by-Step Solution

1
Analyze VPC networking and redundancy requirements for outbound validation traffic.
Identify that to prevent a single point of failure across Availability Zones, a NAT Gateway must be deployed in each AZ's public subnet, rather than relying on a single NAT Gateway.
Ensures high availability and resilience for outbound traffic if a single zone experiences an outage.
2
Evaluate database connection scaling and performance under high-burst traffic.
Determine that an Amazon RDS Proxy is required between AWS Lambda and the Aurora PostgreSQL database to manage connection pooling.
Prevents the database from running out of connections during rapid, concurrent Lambda scaling events.
3
Address resource contention and concurrency management for serverless functions in the same AWS account.
Identify that reserved concurrency must be configured on the telemetry ingestion Lambda function to cap its maximum execution count and guarantee concurrency is available for other services.
Provisioned concurrency alone does not restrict a function from scaling beyond its provisioned capacity and consuming the regional pool, potentially throttling other services.
4
Assess encryption and key management compliance requirements.
Select an AWS KMS Customer Managed Key (CMK) instead of the default AWS-managed KMS key.
Customer Managed Keys allow modification of key policies, which is necessary to define custom access controls and audit capabilities.
5
Formulate the deployment and rollback strategy.
Use AWS CodeDeploy with a canary deployment configuration (e.g., shifting traffic over 1010 minutes) and CloudWatch alarms for automated rollback.
Minimizes deployment risk by gradually shifting alias traffic and rolling back automatically upon alarm breaches.

Key Concept

Serverless Modernization with API Gateway and Lambda Concurrency/Network Controls
Rate this question