@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.251Z") @Stability(value=Stable) 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. |
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnNatGateway(software.constructs.Construct scope,
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 |
|---|---|
String |
getAllocationId()
[Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway.
|
String |
getAttrNatGatewayId() |
protected Map<String,Object> |
getCfnProperties() |
String |
getConnectivityType()
Indicates whether the NAT gateway supports public or private connectivity.
|
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 Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setAllocationId(String value)
[Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway.
|
void |
setConnectivityType(String value)
Indicates whether the NAT gateway supports public or private connectivity.
|
void |
setSubnetId(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, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnNatGateway(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnNatGateway(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnNatGateway(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
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.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrNatGatewayId()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
@Stability(value=Stable) @NotNull public String getSubnetId()
@Stability(value=Stable)
public void setSubnetId(@NotNull
String value)
@Stability(value=Stable) @Nullable public String getAllocationId()
@Stability(value=Stable)
public void setAllocationId(@Nullable
String value)
@Stability(value=Stable) @Nullable public String getConnectivityType()
@Stability(value=Stable)
public void setConnectivityType(@Nullable
String value)
Copyright © 2022. All rights reserved.