# EventApiProps

Properties for an AppSync Event API.

Extends: EventApiProps
Used as props by: EventApi

- Source: [`aws-appsync/lib/eventapi.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-appsync/lib/eventapi.ts#L466)
- Type last changed: v2.178.0 · 6 Feb 2025

## Example

```ts
import * as lambda from 'aws-cdk-lib/aws-lambda';
declare const handler: lambda.Function;

const iamProvider: appsync.AppSyncAuthProvider = {
  authorizationType: appsync.AppSyncAuthorizationType.IAM,
};

const apiKeyProvider: appsync.AppSyncAuthProvider = {
  authorizationType: appsync.AppSyncAuthorizationType.API_KEY,
};

/* API with IAM and API Key providers.
 * Connection, default publish and default subscribe
 * can be done with either IAM and API Key.
 */
const api = new appsync.EventApi(this, 'api', {
  apiName: 'api',
  authorizationConfig: {
    // set auth providers
    authProviders: [
      iamProvider,
      apiKeyProvider,
    ],
  }
});

api.addChannelNamespace('default');
```

## Properties

- `apiName`: string (required) — the name of the Event API.

- `authorizationConfig`: [EventApiAuthConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.EventApiAuthConfig.html) — Optional authorization configuration.

  **Default:** API Key authorization

- `domainName`: [AppSyncDomainOptions](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.AppSyncDomainOptions.html) — The domain name configuration for the Event API.

  **Default:** no domain name

  The Route 53 hosted zone and CName DNS record must be configured in addition to this setting to
  enable custom domain URL

- `logConfig`: [AppSyncLogConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.AppSyncLogConfig.html) = None — Logging configuration for this api.

- `ownerContact`: string — The owner contact information for an API resource.

  **Default:** No owner contact.

  This field accepts any string input with a length of 0 - 256 characters.
