Skip to main content

Retrieving the Data Source

This data source can be retrieved by one of ID or name.
Retrieve by ID
To retrieve by ID, fill in only the id field:
data ... {
    id = "your-ID"
}
Retrieve by Name
To retrieve by name, fill in only the name and parent_id fields:
data ... {
    name      = "your name"
    parent_id = "data-source-parent-id"
}
Defines a Subnet, a segment of a network used for more granular control and management. Subnet uses pools to organize address space.

Schema

Optional

  • id (String) Identifier for the resource, unique for its resource type.
  • name (String) Human readable name for the resource.
  • parent_id (String) Identifier of the parent resource to which the resource belongs.

Read-Only

  • created_at (String) : Timestamp indicating when the resource was created. A string representing a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DDTHH:MM:SS.SSS±HH:MM
  • ipv4_private_pools (Attributes) : Private IPv4 address pools for this subnet. If unspecified, pools from the associated network are used. (see below for nested schema)
  • ipv4_public_pools (Attributes) : Public IPv4 address pools for this subnet. If unspecified, pools from the associated network are used. (see below for nested schema)
  • labels (Map of String) : Labels associated with the resource.
  • metadata (Attributes) : Metadata for the subnet resource. metadata.parent_id represents IAM container

    Inner value description

    Common resource metadata. (see below for nested schema)
  • network_id (String) ID of the network this subnet belongs to.
  • resource_version (Number) : Version of the resource for safe concurrent modifications and consistent reads. Positive and monotonically increases on each resource spec change (but not on each change of the resource’s container(s) or status). Service allows zero value or current.
  • route_table_id (String) : ID of the route table to associate with the subnet. If unspecified, the network’s default route table is used.
  • status (Attributes) Status of the subnet. (see below for nested schema)
  • updated_at (String) : Timestamp indicating when the resource was last updated. A string representing a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DDTHH:MM:SS.SSS±HH:MM

Nested Schema for ipv4_private_pools

Read-Only:
  • pools (Attributes List) : List of private IPv4 CIDR blocks for this subnet. Must not overlap with other resources in the network Must be empty if use_network_pools is true. (see below for nested schema)
  • use_network_pools (Boolean) : If true, inherit private IPv4 pools from the network. Defaults to true. Must be false if pools is specified.

Nested Schema for ipv4_private_pools.pools

Read-Only:

Nested Schema for ipv4_private_pools.pools.cidrs

Read-Only:
  • cidr (String) : A CIDR block (e.g., “10.1.2.0/24”) or a prefix length (e.g., “/24”). If prefix length is specified, the CIDR block will be auto-allocated from the network’s available space.
  • max_mask_length (Number) Maximum mask length for an allocation from this block. Defaults to /32 for IPv4.
  • state (String) : Controls provisioning of IP addresses from the CIDR block. Defaults to AVAILABLE.

    Supported values

    Controls provisioning of IP addresses from this pool to other pools or allocations. Defaults to AVAILABLE. Possible values:
    • STATE_UNSPECIFIED - Not used, mandated by the protocol.
    • AVAILABLE - Default state. Provision of the IP addresses from this CIDR block is allowed.
    • DISABLED - Provision of the IP addresses from this CIDR block is denied.

Nested Schema for ipv4_public_pools

Read-Only:
  • pools (Attributes List) : List of public IPv4 CIDR blocks for this subnet. Must not overlap with other resources in the network. Must be empty if use_network_pools is true. (see below for nested schema)
  • use_network_pools (Boolean) : If true, inherit public IPv4 pools from the network. Must be false if pools is specified.

Nested Schema for ipv4_public_pools.pools

Read-Only:

Nested Schema for ipv4_public_pools.pools.cidrs

Read-Only:
  • cidr (String) : A CIDR block (e.g., “10.1.2.0/24”) or a prefix length (e.g., “/24”). If prefix length is specified, the CIDR block will be auto-allocated from the network’s available space.
  • max_mask_length (Number) Maximum mask length for an allocation from this block. Defaults to /32 for IPv4.
  • state (String) : Controls provisioning of IP addresses from the CIDR block. Defaults to AVAILABLE.

    Supported values

    Controls provisioning of IP addresses from this pool to other pools or allocations. Defaults to AVAILABLE. Possible values:
    • STATE_UNSPECIFIED - Not used, mandated by the protocol.
    • AVAILABLE - Default state. Provision of the IP addresses from this CIDR block is allowed.
    • DISABLED - Provision of the IP addresses from this CIDR block is denied.

Nested Schema for metadata

Nested Schema for status

Read-Only:
  • ipv4_private_cidrs (List of String) CIDR blocks.
  • ipv4_public_cidrs (List of String) CIDR blocks.
  • route_table (Attributes) : Information about the route table associated with this subnet. Can be either a custom route table or the network’s default route table. (see below for nested schema)
  • state (String) : Current state of the subnet.

    Supported values

    Enumeration of possible states of the subnet. Possible values:
    • STATE_UNSPECIFIED - Default state, unspecified.
    • CREATING - Subnet is being created.
    • READY - Subnet is ready for use.
    • DELETING - Subnet is being deleted.

Nested Schema for status.route_table

Read-Only:
  • default (Boolean) : Indicates whether this is the network’s default route table. If true, this is the default route table inherited from the network. If false, this is a custom route table explicitly associated with the subnet via spec.
  • id (String) ID of the route table.