# ElasticBeanstalkEnvironmentEndpointTarget

Use an Elastic Beanstalk environment URL as an alias record target. E.g. mysampleenvironment.xyz.us-east-1.elasticbeanstalk.com or mycustomcnameprefix.us-east-1.elasticbeanstalk.com.

Only supports Elastic Beanstalk environments created after 2016 that have a regional endpoint.

Extends: ElasticBeanstalkEnvironmentEndpointTarget
Implements: IAliasRecordTarget

- Source: [`aws-route53-targets/lib/elastic-beanstalk-environment-target.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-route53-targets/lib/elastic-beanstalk-environment-target.ts#L15)
- Type last changed: v2.177.0 · 25 Jan 2025

## Example

```ts
import { RegionInfo } from 'aws-cdk-lib/region-info';

declare const zone: route53.HostedZone;
declare const ebsEnvironmentUrl: string;

new route53.ARecord(this, 'AliasRecord', {
  zone,
  target: route53.RecordTarget.fromAlias(
    new targets.ElasticBeanstalkEnvironmentEndpointTarget(ebsEnvironmentUrl, {
      hostedZoneId: RegionInfo.get('us-east-1').ebsEnvEndpointHostedZoneId,
    }),
  ),
});
```

## Initializer

```ts
new ElasticBeanstalkEnvironmentEndpointTarget(environmentEndpoint: string, props?: IAliasRecordTargetProps)
```

## Methods

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