ApiKeyResource
Source:
src/AWS/AppSync/ApiKey.ts
An AppSync API key for API_KEY-authenticated GraphQL APIs.
The key’s id attribute is the secret value (da2-…) sent in the
x-api-key request header. It is wrapped in Redacted; unwrap with
Redacted.value(key.id) where the raw header value is needed.
Creating API Keys
Section titled “Creating API Keys”Key with the default 7-day expiry
const key = yield* AppSync.ApiKey("Key", { api });// Redacted.value(key.id) → "da2-…" — send as the x-api-key headerKey with a managed expiry
const key = yield* AppSync.ApiKey("Key", { api, description: "mobile clients", expires: 1893456000, // rounded down to the hour by AWS});