[ aws . network-firewall ]
Associates the specified subnets in the Amazon VPC to the firewall. You can specify one subnet for each of the Availability Zones that the VPC spans.
This request creates an Network Firewall firewall endpoint in each of the subnets. To enable the firewall’s protections, you must also modify the VPC’s route tables for each subnet’s Availability Zone, to redirect the traffic that’s coming into and going out of the zone through the firewall endpoint.
For a proxy mode firewall, use this operation to add Availability Zones to the firewall. For each subnet, specify a NAT gateway in NatGatewayCreateMappings in the same Availability Zone. You can’t add an Availability Zone that the firewall already uses. The firewall keeps working in its other Availability Zones while Network Firewall sets up the new one. If Network Firewall can’t set up the new Availability Zone, it removes the Availability Zone from the firewall. It also deletes the NAT gateway that it created there. The Availability Zone’s Attachment status shows the reason. You can then add the Availability Zone again.
See also: AWS API Documentation
associate-subnets
[--update-token <value>]
[--firewall-arn <value>]
[--firewall-name <value>]
--subnet-mappings <value>
[--nat-gateway-create-mappings <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]
[--help]
--update-token (string)
An optional token that you can use for optimistic locking. Network Firewall returns a token to your requests that access the firewall. The token marks the state of the firewall resource at the time of the request.
To make an unconditional change to the firewall, omit the token in your update request. Without the token, Network Firewall performs your updates regardless of whether the firewall has changed since you last retrieved it.
To make a conditional change to the firewall, provide the token in your update request. Network Firewall uses the token to ensure that the firewall hasn’t changed since you last retrieved it. If it has changed, the operation fails with an
InvalidTokenException. If this happens, retrieve the firewall again to get a current copy of it with a new token. Reapply your changes as needed, then try the operation again using the new token.Constraints:
- min:
1- max:
1024- pattern:
^([0-9a-f]{8})-([0-9a-f]{4}-){3}([0-9a-f]{12})$
--firewall-arn (string)
The Amazon Resource Name (ARN) of the firewall.
You must specify the ARN or the name, and you can specify both.
Constraints:
- min:
1- max:
256- pattern:
^arn:aws.*
--firewall-name (string)
The descriptive name of the firewall. You can’t change the name of a firewall after you create it.
You must specify the ARN or the name, and you can specify both.
Constraints:
- min:
1- max:
128- pattern:
^[a-zA-Z0-9-]+$
--subnet-mappings (list) [required]
The IDs of the subnets that you want to associate with the firewall.
(structure)
The ID for a subnet that’s used in an association with a firewall. This is used in
CreateFirewall,AssociateSubnets, andCreateVpcEndpointAssociation. Network Firewall creates an instance of the associated firewall in each subnet that you specify, to filter traffic in the subnet’s Availability Zone.SubnetId -> (string) [required]
The unique identifier for the subnet.IPAddressType -> (string)
The subnet’s IP address type. You can’t change the IP address type after you create the subnet.
Possible values:
DUALSTACKIPV4IPV6
Shorthand Syntax:
SubnetId=string,IPAddressType=string ...
JSON Syntax:
[
{
"SubnetId": "string",
"IPAddressType": "DUALSTACK"|"IPV4"|"IPV6"
}
...
]
--nat-gateway-create-mappings (list)
The NAT gateways that Network Firewall creates for the Availability Zones that you add to a proxy mode firewall. For a proxy mode firewall, you must specify one mapping for each Availability Zone in
SubnetMappings, and no other Availability Zones. Each NAT gateway subnet must be in the firewall’s VPC and can’t be one of the firewall endpoint subnets.You can’t specify this for a firewall that isn’t a proxy mode firewall.
Constraints:
- min:
1- max:
20(structure)
A NAT gateway that Network Firewall creates for a proxy mode firewall in one Availability Zone. You use this in
CreateFirewallandAssociateSubnets.To create a public NAT gateway, specify
AllocationIds, and onePrivateIpsaddress for each Elastic IP address. To create a private NAT gateway, specify onlyPrivateIps. You must specify at least one of them. Each Elastic IP address and private IP address can appear only once in a request.The NAT gateway is a resource in your account. To change its IP addresses, use Amazon EC2 NAT gateway actions.
SubnetId -> (string) [required]
The ID of the subnet where Network Firewall creates the NAT gateway. The subnet must be in the firewall’s VPC and can’t be one of the firewall endpoint subnets. Each mapping must be in a different Availability Zone.AllocationIds -> (list)
The allocation IDs of the Elastic IP addresses for a public NAT gateway, from 1 to 8. For each allocation ID, specify one address in
PrivateIps. If you don’t specify this, Network Firewall creates a private NAT gateway.Constraints:
- min:
1- max:
32(string)
PrivateIps -> (list)
The private IPv4 addresses of the NAT gateway. The addresses must be in the subnet that you specify and can’t be the subnet’s reserved addresses.
For a public NAT gateway, you must specify exactly one address for each Elastic IP address in
AllocationIds, even if you specify only one. For a private NAT gateway, specify from 1 to 8 addresses. The first address is the primary address.Constraints:
- min:
1- max:
32(string)
Shorthand Syntax:
SubnetId=string,AllocationIds=string,string,PrivateIps=string,string ...
JSON Syntax:
[
{
"SubnetId": "string",
"AllocationIds": ["string", ...],
"PrivateIps": ["string", ...]
}
...
]
--cli-input-json | --cli-input-yaml (string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.
--generate-cli-skeleton (string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.
--debug (boolean)
Turn on debug logging.
--endpoint-url (string)
Override command’s default URL with the given URL.
--no-verify-ssl (boolean)
By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.
--no-paginate (boolean)
Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.
--output (string)
The formatting style for command output.
--query (string)
A JMESPath query to use in filtering the response data.
--profile (string)
Use a specific profile from your credential file.
--region (string)
The region to use. Overrides config/env settings.
--version (string)
Display the version of this tool.
--color (string)
Turn on/off color output.
--no-sign-request (boolean)
Do not sign requests. Credentials will not be loaded if this argument is provided.
--ca-bundle (string)
The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.
--cli-read-timeout (int)
The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.
--cli-connect-timeout (int)
The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.
--cli-binary-format (string)
The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob fileb:// will always be treated as binary and use the file contents directly regardless of the cli-binary-format setting. When using file:// the file contents will need to properly formatted for the configured cli-binary-format.
--no-cli-pager (boolean)
Disable cli pager for output.
--cli-auto-prompt (boolean)
Automatically prompt for CLI input parameters.
--no-cli-auto-prompt (boolean)
Disable automatically prompt for CLI input parameters.
--cli-error-format (string)
The formatting style for error output. By default, errors are displayed in enhanced format.
--help (boolean)
Display help for the command/subcommand.
FirewallArn -> (string)
The Amazon Resource Name (ARN) of the firewall.
Constraints:
- min:
1- max:
256- pattern:
^arn:aws.*
FirewallName -> (string)
The descriptive name of the firewall. You can’t change the name of a firewall after you create it.
Constraints:
- min:
1- max:
128- pattern:
^[a-zA-Z0-9-]+$
SubnetMappings -> (list)
The IDs of the subnets that are associated with the firewall.
(structure)
The ID for a subnet that’s used in an association with a firewall. This is used in
CreateFirewall,AssociateSubnets, andCreateVpcEndpointAssociation. Network Firewall creates an instance of the associated firewall in each subnet that you specify, to filter traffic in the subnet’s Availability Zone.SubnetId -> (string) [required]
The unique identifier for the subnet.IPAddressType -> (string)
The subnet’s IP address type. You can’t change the IP address type after you create the subnet.
Possible values:
DUALSTACKIPV4IPV6
UpdateToken -> (string)
An optional token that you can use for optimistic locking. Network Firewall returns a token to your requests that access the firewall. The token marks the state of the firewall resource at the time of the request.
To make an unconditional change to the firewall, omit the token in your update request. Without the token, Network Firewall performs your updates regardless of whether the firewall has changed since you last retrieved it.
To make a conditional change to the firewall, provide the token in your update request. Network Firewall uses the token to ensure that the firewall hasn’t changed since you last retrieved it. If it has changed, the operation fails with an
InvalidTokenException. If this happens, retrieve the firewall again to get a current copy of it with a new token. Reapply your changes as needed, then try the operation again using the new token.Constraints:
- min:
1- max:
1024- pattern:
^([0-9a-f]{8})-([0-9a-f]{4}-){3}([0-9a-f]{12})$