InterfaceVpcEndpoint
- class aws_cdk.aws_ec2.InterfaceVpcEndpoint(scope, id, *, vpc, service, lookup_supported_azs=None, open=None, private_dns_enabled=None, security_groups=None, subnets=None)
Bases:
VpcEndpoint
A interface VPC endpoint.
- Resource:
AWS::EC2::VPCEndpoint
- ExampleMetadata:
infused
Example:
# vpc: ec2.Vpc ec2.InterfaceVpcEndpoint(self, "VPC Endpoint", vpc=vpc, service=ec2.InterfaceVpcEndpointService("com.amazonaws.vpce.us-east-1.vpce-svc-uuddlrlrbastrtsvc", 443), # Choose which availability zones to place the VPC endpoint in, based on # available AZs subnets=ec2.SubnetSelection( availability_zones=["us-east-1a", "us-east-1c"] ) )
- Parameters:
scope (
Construct
)id (
str
)vpc (
IVpc
) – The VPC network in which the interface endpoint will be used.service (
IInterfaceVpcEndpointService
) – The service to use for this interface VPC endpoint.lookup_supported_azs (
Optional
[bool
]) – 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. Default: falseopen (
Optional
[bool
]) – 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. Default: trueprivate_dns_enabled (
Optional
[bool
]) – 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 IInterfaceVpcEndpointServicesecurity_groups (
Optional
[Sequence
[ISecurityGroup
]]) – The security groups to associate with this interface VPC endpoint. Default: - a new security group is createdsubnets (
Union
[SubnetSelection
,Dict
[str
,Any
],None
]) – The subnets in which to create an endpoint network interface. At most one per availability zone. Default: - private subnets
Methods
- add_to_policy(statement)
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 (
PolicyStatement
) – the IAM statement to add.- Return type:
None
- apply_removal_policy(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
).- Parameters:
policy (
RemovalPolicy
)- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
Attributes
- connections
Access to network connections.
- env
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
The construct tree node associated with this construct.
- security_group_id
(deprecated) The identifier of the first security group associated with this interface VPC endpoint.
- Deprecated:
use the
connections
object- Stability:
deprecated
- stack
The stack in which this resource is defined.
- vpc_endpoint_creation_timestamp
The date and time the interface VPC endpoint was created.
- Attribute:
true
- vpc_endpoint_dns_entries
The DNS entries for the interface VPC endpoint.
- Attribute:
true
- vpc_endpoint_id
The interface VPC endpoint identifier.
- vpc_endpoint_network_interface_ids
One or more network interfaces for the interface VPC endpoint.
- Attribute:
true
Static Methods
- classmethod from_interface_vpc_endpoint_attributes(scope, id, *, port, vpc_endpoint_id, security_group_id=None, security_groups=None)
Imports an existing interface VPC endpoint.
- Parameters:
scope (
Construct
)id (
str
)port (
Union
[int
,float
]) – The port of the service of the interface VPC endpoint.vpc_endpoint_id (
str
) – The interface VPC endpoint identifier.security_group_id (
Optional
[str
]) – (deprecated) The identifier of the security group associated with the interface VPC endpoint.security_groups (
Optional
[Sequence
[ISecurityGroup
]]) – The security groups associated with the interface VPC endpoint.
- Return type:
- classmethod is_construct(x)
Return whether the given object is a Construct.
- Parameters:
x (
Any
)- Return type:
bool
- classmethod is_resource(construct)
Check whether the given construct is a Resource.
- Parameters:
construct (
IConstruct
)- Return type:
bool