subnets
Retrieves a list of subnets
in a region
Overview
Name | subnets |
Type | Resource |
Description | Specifies 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*. |
Id | aws.ec2.subnets |
Fields
Name | Datatype | Description |
---|---|---|
subnet_id | string | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | data__DesiredState, region |
list_resource | SELECT | region |
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