# AppSyncTarget

Defines an AppSync Graphql API as the alias target.

Requires that the domain
name will be defined through `GraphqlApiProps.domainName`.

Extends: AppSyncTarget
Implements: IAliasRecordTarget

- Source: [`aws-route53-targets/lib/appsync-target.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-route53-targets/lib/appsync-target.ts#L14)
- Type last changed: v2.172.0 · 7 Dec 2024

## Example

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

declare const zone: route53.HostedZone;
declare const graphqlApi: appsync.GraphqlApi;

new route53.ARecord(this, 'AliasRecord', {
  zone,
  target: route53.RecordTarget.fromAlias(new targets.AppSyncTarget(graphqlApi)),
});
```

## Initializer

```ts
new AppSyncTarget(graphqlApi: GraphqlApi)
```

## Methods

- `bind(_record: IRecordSet, _zone?: IHostedZone): AliasRecordTargetConfig` — Return hosted zone ID and DNS name, usable for Route53 alias targets.
