TheArchitect

HTTP API Gateway (cost-optimised serverless)

AWS architecture template · HTTP API is ~70 % cheaper than REST API ($1.00 vs $3.50 per million calls). Use for simple Lambda proxy integrations without usage plans or API keys.

HTTP API Gateway (cost-optimised serverless) is a free AWS architecture template built with API Gateway, CloudWatch, DynamoDB, IAM and Lambda. Open it in TheArchitect to edit the diagram, estimate monthly cost, and export the CloudFormation or Terraform that deploys it.

HTTP API (chea…Lambda (arm64)Lambda RoleDynamoDB (on-d…P99 Latency Al…
HTTP API Gateway (cost-optimised serverless) architecture diagram

AWS services in this template

  • API Gateway
  • CloudWatch
  • DynamoDB
  • IAM
  • Lambda

Deployment notes

Deploy-ready

  • HTTP API auto-deploys on every change — no separate Deployment resource needed.
  • Lacks REST API features: no usage plans, no API keys, no request/response transforms, no WAF direct attach.
  • Costs ~$1.00/million requests vs REST API ~$3.50/million. Switch to REST API only when those features are required.

Generated CloudFormation — 5 resources

Logical IDResource type
HTTPAPIcheapapigatewayAWS::ApiGateway::RestApi
Lambdaarm64lambdaAWS::Lambda::Function
LambdaRoleiamAWS::IAM::Role
DynamoDBondemanddynamodbAWS::DynamoDB::Table
P99LatencyAlarmcloudwatchAWS::CloudWatch::Alarm
View the full CloudFormation template
{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "Generated by TheArchitect — https://www.thecloudarchitect.dev",
  "Metadata": {
    "TheArchitect": {
      "Edges": [
        {
          "From": "LambdaRoleiam",
          "To": "Lambdaarm64lambda",
          "Label": "execution role"
        },
        {
          "From": "Lambdaarm64lambda",
          "To": "DynamoDBondemanddynamodb",
          "Label": "CRUD"
        },
        {
          "From": "Lambdaarm64lambda",
          "To": "P99LatencyAlarmcloudwatch",
          "Label": "latency metrics"
        }
      ]
    }
  },
  "Resources": {
    "HTTPAPIcheapapigateway": {
      "Type": "AWS::ApiGateway::RestApi",
      "Properties": {
        "Name": "cost-http-api",
        "Description": "HTTP API — 70 % cheaper than REST API for simple Lambda proxy use cases",
        "EndpointConfiguration": {
          "Types": [
            "REGIONAL"
          ]
        }
      }
    },
    "Lambdaarm64lambda": {
      "Type": "AWS::Lambda::Function",
      "DependsOn": [
        "LambdaRoleiam"
      ],
      "Properties": {
        "FunctionName": "cost-http-api-handler",
        "Runtime": "nodejs20.x",
        "Handler": "index.handler",
        "MemorySize": 256,
        "Architectures": [
          "arm64"
        ],
        "Timeout": 10,
        "Description": "Lightweight CRUD handler — suitable for HTTP API proxy integration.",
        "Environment": {
          "Variables": {
            "APP_ENV": "demo",
            "LOG_LEVEL": "info"
          }
        },
        "TracingConfig": {
          "Mode": "Active"
        },
        "Code": {
          "ZipFile": "exports.handler = async (event) => ({ statusCode: 200, body: JSON.stringify({ ok: true, requestId: event.requestContext?.requestId || 'demo' }) });"
        },
        "Role": {
          "Fn::GetAtt": [
            "LambdaRoleiam",
            "Arn"
          ]
        }
      }
    },
    "LambdaRoleiam": {
      "Type": "AWS::IAM::Role",
      "Properties": {
        "RoleName": "cost-http-api-role",
        "Description": "Minimal Lambda execution role — CloudWatch Logs + DynamoDB CRUD only",
        "AssumeRolePolicyDocument": {
          "Version": "2012-10-17",
          "Statement": [
            {
              "Effect": "Allow",
              "Principal": {
                "Service": "lambda.amazonaws.com"
              },
              "Action": "sts:AssumeRole"
            }
          ]
        },
        "ManagedPolicyArns": [
          "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
        ]
      }
    },
    "DynamoDBondemanddynamodb": {
      "Type": "AWS::DynamoDB::Table",
      "Properties": {
        "TableName": "cost-http-api-items",
        "BillingMode": "PAY_PER_REQUEST",
        "AttributeDefinitions": [
          {
            "AttributeName": "id",
            "AttributeType": "S"
          }
        ],
        "KeySchema": [
          {
            "AttributeName": "id",
            "KeyType": "HASH"
          }
        ],
        "PointInTimeRecoverySpecification": {
          "PointInTimeRecoveryEnabled": true
        },
        "SSESpecification": {
          "SSEEnabled": true
        }
      }
    },
    "P99LatencyAlarmcloudwatch": {
      "Type": "AWS::CloudWatch::Alarm",
      "Properties": {
        "AlarmName": "cost-http-api-p99-latency",
        "Namespace": "AWS/ApiGateway",
        "MetricName": "IntegrationLatency",
        "Period": 60,
        "EvaluationPeriods": 5,
        "Threshold": 1000,
        "ComparisonOperator": "GreaterThanThreshold",
        "TreatMissingData": "notBreaching",
        "ExtendedStatistic": "p99"
      }
    }
  }
}

Generated by TheArchitect from the diagram above. Review values such as names, CIDR ranges and instance sizes before deploying to your account.

Related templates