@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:42.880Z") public class CfnVPCEndpoint extends CfnResource implements IInspectable
Specifies a VPC endpoint for a service. An endpoint enables you to create a private connection between your VPC and the service. The service may be provided by AWS , an AWS Marketplace Partner, or another AWS account. For more information, see the AWS PrivateLink User Guide .
An interface endpoint establishes connections between the subnets in your VPC and an AWS service, your own service, or a service hosted by another AWS account . You can specify the subnets in which to create the endpoint and the security groups to associate with the endpoint network interface.
A gateway endpoint serves as a target for a route in your route table for traffic destined for Amazon S3 or Amazon DynamoDB. You can specify an endpoint policy for the endpoint, which controls access to the service from your VPC. You can also specify the VPC route tables that use the endpoint. For information about connectivity to Amazon S3, see Why can’t I connect to an S3 bucket using a gateway VPC endpoint?
A Gateway Load Balancer endpoint provides private connectivity between your VPC and virtual appliances from a service provider.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.ec2.*; Object policyDocument; CfnVPCEndpoint cfnVPCEndpoint = CfnVPCEndpoint.Builder.create(this, "MyCfnVPCEndpoint") .serviceName("serviceName") .vpcId("vpcId") // the properties below are optional .policyDocument(policyDocument) .privateDnsEnabled(false) .routeTableIds(List.of("routeTableIds")) .securityGroupIds(List.of("securityGroupIds")) .subnetIds(List.of("subnetIds")) .vpcEndpointType("vpcEndpointType") .build();
Modifier and Type | Class and Description |
---|---|
static class |
CfnVPCEndpoint.Builder
A fluent builder for
CfnVPCEndpoint . |
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnVPCEndpoint(Construct scope,
java.lang.String id,
CfnVPCEndpointProps props)
Create a new `AWS::EC2::VPCEndpoint`.
|
protected |
CfnVPCEndpoint(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnVPCEndpoint(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrCreationTimestamp()
The date and time the VPC endpoint was created.
|
java.util.List<java.lang.String> |
getAttrDnsEntries()
(Interface endpoints) The DNS entries for the endpoint.
|
java.lang.String |
getAttrId()
The ID of the VPC endpoint.
|
java.util.List<java.lang.String> |
getAttrNetworkInterfaceIds()
(Interface endpoints) The network interface IDs.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.Object |
getPolicyDocument()
A policy that controls access to the service from the VPC.
|
java.lang.Object |
getPrivateDnsEnabled()
Indicate whether to associate a private hosted zone with the specified VPC.
|
java.util.List<java.lang.String> |
getRouteTableIds()
The IDs of the route tables.
|
java.util.List<java.lang.String> |
getSecurityGroupIds()
The IDs of the security groups to associate with the endpoint network interfaces.
|
java.lang.String |
getServiceName()
The service name.
|
java.util.List<java.lang.String> |
getSubnetIds()
The IDs of the subnets in which to create endpoint network interfaces.
|
java.lang.String |
getVpcEndpointType()
The type of endpoint.
|
java.lang.String |
getVpcId()
The ID of the VPC for the endpoint.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setPolicyDocument(java.lang.Object value)
A policy that controls access to the service from the VPC.
|
void |
setPrivateDnsEnabled(java.lang.Boolean value)
Indicate whether to associate a private hosted zone with the specified VPC.
|
void |
setPrivateDnsEnabled(IResolvable value)
Indicate whether to associate a private hosted zone with the specified VPC.
|
void |
setRouteTableIds(java.util.List<java.lang.String> value)
The IDs of the route tables.
|
void |
setSecurityGroupIds(java.util.List<java.lang.String> value)
The IDs of the security groups to associate with the endpoint network interfaces.
|
void |
setServiceName(java.lang.String value)
The service name.
|
void |
setSubnetIds(java.util.List<java.lang.String> value)
The IDs of the subnets in which to create endpoint network interfaces.
|
void |
setVpcEndpointType(java.lang.String value)
The type of endpoint.
|
void |
setVpcId(java.lang.String value)
The ID of the VPC for the endpoint.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnVPCEndpoint(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnVPCEndpoint(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnVPCEndpoint(Construct scope, java.lang.String id, CfnVPCEndpointProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrCreationTimestamp()
For example: Fri Sep 28 23:34:36 UTC 2018.
public java.util.List<java.lang.String> getAttrDnsEntries()
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.
public java.lang.String getAttrId()
public java.util.List<java.lang.String> getAttrNetworkInterfaceIds()
If you update the PrivateDnsEnabled
or SubnetIds
properties, the items in this list might change.
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public java.lang.Object getPolicyDocument()
If this parameter is not specified, the default policy allows full access to the service. Endpoint policies are supported only for gateway and interface endpoints.
For CloudFormation templates in YAML, you can provide the policy in JSON or YAML format. AWS CloudFormation converts YAML policies to JSON format before calling the API to create or modify the VPC endpoint.
public void setPolicyDocument(java.lang.Object value)
If this parameter is not specified, the default policy allows full access to the service. Endpoint policies are supported only for gateway and interface endpoints.
For CloudFormation templates in YAML, you can provide the policy in JSON or YAML format. AWS CloudFormation converts YAML policies to JSON format before calling the API to create or modify the VPC endpoint.
public java.lang.String getServiceName()
public void setServiceName(java.lang.String value)
public java.lang.String getVpcId()
public void setVpcId(java.lang.String value)
public java.lang.Object getPrivateDnsEnabled()
The private hosted zone contains a record set for the default public DNS name for the service for the Region (for example, kinesis.us-east-1.amazonaws.com
), which resolves to the private IP addresses of the endpoint network interfaces in the VPC. This enables you to make requests to the default public DNS name for the service instead of the public DNS names that are automatically generated by the VPC endpoint service.
To use a private hosted zone, you must set the following VPC attributes to true
: enableDnsHostnames
and enableDnsSupport
.
This property is supported only for interface endpoints.
Default: false
public void setPrivateDnsEnabled(java.lang.Boolean value)
The private hosted zone contains a record set for the default public DNS name for the service for the Region (for example, kinesis.us-east-1.amazonaws.com
), which resolves to the private IP addresses of the endpoint network interfaces in the VPC. This enables you to make requests to the default public DNS name for the service instead of the public DNS names that are automatically generated by the VPC endpoint service.
To use a private hosted zone, you must set the following VPC attributes to true
: enableDnsHostnames
and enableDnsSupport
.
This property is supported only for interface endpoints.
Default: false
public void setPrivateDnsEnabled(IResolvable value)
The private hosted zone contains a record set for the default public DNS name for the service for the Region (for example, kinesis.us-east-1.amazonaws.com
), which resolves to the private IP addresses of the endpoint network interfaces in the VPC. This enables you to make requests to the default public DNS name for the service instead of the public DNS names that are automatically generated by the VPC endpoint service.
To use a private hosted zone, you must set the following VPC attributes to true
: enableDnsHostnames
and enableDnsSupport
.
This property is supported only for interface endpoints.
Default: false
public java.util.List<java.lang.String> getRouteTableIds()
Routing is supported only for gateway endpoints.
public void setRouteTableIds(java.util.List<java.lang.String> value)
Routing is supported only for gateway endpoints.
public java.util.List<java.lang.String> getSecurityGroupIds()
If this parameter is not specified, we use the default security group for the VPC. Security groups are supported only for interface endpoints.
public void setSecurityGroupIds(java.util.List<java.lang.String> value)
If this parameter is not specified, we use the default security group for the VPC. Security groups are supported only for interface endpoints.
public java.util.List<java.lang.String> getSubnetIds()
You must specify this property for an interface endpoint or a Gateway Load Balancer endpoint. You can't specify this property for a gateway endpoint. For a Gateway Load Balancer endpoint, you can specify only one subnet.
public void setSubnetIds(java.util.List<java.lang.String> value)
You must specify this property for an interface endpoint or a Gateway Load Balancer endpoint. You can't specify this property for a gateway endpoint. For a Gateway Load Balancer endpoint, you can specify only one subnet.
public java.lang.String getVpcEndpointType()
Default: Gateway
public void setVpcEndpointType(java.lang.String value)
Default: Gateway