Class CfnNatGateway
A CloudFormation AWS::EC2::NatGateway
.
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.dll
Syntax (csharp)
public class CfnNatGateway : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnNatGateway
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
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 .
CloudformationResource: AWS::EC2::NatGateway
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-natgateway.html
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(Construct, String, ICfnNatGatewayProps) | Create a new |
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 |
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 | The tags for the NAT gateway. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnNatGateway(Construct, String, ICfnNatGatewayProps)
Create a new AWS::EC2::NatGateway
.
public CfnNatGateway(Construct scope, string id, ICfnNatGatewayProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnNatGatewayProps
- resource properties.
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
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
Remarks
This property is required for a public NAT gateway and cannot be specified with a private NAT gateway.
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
Remarks
The default is public connectivity.
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>
Remarks
Default value is 350 seconds.
PrivateIpAddress
The private IPv4 address to assign to the NAT gateway.
public virtual string PrivateIpAddress { get; set; }
Property Value
System.String
Remarks
If you don't provide an address, a private IPv4 address will be automatically assigned.
SecondaryAllocationIds
Secondary EIP allocation IDs.
public virtual string[] SecondaryAllocationIds { get; set; }
Property Value
System.String[]
Remarks
For more information, see Create a NAT gateway in the Amazon VPC User Guide .
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>
Remarks
For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide .
SecondaryPrivateIpAddressCount
and SecondaryPrivateIpAddresses
cannot be set at the same time.
SecondaryPrivateIpAddresses
Secondary private IPv4 addresses.
public virtual string[] SecondaryPrivateIpAddresses { get; set; }
Property Value
System.String[]
Remarks
For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide .
SecondaryPrivateIpAddressCount
and SecondaryPrivateIpAddresses
cannot be set at the same time.
SubnetId
The ID of the subnet in which the NAT gateway is located.
public virtual string SubnetId { get; set; }
Property Value
System.String
Remarks
Tags
The tags for the NAT gateway.
public virtual TagManager Tags { get; }
Property Value
Remarks
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>