# InterfaceVpcEndpoint

A interface VPC endpoint.

Extends: Construct › Resource › VpcEndpoint › InterfaceVpcEndpoint
Implements: IResource, IConnectable, IInterfaceVpcEndpoint, IVpcEndpoint, IEnvironmentAware, IVPCEndpointRef, IConstruct, IDependable

- CloudFormation: [`AWS::EC2::VPCEndpoint`](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-ec2-vpcendpoint.html)
- L1 type: [`CfnVPCEndpoint`](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnVPCEndpoint.html)
- Source: [`aws-ec2/lib/vpc-endpoint.ts`](https://github.com/aws/aws-cdk/blob/v2.273.0/packages/aws-cdk-lib/aws-ec2/lib/vpc-endpoint.ts#L1058)
- Type last changed: v2.196.0 · 16 May 2025

## Example

```ts
declare const vpc: ec2.Vpc;

new ec2.InterfaceVpcEndpoint(this, 'VPC Endpoint', {
  vpc,
  service: new ec2.InterfaceVpcEndpointService('com.amazonaws.vpce.us-east-1.vpce-svc-uuddlrlrbastrtsvc', 443),
  subnets: {
    subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
    availabilityZones: ['us-east-1a', 'us-east-1c']
  }
});
```

## Initializer

```ts
new InterfaceVpcEndpoint(scope: Construct, id: string, props: InterfaceVpcEndpointProps)
```

## Construct Props

- `dnsRecordIpType`: [VpcEndpointDnsRecordIpType](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.VpcEndpointDnsRecordIpType.html) = not specified — Type of DNS records created for the VPC endpoint.

- `ipAddressType`: [VpcEndpointIpAddressType](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.VpcEndpointIpAddressType.html) = not specified — The IP address type for the endpoint.

- `lookupSupportedAzs`: boolean = false — Limit to only those availability zones where the endpoint service can be created.

  Setting this to 'true' requires a lookup to be performed at synthesis time. Account
  and region must be set on the containing stack for this to work.

- `open`: boolean = true — Whether to automatically allow VPC traffic to the endpoint.

  If enabled, all traffic to the endpoint from within the VPC will be
  automatically allowed. This is done based on the VPC's CIDR range.

- `privateDnsEnabled`: boolean = set by the instance of IInterfaceVpcEndpointService, or true if not defined by the instance of IInterfaceVpcEndpointService — Whether to associate a private hosted zone with the specified VPC.

  This
  allows you to make requests to the service using its default DNS hostname.

  **Default:** set by the instance of IInterfaceVpcEndpointService, or true if not defined by the instance of IInterfaceVpcEndpointService

- `privateDnsOnlyForInboundResolverEndpoint`: [VpcEndpointPrivateDnsOnlyForInboundResolverEndpoint](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.VpcEndpointPrivateDnsOnlyForInboundResolverEndpoint.html) = not specified — Whether to enable private DNS only for inbound endpoints.

- `securityGroups`: [ISecurityGroup](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.ISecurityGroup.html)[] = a new security group is created — The security groups to associate with this interface VPC endpoint.

- `service`: [IInterfaceVpcEndpointService](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IInterfaceVpcEndpointService.html) (required) — The service to use for this interface VPC endpoint.

- `serviceRegion`: string = Same region as the interface VPC endpoint — The region where the VPC endpoint service is located.

  Only needs to be specified for cross-region VPC endpoints.

  **Default:** Same region as the interface VPC endpoint

- `subnets`: [SubnetSelection](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.SubnetSelection.html) = private subnets — The subnets in which to create an endpoint network interface.

  At most one
  per availability zone.

- `vpc`: [IVpc](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpc.html) (required) — The VPC network in which the interface endpoint will be used.

## Properties

- `connections`: [Connections](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Connections.html) (required) — Access to network connections.

- `env`: [ResourceEnvironment](/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) (required) — The environment this resource belongs to.

  For resources that are created and managed in a Stack (those created by
  creating new class instances like `new Role()`, `new Bucket()`, etc.), this
  is always the same as the environment of the stack they belong to.

  For referenced resources (those obtained from referencing methods like
  `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
  different than the stack they were imported into.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) (required) — The tree node.

- `PROPERTY_INJECTION_ID`: string (required) (static) — Uniquely identifies this class.

- `stack`: [Stack](/cdk/api/v2/docs/aws-cdk-lib.Stack.html) (required) — The stack in which this resource is defined.

- `vpcEndpointCreationTimestamp`: string (required) — The date and time the interface VPC endpoint was created.

- `vpcEndpointDnsEntries`: string[] (required) — The DNS entries for the interface VPC endpoint.

  Each entry is a combination of the hosted zone ID and the DNS name.
  The entries are ordered as follows: regional public DNS, zonal public DNS, private DNS, and wildcard DNS.
  This order is not enforced for AWS Marketplace services.

  The following is an example. In the first entry, the hosted zone ID is Z1HUB23UULQXV
  and the DNS name is vpce-01abc23456de78f9g-12abccd3.ec2.us-east-1.vpce.amazonaws.com.

  ["Z1HUB23UULQXV:vpce-01abc23456de78f9g-12abccd3.ec2.us-east-1.vpce.amazonaws.com",
  "Z1HUB23UULQXV:vpce-01abc23456de78f9g-12abccd3-us-east-1a.ec2.us-east-1.vpce.amazonaws.com",
  "Z1C12344VYDITB0:ec2.us-east-1.amazonaws.com"]

  If you update the PrivateDnsEnabled or SubnetIds properties, the DNS entries in the list will change.

- `vpcEndpointId`: string (required) — The interface VPC endpoint identifier.

- `vpcEndpointNetworkInterfaceIds`: string[] (required) — One or more network interfaces for the interface VPC endpoint.

- `vpcEndpointRef`: [VPCEndpointReference](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.VPCEndpointReference.html) (required) — A reference to a VPCEndpoint resource.

## Methods

- `addToPolicy(statement: PolicyStatement): void` — Adds a statement to the policy document of the VPC endpoint. The statement must have a Principal.

  Not all interface VPC endpoints support policy. For more information
  see https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html

  **Parameters**

  - `statement` — the IAM statement to add.

- `applyCrossStackReferenceStrength(strength: ReferenceStrength): void` — Override the cross-stack reference strength for this resource.

  When set, any cross-stack reference to this resource will use the specified
  mechanism instead of the global default determined by the
  `@aws-cdk/core:defaultCrossStackReferences` context key. This is useful for
  selectively weakening specific references to avoid the "deadly embrace" problem
  without changing the app-wide default.

  **Parameters**

  - `strength` — - The reference strength to use for this resource.

- `applyRemovalPolicy(policy: RemovalPolicy): void` — Apply the given removal policy to this resource.

  The Removal Policy controls what happens to this resource when it stops
  being managed by CloudFormation, either because you've removed it from the
  CDK application or because you've made a change that requires the resource
  to be replaced.

  The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
  account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).

- `fromInterfaceVpcEndpointAttributes(scope: Construct, id: string, attrs: InterfaceVpcEndpointAttributes): IInterfaceVpcEndpoint` (static) — Imports an existing interface VPC endpoint.

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  Use this method instead of `instanceof` to properly detect `Construct`
  instances, even when the construct library is symlinked.

  Explanation: in JavaScript, multiple copies of the `constructs` library on
  disk are seen as independent, completely different libraries. As a
  consequence, the class `Construct` in each copy of the `constructs` library
  is seen as a different class, and an instance of one class will not test as
  `instanceof` the other class. `npm install` will not create installations
  like this, but users may manually symlink construct libraries together or
  use a monorepo tool: in those cases, multiple copies of the `constructs`
  library can be accidentally installed, and `instanceof` will behave
  unpredictably. It is safest to avoid using `instanceof`, and using
  this type-testing method instead.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Construct`.

- `isOwnedResource(construct: IConstruct): boolean` (static) — Returns true if the construct was created by CDK, and false otherwise.

- `isResource(construct: IConstruct): boolean` (static) — Check whether the given construct is a Resource.

- `toString(): string` — Returns a string representation of this construct.

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.
  Use multiple `with()` calls if subsequent mixins should apply to added
  constructs.
