# RecordTarget

Type union for a record that accepts multiple types of target.

- Source: [`aws-route53/lib/record-set.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-route53/lib/record-set.ts#L332)

## Example

```ts
declare const instance: ec2.Instance;

const elasticIp = new ec2.CfnEIP(this, 'EIP', {
  domain: 'vpc',
  instanceId: instance.instanceId,
});

declare const myZone: route53.HostedZone;
new route53.ARecord(this, 'ARecord', {
  zone: myZone,
  target: route53.RecordTarget.fromIpAddresses(elasticIp.ref),
});
```

## Properties

- `aliasTarget`: [IAliasRecordTarget](/cdk/api/v2/docs/aws-cdk-lib.aws_route53.IAliasRecordTarget.html) — alias for targets such as CloudFront distribution to route traffic to.

- `values`: string[] — correspond with the chosen record type (e.g. for 'A' Type, specify one or more IP addresses).

## Methods

- `fromAlias(aliasTarget: IAliasRecordTarget): RecordTarget // chainable` (static) — Use an alias as target.

- `fromIpAddresses(...ipAddresses: string[]): RecordTarget // chainable` (static) — Use ip addresses as target.

- `fromValues(...values: string[]): RecordTarget // chainable` (static) — Use string values as target.
