class VpcEndpointService (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.VpcEndpointService |
Java | software.amazon.awscdk.services.ec2.VpcEndpointService |
Python | aws_cdk.aws_ec2.VpcEndpointService |
TypeScript (source) | @aws-cdk/aws-ec2 » VpcEndpointService |
Implements
IConstruct
, IConstruct
, IDependable
, IResource
, IVpc
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
Vpc
Endpoint Service Props
Construct Props
Name | Type | Description |
---|---|---|
vpc | IVpc [] | One or more load balancers to host the VPC Endpoint Service. |
acceptance | boolean | Whether requests from service consumers to connect to the service through an endpoint must be accepted. |
allowed | Arn [] | IAM users, IAM roles, or AWS accounts to allow inbound connections from. |
vpc | string | Name of the Vpc Endpoint Service. |
whitelisted | Arn [] | IAM users, IAM roles, or AWS accounts to allow inbound connections from. |
vpcEndpointServiceLoadBalancers
Type:
IVpc
[]
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:
Arn
[]
(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.
vpcEndpointServiceName?
⚠️ Deprecated: This property is not used
Type:
string
(optional, default: CDK generated name)
Name of the Vpc Endpoint Service.
whitelistedPrincipals?
⚠️ Deprecated: use allowedPrincipals
Type:
Arn
[]
(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
Name | Type | Description |
---|---|---|
acceptance | boolean | Whether to require manual acceptance of new connections to the service. |
allowed | Arn [] | One or more Principal ARNs to allow inbound connections to. |
env | Resource | The environment this resource belongs to. |
node | Construct | The construct tree node associated with this construct. |
stack | Stack | The stack in which this resource is defined. |
vpc | string | The id of the VPC Endpoint Service, like vpce-svc-xxxxxxxxxxxxxxxx. |
vpc | IVpc [] | One or more network load balancers to host the service. |
vpc | string | The service name of the VPC Endpoint Service that clients use to connect to, like com.amazonaws.vpce. |
whitelisted | Arn [] | One or more Principal ARNs to allow inbound connections to. |
acceptanceRequired
Type:
boolean
Whether to require manual acceptance of new connections to the service.
allowedPrincipals
Type:
Arn
[]
One or more Principal ARNs to allow inbound connections to.
env
Type:
Resource
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:
Construct
The construct tree node associated with this construct.
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:
IVpc
[]
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.
whitelistedPrincipals
⚠️ Deprecated: use allowedPrincipals
Type:
Arn
[]
One or more Principal ARNs to allow inbound connections to.
Methods
Name | Description |
---|---|
apply | Apply the given removal policy to this resource. |
to | Returns a string representation of this construct. |
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
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
).
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.