# Apigateway HTTP API Deployer

> 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.

- Skill: `jhkchan/apigateway-http-api-deployer` (Agent Skill, multi-file: 21 files)
- Install (CLI): `npx get-skill add jhkchan/apigateway-http-api-deployer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jhkchan/apigateway-http-api-deployer/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- License: Apache-2.0
- Author: jhkchan (https://skillmd.com/u/jhkchan)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/jhkchan/apigateway-http-api-deployer

---


# 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](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](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:

```text
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.

```text
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.

```text
$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.

```bash
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](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.

```bash
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](references/jwt-cors-domain-auto-deploy-reference.md).

```bash
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.

```bash
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`.

```bash
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](references/diagnostic-commands.md).

### Step 8: Custom domain (API mapping)

```bash
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

```bash
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:

```bash
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](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](references/advanced-patterns.md).

## Output format (per HTTP API deployment plan)

```text
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](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](references/advanced-patterns.md).

## NEVER do these things

1. **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.

2. **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.

3. **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.

4. **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.

5. **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](references/advanced-patterns.md).

## Remediation guidance

Ordering principle + fixes for JWT issuer, VPC link to ALB, REST features
required: [references/error-handling.md](references/error-handling.md).

## References (load on demand)

- [Error handling](references/error-handling.md) - remediation ordering principle + fixes: JWT issuer unreachable, VPC link to ALB, REST features required
- [Diagnostic commands](references/diagnostic-commands.md) - live-account pre-flight checks, access-log setup, post-deployment verification commands
- [Advanced patterns](references/advanced-patterns.md) - three differentiators, IaC auto-deploy race, ANY/{proxy+} trap, edge cases, safety gate, recent features
- [Integrations and routes](references/integrations-and-routes-reference.md) - per-integration contracts; create-integration command set
- [JWT / CORS / domain / auto-deploy](references/jwt-cors-domain-auto-deploy-reference.md) - 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](references/advanced-patterns.md).

## AWS documentation

- **HTTP API Developer Guide** — https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html
- **API Reference (v2)** — https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/
- **Routes / Integrations / JWT / CORS / Stages (auto-deploy)** — https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html
- **Step Functions + API Gateway direct integration** — https://docs.aws.amazon.com/step-functions/latest/dg/connect-api-gateway.html
- **WAFv2 Developer Guide** — https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html
- **Choosing between REST and HTTP APIs** — https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html
- **Blog: HTTP API mTLS** — https://aws.amazon.com/blogs/compute/introducing-mutual-tls-authentication-for-amazon-api-gateway-http-apis/

