aws-cdk-lib.aws_ec2.VpcEndpointService

class VpcEndpointService (construct)

LanguageType name
.NETAmazon.CDK.AWS.EC2.VpcEndpointService
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsec2#VpcEndpointService
Javasoftware.amazon.awscdk.services.ec2.VpcEndpointService
Pythonaws_cdk.aws_ec2.VpcEndpointService
TypeScript (source)aws-cdk-lib » aws_ec2 » VpcEndpointService

Implements IConstruct, IDependable, IResource, IVpcEndpointService

A VPC endpoint service.

Example

declare const networkLoadBalancer1: elbv2.NetworkLoadBalancer;
declare const networkLoadBalancer2: elbv2.NetworkLoadBalancer;

new ec2.VpcEndpointService(this, 'EndpointService', {
  vpcEndpointServiceLoadBalancers: [networkLoadBalancer1, networkLoadBalancer2],
  acceptanceRequired: true,
  allowedPrincipals: [new iam.ArnPrincipal('arn:aws:iam::123456789012:root')]
});

Initializer

new VpcEndpointService(scope: Construct, id: string, props: VpcEndpointServiceProps)

Parameters

  • scope Construct
  • id string
  • props VpcEndpointServiceProps

Construct Props

NameTypeDescription
vpcEndpointServiceLoadBalancersIVpcEndpointServiceLoadBalancer[]One or more load balancers to host the VPC Endpoint Service.
acceptanceRequired?booleanWhether requests from service consumers to connect to the service through an endpoint must be accepted.
allowedPrincipals?ArnPrincipal[]IAM users, IAM roles, or AWS accounts to allow inbound connections from.

vpcEndpointServiceLoadBalancers

Type: IVpcEndpointServiceLoadBalancer[]

One or more load balancers to host the VPC Endpoint Service.


acceptanceRequired?

Type: boolean (optional, default: true)

Whether requests from service consumers to connect to the service through an endpoint must be accepted.


allowedPrincipals?

Type: ArnPrincipal[] (optional, default: no principals)

IAM users, IAM roles, or AWS accounts to allow inbound connections from.

These principals can connect to your service using VPC endpoints. Takes a list of one or more ArnPrincipal.

Properties

NameTypeDescription
acceptanceRequiredbooleanWhether to require manual acceptance of new connections to the service.
allowedPrincipalsArnPrincipal[]One or more Principal ARNs to allow inbound connections to.
envResourceEnvironmentThe environment this resource belongs to.
nodeNodeThe tree node.
stackStackThe stack in which this resource is defined.
vpcEndpointServiceIdstringThe id of the VPC Endpoint Service, like vpce-svc-xxxxxxxxxxxxxxxx.
vpcEndpointServiceLoadBalancersIVpcEndpointServiceLoadBalancer[]One or more network load balancers to host the service.
vpcEndpointServiceNamestringThe service name of the VPC Endpoint Service that clients use to connect to, like com.amazonaws.vpce..vpce-svc-xxxxxxxxxxxxxxxx.

acceptanceRequired

Type: boolean

Whether to require manual acceptance of new connections to the service.


allowedPrincipals

Type: ArnPrincipal[]

One or more Principal ARNs to allow inbound connections to.


env

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node

Type: Node

The tree node.


stack

Type: Stack

The stack in which this resource is defined.


vpcEndpointServiceId

Type: string

The id of the VPC Endpoint Service, like vpce-svc-xxxxxxxxxxxxxxxx.


vpcEndpointServiceLoadBalancers

Type: IVpcEndpointServiceLoadBalancer[]

One or more network load balancers to host the service.


vpcEndpointServiceName

Type: string

The service name of the VPC Endpoint Service that clients use to connect to, like com.amazonaws.vpce..vpce-svc-xxxxxxxxxxxxxxxx.

Methods

NameDescription
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
toString()Returns a string representation of this construct.

applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

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).


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.