Struct aws_sdk_ec2::client::fluent_builders::CreateNatGateway
source · pub struct CreateNatGateway { /* private fields */ }
Expand description
Fluent builder constructing a request to CreateNatGateway
.
Creates a NAT gateway in the specified subnet. This action creates a network interface in the specified subnet with a private IP address from the IP address range of the subnet. You can create either a public NAT gateway or a private NAT gateway.
With a public NAT gateway, internet-bound traffic from a private subnet can be routed to the NAT gateway, so that instances in a private subnet can connect to the internet.
With a private NAT gateway, private communication is routed across VPCs and on-premises networks through a transit gateway or virtual private gateway. Common use cases include running large workloads behind a small pool of allowlisted IPv4 addresses, preserving private IPv4 addresses, and communicating between overlapping networks.
For more information, see NAT gateways in the Amazon Virtual Private Cloud User Guide.
Implementations§
source§impl CreateNatGateway
impl CreateNatGateway
sourcepub async fn customize(
self
) -> Result<CustomizableOperation<CreateNatGateway, AwsResponseRetryClassifier>, SdkError<CreateNatGatewayError>>
pub async fn customize(
self
) -> Result<CustomizableOperation<CreateNatGateway, AwsResponseRetryClassifier>, SdkError<CreateNatGatewayError>>
Consume this builder, creating a customizable operation that can be modified before being sent. The operation’s inner http::Request can be modified as well.
sourcepub async fn send(
self
) -> Result<CreateNatGatewayOutput, SdkError<CreateNatGatewayError>>
pub async fn send(
self
) -> Result<CreateNatGatewayOutput, SdkError<CreateNatGatewayError>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn allocation_id(self, input: impl Into<String>) -> Self
pub fn allocation_id(self, input: impl Into<String>) -> Self
[Public NAT gateways only] The allocation ID of an Elastic IP address to associate with the NAT gateway. You cannot specify an Elastic IP address with a private NAT gateway. If the Elastic IP address is associated with another resource, you must first disassociate it.
sourcepub fn set_allocation_id(self, input: Option<String>) -> Self
pub fn set_allocation_id(self, input: Option<String>) -> Self
[Public NAT gateways only] The allocation ID of an Elastic IP address to associate with the NAT gateway. You cannot specify an Elastic IP address with a private NAT gateway. If the Elastic IP address is associated with another resource, you must first disassociate it.
sourcepub fn client_token(self, input: impl Into<String>) -> Self
pub fn client_token(self, input: impl Into<String>) -> Self
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.
Constraint: Maximum 64 ASCII characters.
sourcepub fn set_client_token(self, input: Option<String>) -> Self
pub fn set_client_token(self, input: Option<String>) -> Self
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.
Constraint: Maximum 64 ASCII characters.
sourcepub fn dry_run(self, input: bool) -> Self
pub fn dry_run(self, input: bool) -> Self
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
sourcepub fn set_dry_run(self, input: Option<bool>) -> Self
pub fn set_dry_run(self, input: Option<bool>) -> Self
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
sourcepub fn subnet_id(self, input: impl Into<String>) -> Self
pub fn subnet_id(self, input: impl Into<String>) -> Self
The subnet in which to create the NAT gateway.
sourcepub fn set_subnet_id(self, input: Option<String>) -> Self
pub fn set_subnet_id(self, input: Option<String>) -> Self
The subnet in which to create the NAT gateway.
sourcepub fn tag_specifications(self, input: TagSpecification) -> Self
pub fn tag_specifications(self, input: TagSpecification) -> Self
Appends an item to TagSpecifications
.
To override the contents of this collection use set_tag_specifications
.
The tags to assign to the NAT gateway.
sourcepub fn set_tag_specifications(self, input: Option<Vec<TagSpecification>>) -> Self
pub fn set_tag_specifications(self, input: Option<Vec<TagSpecification>>) -> Self
The tags to assign to the NAT gateway.
sourcepub fn connectivity_type(self, input: ConnectivityType) -> Self
pub fn connectivity_type(self, input: ConnectivityType) -> Self
Indicates whether the NAT gateway supports public or private connectivity. The default is public connectivity.
sourcepub fn set_connectivity_type(self, input: Option<ConnectivityType>) -> Self
pub fn set_connectivity_type(self, input: Option<ConnectivityType>) -> Self
Indicates whether the NAT gateway supports public or private connectivity. The default is public connectivity.
sourcepub fn private_ip_address(self, input: impl Into<String>) -> Self
pub fn private_ip_address(self, input: impl Into<String>) -> Self
The private IPv4 address to assign to the NAT gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
sourcepub fn set_private_ip_address(self, input: Option<String>) -> Self
pub fn set_private_ip_address(self, input: Option<String>) -> Self
The private IPv4 address to assign to the NAT gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
Trait Implementations§
source§impl Clone for CreateNatGateway
impl Clone for CreateNatGateway
source§fn clone(&self) -> CreateNatGateway
fn clone(&self) -> CreateNatGateway
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more