Import the details of an existing IBM cloud subnet as a read-only data source. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax.

Example Usage

resource "ibm_is_vpc" "testacc_vpc" {
    name = "test"

resource "ibm_is_subnet" "testacc_subnet" {
    name = "test_subnet"
    vpc = "${}"
    zone = "us-south-1"
    ipv4_cidr_block = ""
data "ibm_is_subnet" "ds_subnet" {
    identifier = "${}"

Argument Reference

The following arguments are supported:

  • identifier - (Required, string) The id of the subnet.

Attribute Reference

The following attributes are exported:

  • ipv4_cidr_block - The IPv4 range of the subnet.
  • ipv6_cidr_block - The IPv6 range of the subnet.
  • total_ipv4_address_count - The total number of IPv4 addresses.
  • ip_version - The Ip Version.
  • name - The name of the subnet.
  • network_acl - The ID of the network ACL for the subnet.
  • public_gateway - The ID of the public-gateway for the subnet.
  • status - The status of the subnet.
  • vpc - The vpc id.
  • zone - The subnet zone name.
  • available_ipv4_address_count - The total number of available IPv4 addresses.
  • resource_controller_url - The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance.