class VpcEndpointService (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.VpcEndpointService |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#VpcEndpointService |
Java | software.amazon.awscdk.services.ec2.VpcEndpointService |
Python | aws_cdk.aws_ec2.VpcEndpointService |
TypeScript (source) | aws-cdk-lib » aws_ec2 » VpcEndpointService |
Implements
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')],
contributorInsights: true
});
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. |
contributor | boolean | Indicates whether to enable the built-in Contributor Insights rules provided by AWS PrivateLink. |
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.
contributorInsights?
Type:
boolean
(optional, default: false)
Indicates whether to enable the built-in Contributor Insights rules provided by AWS PrivateLink.
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 | Node | The tree node. |
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. |
contributor | boolean | Whether to enable the built-in Contributor Insights rules provided by AWS PrivateLink. |
static DEFAULT_PREFIX | string | The default value for a VPC Endpoint Service name prefix, useful if you do not have a synthesize-time region literal available (all you have is { "Ref": "AWS::Region" } ). |
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:
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:
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.
contributorInsightsEnabled?
Type:
boolean
(optional)
Whether to enable the built-in Contributor Insights rules provided by AWS PrivateLink.
static DEFAULT_PREFIX
Type:
string
The default value for a VPC Endpoint Service name prefix, useful if you do not have a synthesize-time region literal available (all you have is { "Ref": "AWS::Region" }
).
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.