Subnet
A resource of the AWS provider, version 0.3.0, in its Networking group. Import it with:
import Subnet from "aws/networking"Example
resource Subnet example {
vpcId = "example-value"
cidrBlock = "example-value"
ipv6CidrBlock = "example-value"
availabilityZone = "example-value"
mapPublicIpOnLaunch = false
assignIpv6AddressOnCreation = false
tags = "..."
}Properties
Set by your code in the resource block. A required one must be set; any other you leave out takes the value under Default, if it has one.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
vpcId | string | — | No | The VPC ID where the subnet will be created |
cidrBlock | string | — | No | The IPv4 CIDR block for the subnet (e.g., 10.0.1.0/24) |
ipv6CidrBlock | string | — | No | The IPv6 CIDR block for the subnet |
availabilityZone | string | — | No | The Availability Zone for the subnet (e.g., us-east-1a) |
mapPublicIpOnLaunch | boolean | false | No | Auto-assign public IPv4 addresses to instances |
assignIpv6AddressOnCreation | boolean | false | No | Assign IPv6 addresses to instances |
tags | object | — | No | Tags to apply to the subnet |
Set by AWS after the resource is created: your code can read them but not set them. An importable one identifies an existing resource.
| Name | Type | Importable | Description |
|---|---|---|---|
subnetId | string | No | The subnet ID assigned by AWS |
state | string | No | The current state of the subnet (pending, available) |
availabilityZoneId | string | No | The Availability Zone ID |
availableIpAddressCount | number | No | The number of available IPv4 addresses |
defaultForAz | boolean | No | Whether this is the default subnet for the AZ |
ownerId | string | No | The AWS account ID that owns the subnet |
arn | string | Yes | The Amazon Resource Name (ARN) of the subnet |