UpdateAttachmentNatConfiguration
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, or NatGatewayRules.
Only the core network owner can update the NAT configuration of an attachment. The attachment must be in the AVAILABLE, PENDING_ATTACHMENT_ACCEPTANCE, or PENDING_TAG_ACCEPTANCE state. Changes are applied asynchronously, and the attachment is in the UPDATING state while they are applied. If the attachment is pending acceptance, the NAT configuration is stored and is applied after the attachment is accepted.
Request Syntax
PATCH /attachments/attachmentId/nat-configuration HTTP/1.1
Content-type: application/json
{
"ClientToken": "string",
"NatGatewayRules": [
{
"MatchSourceCidr": "string",
"NatCidr": "string",
"RuleNumber": number
}
],
"NatGatewaySupport": "string",
"NatSystemRouteSupport": boolean
}
URI Request Parameters
The request uses the following URI parameters.
- attachmentId
-
The ID of the attachment to update the NAT configuration for.
Length Constraints: Minimum length of 0. Maximum length of 50.
Pattern:
^attachment-([0-9a-f]{8,17})$Required: Yes
Request Body
The request accepts the following data in JSON format.
- ClientToken
-
The client token associated with the request.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 256.
Pattern:
[\s\S]*Required: No
- NatGatewayRules
-
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.
Type: Array of NatRuleRequest objects
Array Members: Minimum number of 0 items. Maximum number of 50 items.
Required: No
- NatGatewaySupport
-
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.
Type: String
Valid Values:
ENABLE | DISABLERequired: No
- NatSystemRouteSupport
-
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.Type: Boolean
Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"AttachmentId": "string",
"NatGatewayRules": [
{
"MatchSourceCidr": "string",
"NatCidr": "string",
"RuleNumber": number,
"State": "string"
}
],
"NatGatewaySupport": "string",
"NatSystemRouteSupport": boolean
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- AttachmentId
-
The ID of the attachment.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 50.
Pattern:
^attachment-([0-9a-f]{8,17})$ - NatGatewayRules
-
The NAT rules of the attachment, including rules that are being deleted.
Type: Array of NatRule objects
Array Members: Minimum number of 0 items. Maximum number of 50 items.
- NatGatewaySupport
-
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.Type: String
Valid Values:
ENABLED | ENABLING | DISABLED | DISABLING | PENDING_ATTACHMENT_ACCEPTANCE - NatSystemRouteSupport
-
Indicates whether the core network installs system routes for the NAT CIDR blocks of the attachment's NAT rules.
Type: Boolean
Errors
For information about the errors that are common to all actions, see Common Error Types.
- AccessDeniedException
-
You do not have sufficient access to perform this action.
HTTP Status Code: 403
- ConflictException
-
There was a conflict processing the request. Updating or deleting the resource can cause an inconsistent state.
- ResourceId
-
The ID of the resource.
- ResourceType
-
The resource type.
HTTP Status Code: 409
- InternalServerException
-
The request has failed due to an internal error.
- RetryAfterSeconds
-
Indicates when to retry the request.
HTTP Status Code: 500
- ResourceNotFoundException
-
The specified resource could not be found.
- Context
-
The specified resource could not be found.
- ResourceId
-
The ID of the resource.
- ResourceType
-
The resource type.
HTTP Status Code: 404
- ServiceQuotaExceededException
-
A service limit was exceeded.
- LimitCode
-
The limit code.
- Message
-
The error message.
- ResourceId
-
The ID of the resource.
- ResourceType
-
The resource type.
- ServiceCode
-
The service code.
HTTP Status Code: 402
- ThrottlingException
-
The request was denied due to request throttling.
- RetryAfterSeconds
-
Indicates when to retry the request.
HTTP Status Code: 429
- ValidationException
-
The input fails to satisfy the constraints.
- Fields
-
The fields that caused the error, if applicable.
- Reason
-
The reason for the error.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: