Skip to main content

subnets

Retrieves a list of subnets in a region

Overview

Namesubnets
TypeResource
DescriptionSpecifies a subnet for the specified VPC.<br/> For an IPv4 only subnet, specify an IPv4 CIDR block. If the VPC has an IPv6 CIDR block, you can create an IPv6 only subnet or a dual stack subnet instead. For an IPv6 only subnet, specify an IPv6 CIDR block. For a dual stack subnet, specify both an IPv4 CIDR block and an IPv6 CIDR block.<br/> For more information, see [Subnets for your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/configure-subnets.html) in the *Amazon VPC User Guide*.
Idaws.ec2.subnets

Fields

NameDatatypeDescription
subnet_idstring
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTdata__DesiredState, region
list_resourceSELECTregion

SELECT Example

SELECT
region,
subnet_id
FROM aws.ec2.subnets
WHERE region = 'us-east-1'

Permissions

To operate on the subnets resource, the following permissions are required:

Create

ec2:DescribeSubnets,
ec2:CreateSubnet,
ec2:CreateTags,
ec2:ModifySubnetAttribute

List

ec2:DescribeSubnets,
ec2:DescribeNetworkAcls