NetworkManager / Client / update_attachment_nat_configuration
update_attachment_nat_configuration¶
- NetworkManager.Client.update_attachment_nat_configuration(**kwargs)¶
Updates the NAT configuration of a core network attachment. You can enable or disable NAT gateway support, specify whether the core network installs system routes for the NAT CIDR blocks, and replace the NAT rules of the attachment. Specify at least one of
NatGatewaySupport,NatSystemRouteSupport, orNatGatewayRules.Only the core network owner can update the NAT configuration of an attachment. The attachment must be in the
AVAILABLE,PENDING_ATTACHMENT_ACCEPTANCE, orPENDING_TAG_ACCEPTANCEstate. Changes are applied asynchronously, and the attachment is in theUPDATINGstate while they are applied. If the attachment is pending acceptance, the NAT configuration is stored and is applied after the attachment is accepted.See also: AWS API Documentation
Request Syntax
response = client.update_attachment_nat_configuration( AttachmentId='string', NatGatewaySupport='ENABLE'|'DISABLE', NatSystemRouteSupport=True|False, NatGatewayRules=[ { 'RuleNumber': 123, 'MatchSourceCidr': 'string', 'NatCidr': 'string' }, ], ClientToken='string' )
- Parameters:
AttachmentId (string) –
[REQUIRED]
The ID of the attachment to update the NAT configuration for.
NatGatewaySupport (string) – Specifies whether to enable or disable NAT gateway support on the attachment. When you disable NAT gateway support, the attachment keeps its NAT rules but doesn’t apply them. To enable NAT gateway support, the attachment must have at least one NAT rule, either specified in this request or already configured on the attachment. If you omit this parameter, NAT gateway support is unchanged.
NatSystemRouteSupport (boolean) – Specifies whether the core network installs system routes for the NAT CIDR blocks of the attachment’s NAT rules. System routes have a route type of
SYSTEM. NAT is applied to traffic whether or not this option is enabled. If you omit this parameter, the current value is unchanged.NatGatewayRules (list) –
The complete set of NAT rules for the attachment, up to 50 rules. The rules that you specify replace the existing rules of the attachment, matched by rule number. Existing rules that aren’t included in the request are deleted. To delete all NAT rules, specify an empty list. You can delete all NAT rules only when NAT gateway support is disabled, or when you disable it in the same request. If you omit this parameter, the existing rules are unchanged.
(dict) –
Describes a NAT rule to configure on an attachment. Source addresses in the source CIDR block of traffic from the attachment are translated to the same host addresses in the NAT CIDR block. Traffic to an address in the NAT CIDR block is translated back to the matching address in the source CIDR block.
RuleNumber (integer) – [REQUIRED]
The rule number, from 1 to 32766. Each rule number must be unique for the attachment.
MatchSourceCidr (string) – [REQUIRED]
The IPv4 CIDR block to match against the source address of traffic from the attachment. The CIDR block can’t overlap with the multicast range (224.0.0.0/4).
NatCidr (string) – [REQUIRED]
The IPv4 CIDR block to translate matching source addresses to. The prefix length must be the same as the prefix length of
MatchSourceCidr. The CIDR block must be within a private (RFC 1918) or shared address space (RFC 6598) range. The CIDR blocks of the NAT rules of an attachment can’t overlap with each other.
ClientToken (string) –
The client token associated with the request.
This field is autopopulated if not provided.
- Return type:
dict
- Returns:
Response Syntax
{ 'AttachmentId': 'string', 'NatGatewaySupport': 'ENABLED'|'ENABLING'|'DISABLED'|'DISABLING'|'PENDING_ATTACHMENT_ACCEPTANCE', 'NatSystemRouteSupport': True|False, 'NatGatewayRules': [ { 'RuleNumber': 123, 'MatchSourceCidr': 'string', 'NatCidr': 'string', 'State': 'CREATING'|'MODIFYING'|'DELETING'|'ACTIVATED'|'ACTIVATING'|'DEACTIVATED'|'DEACTIVATING'|'FAILED'|'PENDING_ATTACHMENT_ACCEPTANCE' }, ] }
Response Structure
(dict) –
AttachmentId (string) –
The ID of the attachment.
NatGatewaySupport (string) –
The state of NAT gateway support on the attachment. The transitional states
ENABLINGandDISABLINGchange toENABLEDorDISABLEDafter the update is applied. The state isPENDING_ATTACHMENT_ACCEPTANCEwhen NAT gateway support is enabled on an attachment that is pending acceptance.NatSystemRouteSupport (boolean) –
Indicates whether the core network installs system routes for the NAT CIDR blocks of the attachment’s NAT rules.
NatGatewayRules (list) –
The NAT rules of the attachment, including rules that are being deleted.
(dict) –
Describes a NAT rule of an attachment.
RuleNumber (integer) –
The rule number. Rule numbers identify the rules of an attachment and don’t set the order in which rules are evaluated.
MatchSourceCidr (string) –
The source CIDR block that the rule matches for traffic from the attachment.
NatCidr (string) –
The CIDR block that matching source addresses are translated to.
State (string) –
The state of the NAT rule. The possible values are the following:
CREATING: The rule is being created.MODIFYING: The rule is being modified.DELETING: The rule is being deleted.ACTIVATING: NAT gateway support is being enabled, and the rule is being applied.ACTIVATED: NAT gateway support is enabled, and the rule is applied.DEACTIVATING: NAT gateway support is being disabled, and the rule is being removed from use.DEACTIVATED: NAT gateway support is disabled, and the rule isn’t applied.FAILED: The attachment failed to be created, and the rule isn’t applied.PENDING_ATTACHMENT_ACCEPTANCE: The attachment is pending acceptance. The rule is applied after the attachment is accepted.
Exceptions