@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-20T22:19:59.049Z") public class CfnNatGateway extends CfnResource implements IInspectable
Specifies a network address translation (NAT) gateway in the specified subnet. You can create either a public NAT gateway or a private NAT gateway. The default is a public NAT gateway. If you create a public NAT gateway, you must specify an elastic IP address.
With a NAT gateway, instances in a private subnet can connect to the internet, other AWS services, or an on-premises network using the IP address of the NAT gateway.
If you add a default route ( AWS::EC2::Route
resource) that points to a NAT gateway, specify the NAT gateway ID for the route's NatGatewayId
property.
For more information, see NAT Gateways in the Amazon VPC User Guide .
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.*; CfnNatGateway cfnNatGateway = CfnNatGateway.Builder.create(this, "MyCfnNatGateway") .subnetId("subnetId") // the properties below are optional .allocationId("allocationId") .connectivityType("connectivityType") .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .build();
Modifier and Type | Class and Description |
---|---|
static class |
CfnNatGateway.Builder
A fluent builder for
CfnNatGateway . |
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 |
---|---|
|
CfnNatGateway(Construct scope,
java.lang.String id,
CfnNatGatewayProps props)
Create a new `AWS::EC2::NatGateway`.
|
protected |
CfnNatGateway(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnNatGateway(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAllocationId()
[Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getConnectivityType()
Indicates whether the NAT gateway supports public or private connectivity.
|
java.lang.String |
getSubnetId()
The ID of the subnet in which the NAT gateway is located.
|
TagManager |
getTags()
The tags for the NAT gateway.
|
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 |
setAllocationId(java.lang.String value)
[Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway.
|
void |
setConnectivityType(java.lang.String value)
Indicates whether the NAT gateway supports public or private connectivity.
|
void |
setSubnetId(java.lang.String value)
The ID of the subnet in which the NAT gateway is located.
|
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 CfnNatGateway(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnNatGateway(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnNatGateway(Construct scope, java.lang.String id, CfnNatGatewayProps 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.protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
public java.lang.String getSubnetId()
public void setSubnetId(java.lang.String value)
public java.lang.String getAllocationId()
public void setAllocationId(java.lang.String value)
public java.lang.String getConnectivityType()
public void setConnectivityType(java.lang.String value)