InterfaceVpcEndpoint L2 construct
A interface VPC endpoint.
Example
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']
}
});
# vpc: ec2.Vpc
ec2.InterfaceVpcEndpoint(self, "VPC Endpoint",
vpc=vpc,
service=ec2.InterfaceVpcEndpointService("com.amazonaws.vpce.us-east-1.vpce-svc-uuddlrlrbastrtsvc", 443),
subnets=ec2.SubnetSelection(
subnet_type=ec2.SubnetType.PRIVATE_ISOLATED,
availability_zones=["us-east-1a", "us-east-1c"]
)
)
Vpc vpc;
InterfaceVpcEndpoint.Builder.create(this, "VPC Endpoint")
.vpc(vpc)
.service(new InterfaceVpcEndpointService("com.amazonaws.vpce.us-east-1.vpce-svc-uuddlrlrbastrtsvc", 443))
.subnets(SubnetSelection.builder()
.subnetType(SubnetType.PRIVATE_ISOLATED)
.availabilityZones(List.of("us-east-1a", "us-east-1c"))
.build())
.build();
// Install: dotnet add package Amazon.CDK.Lib
Vpc vpc;
new InterfaceVpcEndpoint(this, "VPC Endpoint", new InterfaceVpcEndpointProps {
Vpc = vpc,
Service = new InterfaceVpcEndpointService("com.amazonaws.vpce.us-east-1.vpce-svc-uuddlrlrbastrtsvc", 443),
Subnets = new SubnetSelection {
SubnetType = SubnetType.PRIVATE_ISOLATED,
AvailabilityZones = new [] { "us-east-1a", "us-east-1c" }
}
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var vpc Vpc
ec2.NewInterfaceVpcEndpoint(this, jsii.String("VPC Endpoint"), &InterfaceVpcEndpointProps{
Vpc: Vpc,
Service: ec2.NewInterfaceVpcEndpointService(jsii.String("com.amazonaws.vpce.us-east-1.vpce-svc-uuddlrlrbastrtsvc"), jsii.Number(443)),
Subnets: &SubnetSelection{
SubnetType: ec2.SubnetType_PRIVATE_ISOLATED,
AvailabilityZones: []*string{
jsii.String("us-east-1a"),
jsii.String("us-east-1c"),
},
},
})
Initializer
new InterfaceVpcEndpoint(scope: Construct, id: string, props: InterfaceVpcEndpointProps)
InterfaceVpcEndpoint(scope: Construct, id: str, props: InterfaceVpcEndpointProps)
new InterfaceVpcEndpoint(Construct scope, String id, InterfaceVpcEndpointProps props)
new InterfaceVpcEndpoint(Construct scope, string id, InterfaceVpcEndpointProps props)
NewInterfaceVpcEndpoint(Scope Construct, Id *string, Props InterfaceVpcEndpointProps)
Construct Props
dnsRecordIpTypeVpcEndpointDnsRecordIpTypedns_record_ip_typeVpcEndpointDnsRecordIpTypednsRecordIpTypeVpcEndpointDnsRecordIpTypeDnsRecordIpTypeVpcEndpointDnsRecordIpTypeDnsRecordIpTypeVpcEndpointDnsRecordIpType= not specified#ipAddressTypeVpcEndpointIpAddressTypeip_address_typeVpcEndpointIpAddressTypeipAddressTypeVpcEndpointIpAddressTypeIpAddressTypeVpcEndpointIpAddressTypeIpAddressTypeVpcEndpointIpAddressType= not specified#lookupSupportedAzsbooleanlookup_supported_azsboollookupSupportedAzsBooleanLookupSupportedAzsboolLookupSupportedAzs*bool= false#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.
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.
privateDnsEnabledbooleanprivate_dns_enabledboolprivateDnsEnabledBooleanPrivateDnsEnabledboolPrivateDnsEnabled*bool= set by the instance of IInterfac…#This allows you to make requests to the service using its default DNS hostname.
default
Default: set by the instance of IInterfaceVpcEndpointService, or true if not defined by the instance of IInterfaceVpcEndpointService
privateDnsOnlyForInboundResolverEndpointVpcEndpointPrivateDnsOnlyForInboundResolverEndpointprivate_dns_only_for_inbound_resolver_endpointVpcEndpointPrivateDnsOnlyForInboundResolverEndpointprivateDnsOnlyForInboundResolverEndpointVpcEndpointPrivateDnsOnlyForInboundResolverEndpointPrivateDnsOnlyForInboundResolverEndpointVpcEndpointPrivateDnsOnlyForInboundResolverEndpointPrivateDnsOnlyForInboundResolverEndpointVpcEndpointPrivateDnsOnlyForInboundResolverEndpoint= not specified#securityGroupsISecurityGroup[]security_groupstyping.List[ISecurityGroup]securityGroupsList<ISecurityGroup>SecurityGroupsISecurityGroup[]SecurityGroups*[]ISecurityGroup= a new security group is created#serviceIInterfaceVpcEndpointServiceserviceIInterfaceVpcEndpointServiceserviceIInterfaceVpcEndpointServiceServiceIInterfaceVpcEndpointServiceServiceIInterfaceVpcEndpointServicerequired#serviceRegionstringservice_regionstrserviceRegionStringServiceRegionstringServiceRegion*string= Same region as the interface VPC…#Only needs to be specified for cross-region VPC endpoints.
default
Default: Same region as the interface VPC endpoint
subnetsSubnetSelectionsubnetsSubnetSelectionsubnetsSubnetSelectionSubnetsSubnetSelectionSubnetsSubnetSelection= private subnets#At most one per availability zone.
Properties
connectionsConnectionsconnectionsConnectionsconnectionsConnectionsConnectionsConnectionsConnectionsConnectionsrequired#envResourceEnvironmentenvResourceEnvironmentenvResourceEnvironmentEnvResourceEnvironmentEnvResourceEnvironmentrequired#notes
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.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#vpcEndpointCreationTimestampstringvpc_endpoint_creation_timestampstrvpcEndpointCreationTimestampStringVpcEndpointCreationTimestampstringVpcEndpointCreationTimestamp*stringrequired#vpcEndpointDnsEntriesstring[]vpc_endpoint_dns_entriestyping.List[str]vpcEndpointDnsEntriesList<String>VpcEndpointDnsEntriesstring[]VpcEndpointDnsEntries*[]*stringrequired#notes
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.
vpcEndpointIdstringvpc_endpoint_idstrvpcEndpointIdStringVpcEndpointIdstringVpcEndpointId*stringrequired#vpcEndpointNetworkInterfaceIdsstring[]vpc_endpoint_network_interface_idstyping.List[str]vpcEndpointNetworkInterfaceIdsList<String>VpcEndpointNetworkInterfaceIdsstring[]VpcEndpointNetworkInterfaceIds*[]*stringrequired#vpcEndpointRefVPCEndpointReferencevpc_endpoint_refVPCEndpointReferencevpcEndpointRefVPCEndpointReferenceVpcEndpointRefVPCEndpointReferenceVpcEndpointRefVPCEndpointReferencerequired#Methods
addToPolicy(statement: PolicyStatement): voiddef add_to_policy(self, statement: PolicyStatement) -> Nonepublic void addToPolicy(PolicyStatement statement)public void AddToPolicy(PolicyStatement statement)func AddToPolicy(Statement PolicyStatement)#Not all interface VPC endpoints support policy. For more information see https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html
1 parameter
Parameters
statementstatementstatementstatementStatement— the IAM statement to add.
applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#notes · 1 parameter
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
strengthstrengthstrengthstrengthStrength— - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#notes
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@staticmethod def from_interface_vpc_endpoint_attributes(scope: Construct, id: str, attrs: InterfaceVpcEndpointAttributes) -> IInterfaceVpcEndpointpublic static IInterfaceVpcEndpoint fromInterfaceVpcEndpointAttributes(Construct scope, String id, InterfaceVpcEndpointAttributes attrs)public static IInterfaceVpcEndpoint FromInterfaceVpcEndpointAttributes(Construct scope, string id, InterfaceVpcEndpointAttributes attrs)func FromInterfaceVpcEndpointAttributes(Scope Construct, Id *string, Attrs InterfaceVpcEndpointAttributes) IInterfaceVpcEndpointstatic#isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#notes · 1 parameter · returns
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
xxxxX— Any object.
Returns: true if x is an object created from a class which extends Construct.
isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#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.