Class CfnNatGateway
Specifies a network address translation (NAT) gateway in the specified subnet.
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnNatGateway : CfnResource, IInspectable, ITaggable
Syntax (vb)
Public Class CfnNatGateway
Inherits CfnResource
Implements IInspectable, ITaggable
Remarks
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. For more information, see NAT gateways in the Amazon VPC User Guide .
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.
When you associate an Elastic IP address or secondary Elastic IP address with a public NAT gateway, the network border group of the Elastic IP address must match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. Otherwise, the NAT gateway fails to launch. You can see the network border group for the AZ by viewing the details of the subnet. Similarly, you can view the network border group for the Elastic IP address by viewing its details. For more information, see Allocate an Elastic IP address in the Amazon VPC User Guide .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-natgateway.html
CloudformationResource: AWS::EC2::NatGateway
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var cfnNatGateway = new CfnNatGateway(this, "MyCfnNatGateway", new CfnNatGatewayProps {
SubnetId = "subnetId",
// the properties below are optional
AllocationId = "allocationId",
ConnectivityType = "connectivityType",
MaxDrainDurationSeconds = 123,
PrivateIpAddress = "privateIpAddress",
SecondaryAllocationIds = new [] { "secondaryAllocationIds" },
SecondaryPrivateIpAddressCount = 123,
SecondaryPrivateIpAddresses = new [] { "secondaryPrivateIpAddresses" },
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
});
Synopsis
Constructors
CfnNatGateway(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnNatGateway(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnNatGateway(Construct, String, ICfnNatGatewayProps) |
Properties
AllocationId | [Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway. |
AttrNatGatewayId | The ID of the NAT gateway. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
ConnectivityType | Indicates whether the NAT gateway supports public or private connectivity. |
MaxDrainDurationSeconds | The maximum amount of time to wait (in seconds) before forcibly releasing the IP addresses if connections are still in progress. |
PrivateIpAddress | The private IPv4 address to assign to the NAT gateway. |
SecondaryAllocationIds | Secondary EIP allocation IDs. |
SecondaryPrivateIpAddressCount | [Private NAT gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT gateway. |
SecondaryPrivateIpAddresses | Secondary private IPv4 addresses. |
SubnetId | The ID of the subnet in which the NAT gateway is located. |
Tags | Tag Manager which manages the tags for this resource. |
TagsRaw | The tags for the NAT gateway. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnNatGateway(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnNatGateway(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnNatGateway(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnNatGateway(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnNatGateway(Construct, String, ICfnNatGatewayProps)
public CfnNatGateway(Construct scope, string id, ICfnNatGatewayProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnNatGatewayProps
Resource properties.
Properties
AllocationId
[Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway.
public virtual string AllocationId { get; set; }
Property Value
System.String
AttrNatGatewayId
The ID of the NAT gateway.
public virtual string AttrNatGatewayId { get; }
Property Value
System.String
Remarks
CloudformationAttribute: NatGatewayId
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
ConnectivityType
Indicates whether the NAT gateway supports public or private connectivity.
public virtual string ConnectivityType { get; set; }
Property Value
System.String
MaxDrainDurationSeconds
The maximum amount of time to wait (in seconds) before forcibly releasing the IP addresses if connections are still in progress.
public virtual Nullable<double> MaxDrainDurationSeconds { get; set; }
Property Value
System.Nullable<System.Double>
PrivateIpAddress
The private IPv4 address to assign to the NAT gateway.
public virtual string PrivateIpAddress { get; set; }
Property Value
System.String
SecondaryAllocationIds
Secondary EIP allocation IDs.
public virtual string[] SecondaryAllocationIds { get; set; }
Property Value
System.String[]
SecondaryPrivateIpAddressCount
[Private NAT gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT gateway.
public virtual Nullable<double> SecondaryPrivateIpAddressCount { get; set; }
Property Value
System.Nullable<System.Double>
SecondaryPrivateIpAddresses
Secondary private IPv4 addresses.
public virtual string[] SecondaryPrivateIpAddresses { get; set; }
Property Value
System.String[]
SubnetId
The ID of the subnet in which the NAT gateway is located.
public virtual string SubnetId { get; set; }
Property Value
System.String
Tags
Tag Manager which manages the tags for this resource.
public virtual TagManager Tags { get; }
Property Value
TagsRaw
The tags for the NAT gateway.
public virtual ICfnTag[] TagsRaw { get; set; }
Property Value
ICfnTag[]
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>