# AuthorizationConfig

Configuration of the API authorization modes.

- Source: [`aws-appsync/lib/graphqlapi.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-appsync/lib/graphqlapi.ts#L176)
- Type last changed: v2.60.0 · 12 Jan 2023

## Example

```ts
import * as appsync from 'aws-cdk-lib/aws-appsync';

const api = new appsync.GraphqlApi(this, 'api', {
  name: 'api',
  definition: appsync.Definition.fromFile('schema.graphql'),
  authorizationConfig: {
    defaultAuthorization: { authorizationType: appsync.AuthorizationType.IAM }
  },
});

const rule = new events.Rule(this, 'Rule', {
  schedule: events.Schedule.rate(cdk.Duration.hours(1)),
});

rule.addTarget(new targets.AppSync(api, {
  graphQLOperation: 'mutation Publish($message: String!){ publish(message: $message) { message } }',
  variables: events.RuleTargetInput.fromObject({
    message: 'hello world',
  }),
}));
```

## Properties

- `additionalAuthorizationModes`: [AuthorizationMode](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.AuthorizationMode.html)[] — Additional authorization modes.

  **Default:** No other modes

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

  **Default:** API Key authorization
