API Gateway HTTP API Deployer
Mindset
One-line takeaway: an HTTP API (v2) is not "a cheaper REST API"
— it is a simpler, faster, event-shaped routing product where every
route binds directly to a typed integration (Lambda proxy, HTTP proxy,
VPC link, Step Functions, SQS, Kinesis), authorization is JWT-only,
there are no mapping templates, and stages default to auto-deploy.
The route table and the JWT authorizer are the load-bearing decisions;
CORS, logging, and custom domain are deterministic follow-ons.
The three differentiators (flat routes, typed integrations, JWT-only +
auto-deploy defaults): references/advanced-patterns.md.
Quick reference — deployment checklist
| Dimension |
Requirement |
Step |
| API type |
HTTP (v2) — confirm feature fit (no usage plans, no mapping templates) |
Step 1 |
| Routes |
Flat (method, path) list including ANY, GET, POST, {proxy+} |
Step 2 |
| Integration |
Lambda proxy, HTTP proxy, VPC link, Step Functions, SQS, Kinesis |
Step 3 |
| Authorization |
JWT (OIDC issuer + audience) or AWS_IAM (NONE only for public) |
Step 4 |
| CORS |
API-level allow-origins, methods, headers, preflight max-age |
Step 5 |
| Stage auto-deploy |
auto-deploy: true (default) or pinned to a deployment |
Step 6 |
| Access logging |
JSON $context to CloudWatch Logs |
Step 7 |
| Custom domain |
ACM cert + API mapping (no base path) |
Step 8 |
| WAFv2 Web ACL |
REGIONAL scope, associated with stage |
Step 9 |
| Throttle / quotas |
Per-route throttle + account default |
Step 10 |
Pre-flight: deployment specification gate
Before producing the deployment plan, validate the input specification.
Several requirements block deployment — proceeding with an invalid
spec produces a non-functional or insecure API.
IAM permission sweep, Lambda invoke permission, NLB/AZ check, JWKS
reachability, ACM ISSUED check: references/diagnostic-commands.md.
| Attribute |
Value |
Effect on plan |
protocolType |
HTTP |
Required. HTTP API is its own product, not a REST API mode. |
routeKey |
METHOD /path |
Flat route. ANY /{proxy+} is the catch-all greedy route. |
| Integration type |
AWS_PROXY / HTTP_PROXY / HTTP / AWS (Step Functions / SQS / Kinesis) |
Determines the request/response contract. |
| Authorization |
JWT |
OpenID Connect issuer + audience. The only user-facing authorizer. |
| Authorization |
AWS_IAM |
Sigv4. Service-to-service. |
| Authorization |
NONE |
Public. Acceptable ONLY for health checks or genuinely public routes. |
auto-deploy |
true / false |
Default true on $default stage. Pins to deployment if false. |
If the deployment spec is incomplete (missing routes, integration
type, or JWT issuer for an authorized route), output:
API_SPEC: <name-or-unknown>
VERDICT: PREREQUISITES_MISSING
REASON: Deployment specification is missing required fields (<list>).
Cannot produce a deployment plan without <field> — the resulting API
would be non-functional or insecure.
REQUIRED:
- routes (method + path, including ANY / {proxy+})
- integration_type (AWS_PROXY / HTTP_PROXY / VPC_LINK / STEP_FUNCTION / SQS / KINESIS)
- authorization (JWT / AWS_IAM / NONE) with issuer + audience for JWT
STRICT output contract
When this skill is invoked with an HTTP API provisioning request
(routes, integration targets, JWT authorizer, CORS, logging, custom
domain, or a partial configuration), the agent MUST respond with the
deployment plan defined in the "Output format" section using the
literal all-caps labels API_SPEC:, VERDICT:, ARCHITECTURE:,
CHECKLIST:, FINDINGS:, and DEPLOY_COMMANDS:. Do NOT preface the
block with prose, headings, or disclaimers — emit it as the first lines
of the response. This contract is what assertion-based evals and
downstream provisioning pipelines rely on; deviating from the literal
labels breaks automation silently.
If any prerequisite is missing, the verdict is
PREREQUISITES_MISSING with a specific gap citation in the checklist
(marked [✗]), and READY_TO_DEPLOY MUST NOT also appear. The two
verdicts are mutually exclusive.
Quick navigation
| Section |
When to read |
| Pre-flight specification gate |
Always — verify before planning |
| Step 0 — Expert heuristic: auto-deploy vs pinned deployments |
Choosing stage mode |
| Step 1 — HTTP API vs REST API fit |
Boundary call |
| Step 2 — Route model (ANY, GET, POST, {proxy+}) |
Route design |
| Step 3 — Integration targets (Lambda / HTTP / VPC / SFN / SQS / Kinesis) |
Backend wiring |
| Step 4 — JWT authorizer (OIDC issuer + audience) |
Authorization |
| Step 5 — CORS configuration |
Browser clients |
| Step 6 — Stage auto-deploy |
Continuous deployment |
| Step 7 — Access logging |
Observability |
| Step 8 — Custom domain (API mapping) |
Vanity URL |
| Step 9 — WAFv2 Web ACL |
Edge security |
| Step 10 — Throttle and quotas |
Abuse prevention |
| NEVER do these things |
Review before signing off |
| Output format |
The literal plan template |
| references/integrations-and-routes-reference.md |
Per-integration contract detail |
| references/jwt-cors-domain-auto-deploy-reference.md |
Authorizer + CORS + auto-deploy deep dive |
Process — Architecture planning (apply in order, produce deployment plan)
Step 0: Expert heuristic — auto-deploy vs pinned deployment stages
HTTP API stages behave opposite to REST API stages. A baseline
model trained on REST API assumes you must call create-deployment for
any change to go live. On HTTP API, the $default stage has
auto-deploy: true by default, meaning every route, integration, and
authorizer change is live within seconds without a deployment call.
create-api → $default stage auto-created with auto-deploy: true
operator adds / modifies a route or integration
→ API Gateway evaluates against $default
→ deployment auto-created within seconds
→ change is LIVE
if auto-deploy: false (pinned stage)
→ changes accumulate but are NOT served
→ must create-deployment + update-stage to pin
Implications:
- For continuous-deployment pipelines (CodePipeline, SAM, CloudFormation
with
AWS::ApiGatewayV2::Deployment), leave auto-deploy: true and
let the framework manage routes. Adding a synthetic
AWS::ApiGatewayV2::Deployment resource on top races with auto-deploy
and produces drift.
- For gated releases, set
auto-deploy: false, then use
create-deployment and update-stage to swap versions.
- A pinned stage with no current deployment serves 404 for every
route — the routes exist in configuration but the stage has no
snapshot. Always emit a deployment when pinning.
Step 1: HTTP API (v2) vs REST API (v1) — feature fit
| Dimension |
HTTP API (v2) |
REST API (v1) |
| Cost per million requests |
$1.00 |
$3.50 |
| Latency |
~30% lower |
Higher |
| Mapping templates (VTL) |
No |
Yes |
| Usage plans + API keys |
No |
Yes |
| Resource policies |
No |
Yes |
| Authorization |
JWT, AWS_IAM |
AWS_IAM, COGNITO_USER_POOLS, CUSTOM |
| EDGE endpoint |
No |
Yes |
| PRIVATE endpoint |
Yes (VPC link / Lattice) |
Yes |
| WAF association |
Yes |
Yes |
| Custom domains |
Yes (REGIONAL) |
Yes (EDGE + REGIONAL) |
| Stage model |
auto-deploy by default |
create-deployment required |
| Direct AWS integrations |
Step Functions, SQS, Kinesis |
Broader (DynamoDB, SNS, SQS, Kinesis, Step Functions) |
| Canary |
No (use stage swap) |
Yes |
Decision rule — pick HTTP API when ALL of these hold:
- Auth is JWT (OIDC/Cognito) or AWS_IAM.
- No mapping templates required.
- No per-consumer usage plans or API keys required.
- No EDGE endpoint required.
Otherwise, REST API is the right product. See the
apigateway-rest-deployer skill for the v1 plan.
Step 2: Route model (ANY, GET, POST, {proxy+})
Routes are flat (method, path) pairs. The greedy {proxy+} matches
one or more path segments.
$default → catch-all for ANY method and any path
ANY /{proxy+} → greedy route (every method, every sub-path)
GET /health → exact route
GET /users → exact route
POST /users → exact route
GET /users/{userId} → path parameter
ANY /users/{proxy+} → greedy under /users
$default vs ANY /{proxy+}: $default is the API-level fallback
for any unmatched route. ANY /{proxy+} is a route that matches the
greedy pattern. $default is the only route that handles ANY for all
paths without appearing in the route table.
CORS preflight: when CORS is enabled, API Gateway synthesizes
OPTIONS responses for routes with matching origins. You do NOT add
OPTIONS routes manually. An explicit OPTIONS /path route overrides
the synthesized response — only do this for non-standard headers.
ANY + NONE auth is the most dangerous route configuration in HTTP
API. ANY /{proxy+} with authorizationType: NONE exposes every
method (GET, POST, PUT, PATCH, DELETE) on every sub-path without auth.
Always bind an authorizer to catch-all routes.
aws apigatewayv2 create-route --api-id <id> \
--route-key "POST /users" \
--target integrations/<integration-id> \
--authorizer-id <authorizer-id> \
--authorization-type JWT
Step 3: Integration targets
| Type |
Subtype |
When to use |
AWS_PROXY |
Lambda proxy |
Default for Lambda. Full request as JSON event. Lambda returns {statusCode, headers, body}. |
HTTP_PROXY |
HTTP pass-through |
External HTTP endpoint, no transform. VPC link connections use this. |
HTTP |
HTTP with transform |
External HTTP endpoint with header/path rewrite (limited). |
AWS |
STEP_FUNCTION (START_EXECUTION / START_SYNC_EXECUTION) |
Trigger Express Workflow synchronously or Standard async without Lambda. |
AWS |
SQS (SendMessage) |
Drop message to SQS queue directly. |
AWS |
KINESIS (PutRecord / PutRecords) |
Stream record to Kinesis directly. |
create-integration / add-permission / create-vpc-link command set for
every integration type: references/integrations-and-routes-reference.md.
Step 4: JWT authorizer (OpenID Connect / Cognito)
HTTP API exposes one authorizer type: JWT. API Gateway fetches the
JWKS from <issuer>/.well-known/openid-configuration automatically.
aws apigatewayv2 create-authorizer --api-id <id> \
--name oidc-auth --authorizer-type JWT \
--identity-source '$request.header.Authorization' \
--jwt-configuration audience=<client-id>,issuer=https://<issuer-domain>/
For Cognito user pools, the issuer is
https://cognito-idp.<region>.amazonaws.com/<user-pool-id>/ (trailing
slash required) and the audience is the app client id.
Critical JWT rules (HTTPS + trailing slash, aud matching, identity-source,
caching TTL): references/jwt-cors-domain-auto-deploy-reference.md.
aws apigatewayv2 update-route --api-id <id> --route-id <rid> \
--authorizer-id <authorizer-id> --authorization-type JWT
AWS_IAM is set per-route with --authorization-type AWS_IAM (no
authorizer ID needed). There is no Lambda authorizer on HTTP API;
if you need one, use REST API instead.
Step 5: CORS configuration
CORS is set at the API level. API Gateway synthesizes OPTIONS
preflight responses for any route whose Access-Control-Allow-Origin
matches the request origin.
aws apigatewayv2 update-api --api-id <id> \
--cors-configuration allowOrigins=https://app.example.com,https://admin.example.com,allowMethods=GET,POST,PUT,DELETE,OPTIONS,allowHeaders=Authorization,Content-Type,X-Request-Id,exposeHeaders=X-Request-Id,X-Trace-Id,maxAge=600,allowCredentials=true
Critical CORS rules:
allowCredentials=true forbids allowOrigins=*. List origins
explicitly when cookies or Authorization headers cross domains.
OPTIONS MUST be in allowMethods, or preflight responses are
incomplete and browsers block the call.
Authorization MUST be in allowHeaders if the API uses a JWT
authorizer — otherwise the browser cannot send the Bearer token.
- CORS does NOT authorize server-side; it tells the browser whether to
expose the response to JavaScript. JWT still governs access.
Step 6: Stage and auto-deploy
$default stage is created automatically with auto-deploy: true.
aws apigatewayv2 update-stage --api-id <id> --stage-name '$default' --auto-deploy true
# Named stage:
aws apigatewayv2 create-stage --api-id <id> --stage-name prod --auto-deploy true
# Pinned (release-gated) stage:
aws apigatewayv2 create-deployment --api-id <id>
aws apigatewayv2 update-stage --api-id <id> --stage-name prod \
--auto-deploy false --deployment-id <deployment-id>
Never set auto-deploy: false without a current deployment-id —
the stage serves 404 until a deployment is pinned.
Step 7: Access logging (JSON)
Access-log settings command + Logs Insights query:
references/diagnostic-commands.md.
Step 8: Custom domain (API mapping)
aws apigatewayv2 create-domain-name --domain-name api.example.com \
--domain-name-configurations certificateArn=arn:aws:acm:<region>:<account>:certificate/<id>,securityPolicy=TLS_1_2
aws apigatewayv2 create-api-mapping --domain-name api.example.com \
--api-id <api-id> --stage '$default' --api-mapping-key ''
- Empty
api-mapping-key maps the apex of the domain to the stage.
- Non-empty key (e.g.,
v1) maps api.example.com/v1 to the stage.
- HTTP API does NOT support EDGE custom domains; the cert must be in
the API's region (
REGIONAL).
Step 9: WAFv2 Web ACL
aws apigatewayv2 associate-web-acl \
--web-acl-arn arn:aws:wafv2:<region>:<account>:regional/webacl/prod-http-waf/<id> \
--resource-arn arn:aws:apigateway:<region>::/apis/<api-id>/stages/$default
WAF scope is REGIONAL for HTTP API (EDGE not supported).
Recommended managed rules: AWSManagedRulesCommonRuleSet,
AWSManagedRulesKnownBadInputsRuleSet, and a rate-based rule (e.g.,
2000 requests per 5 minutes per IP).
Step 10: Throttle and quotas
HTTP API does not have usage plans or API keys. Throttle is set at the
API and route level:
aws apigatewayv2 update-route --api-id <id> --route-id <rid> \
--route-settings throttlingRateLimit=100,throttlingBurstLimit=200
aws apigatewayv2 update-stage --api-id <id> --stage-name '$default' \
--default-route-settings throttlingRateLimit=1000,throttlingBurstLimit=500
For per-consumer quotas, use WAF rate-based rules keyed on API key
header or JWT claim — there is no native usage plan on HTTP API. If you
need true per-consumer throttling, switch to REST API.
Expert heuristic: $default stage race with Infrastructure-as-Code
IaC race resolution heuristics (auto-deploy vs pinned Deployment
resource): references/advanced-patterns.md.
Expert heuristic: greedy {proxy+} route precedence and the ANY trap
Route precedence table and the ANY-trap secure pattern:
references/advanced-patterns.md.
Output format (per HTTP API deployment plan)
API_SPEC: <name>
VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING
ARCHITECTURE:
Type: HTTP (v2)
Endpoint: REGIONAL (<region>)
Routes:
- GET /health [NONE]
- GET /users [JWT]
- POST /users [JWT]
- GET /users/{userId} [JWT]
- ANY /{proxy+} [JWT]
Integrations:
- Lambda proxy: users-handler
- Step Functions START_SYNC_EXECUTION: orders-workflow
Authorization: JWT (issuer https://cognito-idp.<region>.amazonaws.com/<pool>/, audience <client-id>)
CORS: allowOrigins=https://app.example.com, allowCredentials=true
Stage: '$default' (auto-deploy=true)
WAF: <associated ARN> | none
Custom domain: api.example.com (ACM cert ARN, API mapping key '')
Logging: CloudWatch JSON access logs to <log-group>
CHECKLIST:
[x] HTTP API feature fit confirmed (no usage plans / mapping templates / EDGE)
[x] Routes defined (method + path, ANY / {proxy+} flagged)
[x] Integrations configured (AWS_PROXY / HTTP_PROXY / STEP_FUNCTION / SQS / KINESIS)
[x] JWT authorizer with HTTPS issuer + audience verified
[x] CORS with allowOrigins + Authorization header + OPTIONS
[x] Stage auto-deploy explicitly set (true | false + deployment-id)
[x] Access logging to CloudWatch (JSON with $context)
[x] WAFv2 REGIONAL Web ACL associated with stage
[x] Custom domain via ACM + API mapping (REGIONAL only)
[x] Throttle set per route (rate + burst) or via WAF
FINDINGS:
- [INFO] Estimated cost: $1.00/M requests + data transfer
- [WARN] No native usage plans — per-consumer throttling via WAF or external
DEPLOY_COMMANDS:
<ordered list of aws apigatewayv2 commands>
Verification commands (run after deployment)
get-api / get-routes / get-integrations / get-authorizer / CORS / stage /
WAF / api-mappings + live curl checks: references/diagnostic-commands.md.
Edge-case handling
Edge cases ($default 404 after pinning, JWT trailing slash, aud mismatch,
CORS wildcard+credentials, ALB VPC link, credentials-arn scope): references/advanced-patterns.md.
NEVER do these things
NEVER use ANY /{proxy+} with authorizationType: NONE. ANY
matches every method (GET, POST, PUT, PATCH, DELETE) on every
sub-path. Combined with {proxy+} (greedy) and no authorizer, this
exposes every backend operation without authentication. Always bind
a JWT or AWS_IAM authorizer to catch-all routes, or split the greedy
into explicit verbs.
NEVER use HTTP API when you need usage plans, API keys, mapping
templates, resource policies, EDGE endpoints, or Lambda authorizers.
HTTP API lacks all of these features. Switch to REST API (v1) and
use the apigateway-rest-deployer skill. The cost of re-platforming
to REST is far smaller than building workarounds.
NEVER set auto-deploy: false without a current deployment-id.
A pinned stage without a deployment serves 404 for every route.
Always emit create-deployment immediately before pinning.
NEVER trust allowOrigins=* with allowCredentials=true. This
is a hard AWS rejection. With credentials (cookies, Authorization
header), you MUST enumerate explicit origins. The combination of
wildcard + credentials is also a browser-level CORS violation that
browsers block independently.
NEVER create a JWT authorizer with a non-HTTPS issuer or a missing
trailing slash on Cognito. The issuer MUST be HTTPS (HTTP issuers
are rejected). For Cognito user pools, the URL MUST end with a
trailing slash (https://cognito-idp.<region>.amazonaws.com/<pool>/).
A missing slash is the #1 cause of authorizer creation failure.
Additional hard constraints: never scope the credentials-arn IAM role
for direct SQS / Kinesis / Step Functions integrations with wildcards
(privilege escalation path); never use EDGE custom domains on HTTP API
(REGIONAL only — request ACM cert in API region); never mix
AWS::ApiGatewayV2::Deployment with auto-deploy: true (races and
produces drift); never add explicit OPTIONS routes when CORS is
enabled (API Gateway synthesizes preflight); never skip
lambda:AddPermission for the apigateway.amazonaws.com principal.
Pre-flight safety checks (run before any deployment CLI)
All checks (confirmation gate quote, authorizer sweep, issuer reachability,
CORS, ACM region, cost estimate): references/advanced-patterns.md.
Remediation guidance
Ordering principle + fixes for JWT issuer, VPC link to ALB, REST features
required: references/error-handling.md.
References (load on demand)
- Error handling - remediation ordering principle + fixes: JWT issuer unreachable, VPC link to ALB, REST features required
- Diagnostic commands - live-account pre-flight checks, access-log setup, post-deployment verification commands
- Advanced patterns - three differentiators, IaC auto-deploy race, ANY/{proxy+} trap, edge cases, safety gate, recent features
- Integrations and routes - per-integration contracts; create-integration command set
- JWT / CORS / domain / auto-deploy - authorizer deep dive; critical JWT config rules
Domain
AWS CloudOps / API Gateway HTTP API (v2) Provisioning.
Recent AWS features (2024-2026)
Recent AWS features — Step Functions direct, VPC Lattice, mTLS, OpenAPI
3.1 import, CORS wildcards: references/advanced-patterns.md.
AWS documentation
1---2name: apigateway-http-api-deployer3description: Provisions production-grade API Gateway HTTP APIs (v2) with routes (ANY, GET, POST, {proxy+} greedy), integration targets (Lambda proxy AWS_PROXY, HTTP proxy, VPC link private integration, Step Functions START_EXECUTION, SQS SendMessage, Kinesis PutRecord), JWT authorizer backed by OpenID Connect / Cognito issuer, CORS configuration with preflight handling, JSON access logging to CloudWatch with $context variables, stage auto-deploy for continuous deployment, custom domain via ACM with API mapping, and WAFv2 REGIONAL Web ACL association. Emits a READY_TO_DEPLOY checklist and ordered aws apigatewayv2 commands. Use when provisioning an HTTP API, configuring JWT/OIDC authorizers, setting up CORS, integrating Step Functions / SQS / Kinesis from HTTP API, deploying VPC link private integrations, or enabling auto-deploy stages.4license: Apache-2.05compatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline architecture planning. Live deployment uses aws apigatewayv2 create-api, create-route, create-integration, create-authorizer, create-stage, update-stage, create-domain-name, create-api-mapping, update-route, and aws wafv2 associate-web-acl (AWS CLI v2, SSO or key-based credentials).6metadata:7 source: https://skillmd.com/skills/jhkchan/apigateway-http-api-deployer8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '1'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: AppIntegration15 task_type: deploy16 skill_class: capability17 lifecycle_status: active18 verdict_shape: READY_TO_DEPLOY | PREREQUISITES_MISSING19 when_to_use: Provisioning a new API Gateway HTTP API (v2) for production, configuring Lambda proxy (AWS_PROXY) or HTTP_PROXY integrations, setting up a JWT authorizer backed by OpenID Connect or Cognito, enabling CORS with preflight, integrating Step Functions / SQS / Kinesis directly from HTTP API, deploying private integrations via VPC link to an NLB, enabling stage auto-deploy for continuous deployment, configuring JSON access logging, mapping a custom domain name via ACM, or associating a WAFv2 REGIONAL Web ACL.20 activation_triggers: create an HTTP API, provision API Gateway v2, API Gateway HTTP API, Lambda proxy HTTP API, JWT authorizer HTTP API, OIDC authorizer API Gateway, CORS configuration API Gateway, Step Functions HTTP API, SQS API Gateway integration, Kinesis API Gateway integration, VPC link private integration, auto-deploy stage, API Gateway custom domain, REST to HTTP migration21 invocation_schema: 'Input shape (one of): (a) a deployment specification including routes (method + path, including ANY and {proxy+}), integration targets (Lambda, HTTP_PROXY, VPC_LINK, STEP_FUNCTION, SQS, KINESIS), JWT authorizer issuer/audience, CORS requirements, logging, auto-deploy, custom domain, WAF; (b) a partial spec for interactive refinement; (c) an existing HTTP API ID for architecture review. Output shape: { API_SPEC, VERDICT, ARCHITECTURE, CHECKLIST[], FINDINGS[], DEPLOY_COMMANDS } where VERDICT ∈ { READY_TO_DEPLOY, PREREQUISITES_MISSING, ERROR }.'22 version: 0.1.023 author: Jacky Chan — AWS Community Builder24 keywords: API Gateway, HTTP API, API Gateway v2, apigatewayv2, route, ANY method, proxy path, Lambda proxy, AWS_PROXY, HTTP proxy, HTTP_PROXY, VPC link, private integration, Step Functions, START_EXECUTION, SQS integration, Kinesis integration, JWT authorizer, OpenID Connect, OIDC, Cognito, CORS, preflight, access logging, auto-deploy, stage, custom domain, ACM, API mapping, WAFv2, Web ACL25 tags: apigateway, app-integration, deploy, http-api, apigatewayv2, lambda-proxy, jwt-authorizer, oidc, cors, vpc-link, step-functions, auto-deploy, access-logging, custom-domain, waf26---2728# API Gateway HTTP API Deployer2930## Mindset3132**One-line takeaway:** an HTTP API (v2) is not "a cheaper REST API"33— it is a **simpler, faster, event-shaped routing product** where every34route binds directly to a typed integration (Lambda proxy, HTTP proxy,35VPC link, Step Functions, SQS, Kinesis), authorization is JWT-only,36there are no mapping templates, and stages default to **auto-deploy**.37The route table and the JWT authorizer are the load-bearing decisions;38CORS, logging, and custom domain are deterministic follow-ons.3940The three differentiators (flat routes, typed integrations, JWT-only +41auto-deploy defaults): [references/advanced-patterns.md](references/advanced-patterns.md).4243## Quick reference — deployment checklist4445| Dimension | Requirement | Step |46|---|---|---|47| API type | HTTP (v2) — confirm feature fit (no usage plans, no mapping templates) | Step 1 |48| Routes | Flat `(method, path)` list including ANY, GET, POST, `{proxy+}` | Step 2 |49| Integration | Lambda proxy, HTTP proxy, VPC link, Step Functions, SQS, Kinesis | Step 3 |50| Authorization | JWT (OIDC issuer + audience) or AWS_IAM (NONE only for public) | Step 4 |51| CORS | API-level allow-origins, methods, headers, preflight max-age | Step 5 |52| Stage auto-deploy | `auto-deploy: true` (default) or pinned to a deployment | Step 6 |53| Access logging | JSON `$context` to CloudWatch Logs | Step 7 |54| Custom domain | ACM cert + API mapping (no base path) | Step 8 |55| WAFv2 Web ACL | REGIONAL scope, associated with stage | Step 9 |56| Throttle / quotas | Per-route throttle + account default | Step 10 |5758## Pre-flight: deployment specification gate5960Before producing the deployment plan, validate the input specification.61Several requirements **block deployment** — proceeding with an invalid62spec produces a non-functional or insecure API.6364IAM permission sweep, Lambda invoke permission, NLB/AZ check, JWKS65reachability, ACM ISSUED check: [references/diagnostic-commands.md](references/diagnostic-commands.md).6667| Attribute | Value | Effect on plan |68|---|---|---|69| `protocolType` | `HTTP` | Required. HTTP API is its own product, not a REST API mode. |70| `routeKey` | `METHOD /path` | Flat route. `ANY /{proxy+}` is the catch-all greedy route. |71| Integration type | `AWS_PROXY` / `HTTP_PROXY` / `HTTP` / `AWS` (Step Functions / SQS / Kinesis) | Determines the request/response contract. |72| Authorization | `JWT` | OpenID Connect issuer + audience. The only user-facing authorizer. |73| Authorization | `AWS_IAM` | Sigv4. Service-to-service. |74| Authorization | `NONE` | Public. Acceptable ONLY for health checks or genuinely public routes. |75| `auto-deploy` | `true` / `false` | Default `true` on `$default` stage. Pins to deployment if `false`. |7677**If the deployment spec is incomplete** (missing routes, integration78type, or JWT issuer for an authorized route), output:7980```text81API_SPEC: <name-or-unknown>82VERDICT: PREREQUISITES_MISSING83REASON: Deployment specification is missing required fields (<list>).84Cannot produce a deployment plan without <field> — the resulting API85would be non-functional or insecure.86REQUIRED:87 - routes (method + path, including ANY / {proxy+})88 - integration_type (AWS_PROXY / HTTP_PROXY / VPC_LINK / STEP_FUNCTION / SQS / KINESIS)89 - authorization (JWT / AWS_IAM / NONE) with issuer + audience for JWT90```9192## STRICT output contract9394When this skill is invoked with an HTTP API provisioning request95(routes, integration targets, JWT authorizer, CORS, logging, custom96domain, or a partial configuration), the agent MUST respond with the97deployment plan defined in the "Output format" section using the98literal all-caps labels `API_SPEC:`, `VERDICT:`, `ARCHITECTURE:`,99`CHECKLIST:`, `FINDINGS:`, and `DEPLOY_COMMANDS:`. Do NOT preface the100block with prose, headings, or disclaimers — emit it as the first lines101of the response. This contract is what assertion-based evals and102downstream provisioning pipelines rely on; deviating from the literal103labels breaks automation silently.104105If any prerequisite is missing, the verdict is106`PREREQUISITES_MISSING` with a specific gap citation in the checklist107(marked `[✗]`), and `READY_TO_DEPLOY` MUST NOT also appear. The two108verdicts are mutually exclusive.109110## Quick navigation111112| Section | When to read |113|---|---|114| Pre-flight specification gate | Always — verify before planning |115| Step 0 — Expert heuristic: auto-deploy vs pinned deployments | Choosing stage mode |116| Step 1 — HTTP API vs REST API fit | Boundary call |117| Step 2 — Route model (ANY, GET, POST, {proxy+}) | Route design |118| Step 3 — Integration targets (Lambda / HTTP / VPC / SFN / SQS / Kinesis) | Backend wiring |119| Step 4 — JWT authorizer (OIDC issuer + audience) | Authorization |120| Step 5 — CORS configuration | Browser clients |121| Step 6 — Stage auto-deploy | Continuous deployment |122| Step 7 — Access logging | Observability |123| Step 8 — Custom domain (API mapping) | Vanity URL |124| Step 9 — WAFv2 Web ACL | Edge security |125| Step 10 — Throttle and quotas | Abuse prevention |126| NEVER do these things | Review before signing off |127| Output format | The literal plan template |128| references/integrations-and-routes-reference.md | Per-integration contract detail |129| references/jwt-cors-domain-auto-deploy-reference.md | Authorizer + CORS + auto-deploy deep dive |130131## Process — Architecture planning (apply in order, produce deployment plan)132133### Step 0: Expert heuristic — auto-deploy vs pinned deployment stages134135HTTP API stages behave **opposite** to REST API stages. A baseline136model trained on REST API assumes you must call `create-deployment` for137any change to go live. On HTTP API, **the `$default` stage has138`auto-deploy: true` by default**, meaning every route, integration, and139authorizer change is live within seconds without a deployment call.140141```text142create-api → $default stage auto-created with auto-deploy: true143operator adds / modifies a route or integration144 → API Gateway evaluates against $default145 → deployment auto-created within seconds146 → change is LIVE147if auto-deploy: false (pinned stage)148 → changes accumulate but are NOT served149 → must create-deployment + update-stage to pin150```151152**Implications:**153- For continuous-deployment pipelines (CodePipeline, SAM, CloudFormation154 with `AWS::ApiGatewayV2::Deployment`), leave `auto-deploy: true` and155 let the framework manage routes. Adding a synthetic156 `AWS::ApiGatewayV2::Deployment` resource on top races with auto-deploy157 and produces drift.158- For gated releases, set `auto-deploy: false`, then use159 `create-deployment` and `update-stage` to swap versions.160- A pinned stage with no current deployment serves **404** for every161 route — the routes exist in configuration but the stage has no162 snapshot. Always emit a deployment when pinning.163164### Step 1: HTTP API (v2) vs REST API (v1) — feature fit165166| Dimension | HTTP API (v2) | REST API (v1) |167|---|---|---|168| Cost per million requests | $1.00 | $3.50 |169| Latency | ~30% lower | Higher |170| Mapping templates (VTL) | No | Yes |171| Usage plans + API keys | No | Yes |172| Resource policies | No | Yes |173| Authorization | JWT, AWS_IAM | AWS_IAM, COGNITO_USER_POOLS, CUSTOM |174| EDGE endpoint | No | Yes |175| PRIVATE endpoint | Yes (VPC link / Lattice) | Yes |176| WAF association | Yes | Yes |177| Custom domains | Yes (REGIONAL) | Yes (EDGE + REGIONAL) |178| Stage model | `auto-deploy` by default | `create-deployment` required |179| Direct AWS integrations | Step Functions, SQS, Kinesis | Broader (DynamoDB, SNS, SQS, Kinesis, Step Functions) |180| Canary | No (use stage swap) | Yes |181182**Decision rule — pick HTTP API when ALL of these hold:**183- Auth is JWT (OIDC/Cognito) or AWS_IAM.184- No mapping templates required.185- No per-consumer usage plans or API keys required.186- No EDGE endpoint required.187188Otherwise, REST API is the right product. See the189`apigateway-rest-deployer` skill for the v1 plan.190191### Step 2: Route model (ANY, GET, POST, {proxy+})192193Routes are flat `(method, path)` pairs. The greedy `{proxy+}` matches194one or more path segments.195196```text197$default → catch-all for ANY method and any path198ANY /{proxy+} → greedy route (every method, every sub-path)199GET /health → exact route200GET /users → exact route201POST /users → exact route202GET /users/{userId} → path parameter203ANY /users/{proxy+} → greedy under /users204```205206**`$default` vs `ANY /{proxy+}`:** `$default` is the API-level fallback207for any unmatched route. `ANY /{proxy+}` is a route that matches the208greedy pattern. `$default` is the only route that handles `ANY` for all209paths without appearing in the route table.210211**CORS preflight:** when CORS is enabled, API Gateway synthesizes212`OPTIONS` responses for routes with matching origins. You do NOT add213`OPTIONS` routes manually. An explicit `OPTIONS /path` route overrides214the synthesized response — only do this for non-standard headers.215216**ANY + NONE auth is the most dangerous route configuration in HTTP217API.** `ANY /{proxy+}` with `authorizationType: NONE` exposes every218method (GET, POST, PUT, PATCH, DELETE) on every sub-path without auth.219Always bind an authorizer to catch-all routes.220221```bash222aws apigatewayv2 create-route --api-id <id> \223 --route-key "POST /users" \224 --target integrations/<integration-id> \225 --authorizer-id <authorizer-id> \226 --authorization-type JWT227```228229### Step 3: Integration targets230231| Type | Subtype | When to use |232|---|---|---|233| `AWS_PROXY` | Lambda proxy | Default for Lambda. Full request as JSON event. Lambda returns `{statusCode, headers, body}`. |234| `HTTP_PROXY` | HTTP pass-through | External HTTP endpoint, no transform. VPC link connections use this. |235| `HTTP` | HTTP with transform | External HTTP endpoint with header/path rewrite (limited). |236| `AWS` | `STEP_FUNCTION` (`START_EXECUTION` / `START_SYNC_EXECUTION`) | Trigger Express Workflow synchronously or Standard async without Lambda. |237| `AWS` | `SQS` (`SendMessage`) | Drop message to SQS queue directly. |238| `AWS` | `KINESIS` (`PutRecord` / `PutRecords`) | Stream record to Kinesis directly. |239240create-integration / add-permission / create-vpc-link command set for241every integration type: [references/integrations-and-routes-reference.md](references/integrations-and-routes-reference.md).242243### Step 4: JWT authorizer (OpenID Connect / Cognito)244245HTTP API exposes one authorizer type: `JWT`. API Gateway fetches the246JWKS from `<issuer>/.well-known/openid-configuration` automatically.247248```bash249aws apigatewayv2 create-authorizer --api-id <id> \250 --name oidc-auth --authorizer-type JWT \251 --identity-source '$request.header.Authorization' \252 --jwt-configuration audience=<client-id>,issuer=https://<issuer-domain>/253```254255**For Cognito user pools**, the issuer is256`https://cognito-idp.<region>.amazonaws.com/<user-pool-id>/` (trailing257slash required) and the audience is the **app client id**.258259Critical JWT rules (HTTPS + trailing slash, aud matching, identity-source,260caching TTL): [references/jwt-cors-domain-auto-deploy-reference.md](references/jwt-cors-domain-auto-deploy-reference.md).261262```bash263aws apigatewayv2 update-route --api-id <id> --route-id <rid> \264 --authorizer-id <authorizer-id> --authorization-type JWT265```266267`AWS_IAM` is set per-route with `--authorization-type AWS_IAM` (no268authorizer ID needed). There is **no Lambda authorizer** on HTTP API;269if you need one, use REST API instead.270271### Step 5: CORS configuration272273CORS is set at the API level. API Gateway synthesizes `OPTIONS`274preflight responses for any route whose `Access-Control-Allow-Origin`275matches the request origin.276277```bash278aws apigatewayv2 update-api --api-id <id> \279 --cors-configuration allowOrigins=https://app.example.com,https://admin.example.com,allowMethods=GET,POST,PUT,DELETE,OPTIONS,allowHeaders=Authorization,Content-Type,X-Request-Id,exposeHeaders=X-Request-Id,X-Trace-Id,maxAge=600,allowCredentials=true280```281282**Critical CORS rules:**283- `allowCredentials=true` forbids `allowOrigins=*`. List origins284 explicitly when cookies or Authorization headers cross domains.285- `OPTIONS` MUST be in `allowMethods`, or preflight responses are286 incomplete and browsers block the call.287- `Authorization` MUST be in `allowHeaders` if the API uses a JWT288 authorizer — otherwise the browser cannot send the Bearer token.289- CORS does NOT authorize server-side; it tells the browser whether to290 expose the response to JavaScript. JWT still governs access.291292### Step 6: Stage and auto-deploy293294`$default` stage is created automatically with `auto-deploy: true`.295296```bash297aws apigatewayv2 update-stage --api-id <id> --stage-name '$default' --auto-deploy true298299# Named stage:300aws apigatewayv2 create-stage --api-id <id> --stage-name prod --auto-deploy true301302# Pinned (release-gated) stage:303aws apigatewayv2 create-deployment --api-id <id>304aws apigatewayv2 update-stage --api-id <id> --stage-name prod \305 --auto-deploy false --deployment-id <deployment-id>306```307308**Never** set `auto-deploy: false` without a current `deployment-id` —309the stage serves 404 until a deployment is pinned.310311### Step 7: Access logging (JSON)312313Access-log settings command + Logs Insights query:314[references/diagnostic-commands.md](references/diagnostic-commands.md).315316### Step 8: Custom domain (API mapping)317318```bash319aws apigatewayv2 create-domain-name --domain-name api.example.com \320 --domain-name-configurations certificateArn=arn:aws:acm:<region>:<account>:certificate/<id>,securityPolicy=TLS_1_2321322aws apigatewayv2 create-api-mapping --domain-name api.example.com \323 --api-id <api-id> --stage '$default' --api-mapping-key ''324```325326- Empty `api-mapping-key` maps the apex of the domain to the stage.327- Non-empty key (e.g., `v1`) maps `api.example.com/v1` to the stage.328- HTTP API does NOT support EDGE custom domains; the cert must be in329 the API's region (`REGIONAL`).330331### Step 9: WAFv2 Web ACL332333```bash334aws apigatewayv2 associate-web-acl \335 --web-acl-arn arn:aws:wafv2:<region>:<account>:regional/webacl/prod-http-waf/<id> \336 --resource-arn arn:aws:apigateway:<region>::/apis/<api-id>/stages/$default337```338339WAF scope is **REGIONAL** for HTTP API (EDGE not supported).340Recommended managed rules: `AWSManagedRulesCommonRuleSet`,341`AWSManagedRulesKnownBadInputsRuleSet`, and a rate-based rule (e.g.,3422000 requests per 5 minutes per IP).343344### Step 10: Throttle and quotas345346HTTP API does not have usage plans or API keys. Throttle is set at the347API and route level:348349```bash350aws apigatewayv2 update-route --api-id <id> --route-id <rid> \351 --route-settings throttlingRateLimit=100,throttlingBurstLimit=200352353aws apigatewayv2 update-stage --api-id <id> --stage-name '$default' \354 --default-route-settings throttlingRateLimit=1000,throttlingBurstLimit=500355```356357For per-consumer quotas, use **WAF rate-based rules** keyed on API key358header or JWT claim — there is no native usage plan on HTTP API. If you359need true per-consumer throttling, switch to REST API.360361## Expert heuristic: $default stage race with Infrastructure-as-Code362363IaC race resolution heuristics (auto-deploy vs pinned Deployment364resource): [references/advanced-patterns.md](references/advanced-patterns.md).365366## Expert heuristic: greedy {proxy+} route precedence and the ANY trap367368Route precedence table and the ANY-trap secure pattern:369[references/advanced-patterns.md](references/advanced-patterns.md).370371## Output format (per HTTP API deployment plan)372373```text374API_SPEC: <name>375VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING376ARCHITECTURE:377 Type: HTTP (v2)378 Endpoint: REGIONAL (<region>)379 Routes:380 - GET /health [NONE]381 - GET /users [JWT]382 - POST /users [JWT]383 - GET /users/{userId} [JWT]384 - ANY /{proxy+} [JWT]385 Integrations:386 - Lambda proxy: users-handler387 - Step Functions START_SYNC_EXECUTION: orders-workflow388 Authorization: JWT (issuer https://cognito-idp.<region>.amazonaws.com/<pool>/, audience <client-id>)389 CORS: allowOrigins=https://app.example.com, allowCredentials=true390 Stage: '$default' (auto-deploy=true)391 WAF: <associated ARN> | none392 Custom domain: api.example.com (ACM cert ARN, API mapping key '')393 Logging: CloudWatch JSON access logs to <log-group>394CHECKLIST:395 [x] HTTP API feature fit confirmed (no usage plans / mapping templates / EDGE)396 [x] Routes defined (method + path, ANY / {proxy+} flagged)397 [x] Integrations configured (AWS_PROXY / HTTP_PROXY / STEP_FUNCTION / SQS / KINESIS)398 [x] JWT authorizer with HTTPS issuer + audience verified399 [x] CORS with allowOrigins + Authorization header + OPTIONS400 [x] Stage auto-deploy explicitly set (true | false + deployment-id)401 [x] Access logging to CloudWatch (JSON with $context)402 [x] WAFv2 REGIONAL Web ACL associated with stage403 [x] Custom domain via ACM + API mapping (REGIONAL only)404 [x] Throttle set per route (rate + burst) or via WAF405FINDINGS:406 - [INFO] Estimated cost: $1.00/M requests + data transfer407 - [WARN] No native usage plans — per-consumer throttling via WAF or external408DEPLOY_COMMANDS:409 <ordered list of aws apigatewayv2 commands>410```411412## Verification commands (run after deployment)413414get-api / get-routes / get-integrations / get-authorizer / CORS / stage /415WAF / api-mappings + live curl checks: [references/diagnostic-commands.md](references/diagnostic-commands.md).416417## Edge-case handling418419Edge cases ($default 404 after pinning, JWT trailing slash, aud mismatch,420CORS wildcard+credentials, ALB VPC link, credentials-arn scope): [references/advanced-patterns.md](references/advanced-patterns.md).421422## NEVER do these things4234241. **NEVER use `ANY /{proxy+}` with `authorizationType: NONE`.** `ANY`425 matches every method (GET, POST, PUT, PATCH, DELETE) on every426 sub-path. Combined with `{proxy+}` (greedy) and no authorizer, this427 exposes every backend operation without authentication. Always bind428 a JWT or AWS_IAM authorizer to catch-all routes, or split the greedy429 into explicit verbs.4304312. **NEVER use HTTP API when you need usage plans, API keys, mapping432 templates, resource policies, EDGE endpoints, or Lambda authorizers.**433 HTTP API lacks all of these features. Switch to REST API (v1) and434 use the `apigateway-rest-deployer` skill. The cost of re-platforming435 to REST is far smaller than building workarounds.4364373. **NEVER set `auto-deploy: false` without a current `deployment-id`.**438 A pinned stage without a deployment serves 404 for every route.439 Always emit `create-deployment` immediately before pinning.4404414. **NEVER trust `allowOrigins=*` with `allowCredentials=true`.** This442 is a hard AWS rejection. With credentials (cookies, Authorization443 header), you MUST enumerate explicit origins. The combination of444 wildcard + credentials is also a browser-level CORS violation that445 browsers block independently.4464475. **NEVER create a JWT authorizer with a non-HTTPS issuer or a missing448 trailing slash on Cognito.** The issuer MUST be HTTPS (HTTP issuers449 are rejected). For Cognito user pools, the URL MUST end with a450 trailing slash (`https://cognito-idp.<region>.amazonaws.com/<pool>/`).451 A missing slash is the #1 cause of authorizer creation failure.452453Additional hard constraints: never scope the `credentials-arn` IAM role454for direct SQS / Kinesis / Step Functions integrations with wildcards455(privilege escalation path); never use EDGE custom domains on HTTP API456(REGIONAL only — request ACM cert in API region); never mix457`AWS::ApiGatewayV2::Deployment` with `auto-deploy: true` (races and458produces drift); never add explicit `OPTIONS` routes when CORS is459enabled (API Gateway synthesizes preflight); never skip460`lambda:AddPermission` for the `apigateway.amazonaws.com` principal.461462## Pre-flight safety checks (run before any deployment CLI)463464All checks (confirmation gate quote, authorizer sweep, issuer reachability,465CORS, ACM region, cost estimate): [references/advanced-patterns.md](references/advanced-patterns.md).466467## Remediation guidance468469Ordering principle + fixes for JWT issuer, VPC link to ALB, REST features470required: [references/error-handling.md](references/error-handling.md).471472## References (load on demand)473474- [Error handling](references/error-handling.md) - remediation ordering principle + fixes: JWT issuer unreachable, VPC link to ALB, REST features required475- [Diagnostic commands](references/diagnostic-commands.md) - live-account pre-flight checks, access-log setup, post-deployment verification commands476- [Advanced patterns](references/advanced-patterns.md) - three differentiators, IaC auto-deploy race, ANY/{proxy+} trap, edge cases, safety gate, recent features477- [Integrations and routes](references/integrations-and-routes-reference.md) - per-integration contracts; create-integration command set478- [JWT / CORS / domain / auto-deploy](references/jwt-cors-domain-auto-deploy-reference.md) - authorizer deep dive; critical JWT config rules479480## Domain481482AWS CloudOps / API Gateway HTTP API (v2) Provisioning.483484## Recent AWS features (2024-2026)485486Recent AWS features — Step Functions direct, VPC Lattice, mTLS, OpenAPI4873.1 import, CORS wildcards: [references/advanced-patterns.md](references/advanced-patterns.md).488489## AWS documentation490491- **HTTP API Developer Guide** — https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html492- **API Reference (v2)** — https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/493- **Routes / Integrations / JWT / CORS / Stages (auto-deploy)** — https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html494- **Step Functions + API Gateway direct integration** — https://docs.aws.amazon.com/step-functions/latest/dg/connect-api-gateway.html495- **WAFv2 Developer Guide** — https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html496- **Choosing between REST and HTTP APIs** — https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html497- **Blog: HTTP API mTLS** — https://aws.amazon.com/blogs/compute/introducing-mutual-tls-authentication-for-amazon-api-gateway-http-apis/