1. Packages
  2. Ibm Provider
  3. API Docs
  4. IsSubnet
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.IsSubnet

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Create, update, or delete a subnet. For more information, about subnet, see configuring ACLs and security groups for use with VPN.

    Note: VPC infrastructure services are a regional specific based endpoint, by default targets to us-south. Please make sure to target right region in the provider block as shown in the provider.tf file, if VPC service is created in region other than us-south.

    provider.tf

    import * as pulumi from "@pulumi/pulumi";
    
    import pulumi
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    
    return await Deployment.RunAsync(() => 
    {
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
        }
    }
    
    {}
    

    Example Usage

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IsVpc;
    import com.pulumi.ibm.IsVpcRoutingTable;
    import com.pulumi.ibm.IsVpcRoutingTableArgs;
    import com.pulumi.ibm.IsSubnet;
    import com.pulumi.ibm.IsSubnetArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var exampleIsVpc = new IsVpc("exampleIsVpc");
    
            var exampleIsVpcRoutingTable = new IsVpcRoutingTable("exampleIsVpcRoutingTable", IsVpcRoutingTableArgs.builder()
                .vpc(exampleIsVpc.isVpcId())
                .build());
    
            var exampleIsSubnet = new IsSubnet("exampleIsSubnet", IsSubnetArgs.builder()
                .vpc(exampleIsVpc.isVpcId())
                .zone("us-south-1")
                .ipv4CidrBlock("10.240.0.0/24")
                .routingTable(exampleIsVpcRoutingTable.routingTable())
                .timeouts(IsSubnetTimeoutsArgs.builder()
                    .create("90m")
                    .delete("30m")
                    .build())
                .build());
    
        }
    }
    
    resources:
      exampleIsVpc:
        type: ibm:IsVpc
      exampleIsVpcRoutingTable:
        type: ibm:IsVpcRoutingTable
        properties:
          vpc: ${exampleIsVpc.isVpcId}
      exampleIsSubnet:
        type: ibm:IsSubnet
        properties:
          vpc: ${exampleIsVpc.isVpcId}
          zone: us-south-1
          ipv4CidrBlock: 10.240.0.0/24
          routingTable: ${exampleIsVpcRoutingTable.routingTable}
          # User can configure timeouts
          timeouts:
            - create: 90m
              delete: 30m
    

    With Address Prefix

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const exampleIsVpc = new ibm.IsVpc("exampleIsVpc", {});
    const exampleIsVpcAddressPrefix = new ibm.IsVpcAddressPrefix("exampleIsVpcAddressPrefix", {
        cidr: "10.0.1.0/24",
        vpc: exampleIsVpc.isVpcId,
        zone: "us-south-1",
    });
    const exampleIsSubnet = new ibm.IsSubnet("exampleIsSubnet", {
        ipv4CidrBlock: "10.0.1.0/24",
        vpc: exampleIsVpc.isVpcId,
        zone: "us-south-1",
    }, {
        dependsOn: [exampleIsVpcAddressPrefix],
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    example_is_vpc = ibm.IsVpc("exampleIsVpc")
    example_is_vpc_address_prefix = ibm.IsVpcAddressPrefix("exampleIsVpcAddressPrefix",
        cidr="10.0.1.0/24",
        vpc=example_is_vpc.is_vpc_id,
        zone="us-south-1")
    example_is_subnet = ibm.IsSubnet("exampleIsSubnet",
        ipv4_cidr_block="10.0.1.0/24",
        vpc=example_is_vpc.is_vpc_id,
        zone="us-south-1",
        opts = pulumi.ResourceOptions(depends_on=[example_is_vpc_address_prefix]))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleIsVpc, err := ibm.NewIsVpc(ctx, "exampleIsVpc", nil)
    		if err != nil {
    			return err
    		}
    		exampleIsVpcAddressPrefix, err := ibm.NewIsVpcAddressPrefix(ctx, "exampleIsVpcAddressPrefix", &ibm.IsVpcAddressPrefixArgs{
    			Cidr: pulumi.String("10.0.1.0/24"),
    			Vpc:  exampleIsVpc.IsVpcId,
    			Zone: pulumi.String("us-south-1"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ibm.NewIsSubnet(ctx, "exampleIsSubnet", &ibm.IsSubnetArgs{
    			Ipv4CidrBlock: pulumi.String("10.0.1.0/24"),
    			Vpc:           exampleIsVpc.IsVpcId,
    			Zone:          pulumi.String("us-south-1"),
    		}, pulumi.DependsOn([]pulumi.Resource{
    			exampleIsVpcAddressPrefix,
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleIsVpc = new Ibm.IsVpc("exampleIsVpc");
    
        var exampleIsVpcAddressPrefix = new Ibm.IsVpcAddressPrefix("exampleIsVpcAddressPrefix", new()
        {
            Cidr = "10.0.1.0/24",
            Vpc = exampleIsVpc.IsVpcId,
            Zone = "us-south-1",
        });
    
        var exampleIsSubnet = new Ibm.IsSubnet("exampleIsSubnet", new()
        {
            Ipv4CidrBlock = "10.0.1.0/24",
            Vpc = exampleIsVpc.IsVpcId,
            Zone = "us-south-1",
        }, new CustomResourceOptions
        {
            DependsOn =
            {
                exampleIsVpcAddressPrefix,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IsVpc;
    import com.pulumi.ibm.IsVpcAddressPrefix;
    import com.pulumi.ibm.IsVpcAddressPrefixArgs;
    import com.pulumi.ibm.IsSubnet;
    import com.pulumi.ibm.IsSubnetArgs;
    import com.pulumi.resources.CustomResourceOptions;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var exampleIsVpc = new IsVpc("exampleIsVpc");
    
            var exampleIsVpcAddressPrefix = new IsVpcAddressPrefix("exampleIsVpcAddressPrefix", IsVpcAddressPrefixArgs.builder()
                .cidr("10.0.1.0/24")
                .vpc(exampleIsVpc.isVpcId())
                .zone("us-south-1")
                .build());
    
            var exampleIsSubnet = new IsSubnet("exampleIsSubnet", IsSubnetArgs.builder()
                .ipv4CidrBlock("10.0.1.0/24")
                .vpc(exampleIsVpc.isVpcId())
                .zone("us-south-1")
                .build(), CustomResourceOptions.builder()
                    .dependsOn(exampleIsVpcAddressPrefix)
                    .build());
    
        }
    }
    
    resources:
      exampleIsVpc:
        type: ibm:IsVpc
      exampleIsVpcAddressPrefix:
        type: ibm:IsVpcAddressPrefix
        properties:
          cidr: 10.0.1.0/24
          vpc: ${exampleIsVpc.isVpcId}
          zone: us-south-1
      exampleIsSubnet:
        type: ibm:IsSubnet
        properties:
          ipv4CidrBlock: 10.0.1.0/24
          vpc: ${exampleIsVpc.isVpcId}
          zone: us-south-1
        options:
          dependsOn:
            - ${exampleIsVpcAddressPrefix}
    

    Create IsSubnet Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new IsSubnet(name: string, args: IsSubnetArgs, opts?: CustomResourceOptions);
    @overload
    def IsSubnet(resource_name: str,
                 args: IsSubnetArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def IsSubnet(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 vpc: Optional[str] = None,
                 zone: Optional[str] = None,
                 public_gateway: Optional[str] = None,
                 is_subnet_id: Optional[str] = None,
                 name: Optional[str] = None,
                 network_acl: Optional[str] = None,
                 access_tags: Optional[Sequence[str]] = None,
                 resource_group: Optional[str] = None,
                 routing_table: Optional[str] = None,
                 routing_table_crn: Optional[str] = None,
                 tags: Optional[Sequence[str]] = None,
                 timeouts: Optional[IsSubnetTimeoutsArgs] = None,
                 total_ipv4_address_count: Optional[float] = None,
                 ipv4_cidr_block: Optional[str] = None,
                 ip_version: Optional[str] = None)
    func NewIsSubnet(ctx *Context, name string, args IsSubnetArgs, opts ...ResourceOption) (*IsSubnet, error)
    public IsSubnet(string name, IsSubnetArgs args, CustomResourceOptions? opts = null)
    public IsSubnet(String name, IsSubnetArgs args)
    public IsSubnet(String name, IsSubnetArgs args, CustomResourceOptions options)
    
    type: ibm:IsSubnet
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args IsSubnetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args IsSubnetArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args IsSubnetArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IsSubnetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IsSubnetArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var isSubnetResource = new Ibm.IsSubnet("isSubnetResource", new()
    {
        Vpc = "string",
        Zone = "string",
        PublicGateway = "string",
        IsSubnetId = "string",
        Name = "string",
        NetworkAcl = "string",
        AccessTags = new[]
        {
            "string",
        },
        ResourceGroup = "string",
        RoutingTable = "string",
        RoutingTableCrn = "string",
        Tags = new[]
        {
            "string",
        },
        Timeouts = new Ibm.Inputs.IsSubnetTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
            Update = "string",
        },
        TotalIpv4AddressCount = 0,
        Ipv4CidrBlock = "string",
        IpVersion = "string",
    });
    
    example, err := ibm.NewIsSubnet(ctx, "isSubnetResource", &ibm.IsSubnetArgs{
    	Vpc:           pulumi.String("string"),
    	Zone:          pulumi.String("string"),
    	PublicGateway: pulumi.String("string"),
    	IsSubnetId:    pulumi.String("string"),
    	Name:          pulumi.String("string"),
    	NetworkAcl:    pulumi.String("string"),
    	AccessTags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ResourceGroup:   pulumi.String("string"),
    	RoutingTable:    pulumi.String("string"),
    	RoutingTableCrn: pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Timeouts: &ibm.IsSubnetTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    		Update: pulumi.String("string"),
    	},
    	TotalIpv4AddressCount: pulumi.Float64(0),
    	Ipv4CidrBlock:         pulumi.String("string"),
    	IpVersion:             pulumi.String("string"),
    })
    
    var isSubnetResource = new IsSubnet("isSubnetResource", IsSubnetArgs.builder()
        .vpc("string")
        .zone("string")
        .publicGateway("string")
        .isSubnetId("string")
        .name("string")
        .networkAcl("string")
        .accessTags("string")
        .resourceGroup("string")
        .routingTable("string")
        .routingTableCrn("string")
        .tags("string")
        .timeouts(IsSubnetTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .update("string")
            .build())
        .totalIpv4AddressCount(0)
        .ipv4CidrBlock("string")
        .ipVersion("string")
        .build());
    
    is_subnet_resource = ibm.IsSubnet("isSubnetResource",
        vpc="string",
        zone="string",
        public_gateway="string",
        is_subnet_id="string",
        name="string",
        network_acl="string",
        access_tags=["string"],
        resource_group="string",
        routing_table="string",
        routing_table_crn="string",
        tags=["string"],
        timeouts={
            "create": "string",
            "delete": "string",
            "update": "string",
        },
        total_ipv4_address_count=0,
        ipv4_cidr_block="string",
        ip_version="string")
    
    const isSubnetResource = new ibm.IsSubnet("isSubnetResource", {
        vpc: "string",
        zone: "string",
        publicGateway: "string",
        isSubnetId: "string",
        name: "string",
        networkAcl: "string",
        accessTags: ["string"],
        resourceGroup: "string",
        routingTable: "string",
        routingTableCrn: "string",
        tags: ["string"],
        timeouts: {
            create: "string",
            "delete": "string",
            update: "string",
        },
        totalIpv4AddressCount: 0,
        ipv4CidrBlock: "string",
        ipVersion: "string",
    });
    
    type: ibm:IsSubnet
    properties:
        accessTags:
            - string
        ipVersion: string
        ipv4CidrBlock: string
        isSubnetId: string
        name: string
        networkAcl: string
        publicGateway: string
        resourceGroup: string
        routingTable: string
        routingTableCrn: string
        tags:
            - string
        timeouts:
            create: string
            delete: string
            update: string
        totalIpv4AddressCount: 0
        vpc: string
        zone: string
    

    IsSubnet Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The IsSubnet resource accepts the following input properties:

    Vpc string
    The VPC ID.
    Zone string
    The subnet zone name.
    AccessTags List<string>

    A list of access management tags to attach to the bare metal server.

    Note: You can attach only those access tags that already exists. For more information, about creating access tags, see working with tags. You must have the access listed in the Granting users access to tag resources for access_tags access_tags must be in the format key:value.

    IpVersion string
    The IP Version. The default is ipv4.
    Ipv4CidrBlock string

    The IPv4 range of the subnet.

    NOTE: If using a IPv4 range from a ibm.IsVpcAddressPrefix resource, add a depends_on to handle hidden ibm.IsVpcAddressPrefix dependency if not using interpolation.

    IsSubnetId string
    (String) The ID of the subnet.
    Name string
    The name of the subnet.
    NetworkAcl string
    The ID of the network ACL for the subnet.
    PublicGateway string
    The ID of the public gateway for the subnet that you want to attach to the subnet. You create the public gateway with the ibm.IsPublicGateway resource.
    ResourceGroup string
    The ID of the resource group where you want to create the subnet.
    RoutingTable string
    The routing table ID associated with the subnet.
    RoutingTableCrn string

    The routing table crn associated with the subnet.

    Note routing_table and routing_table_crn are mutually exclusive.

    Tags List<string>
    The tags associated with the subnet.
    Timeouts IsSubnetTimeouts
    TotalIpv4AddressCount double

    The total number of IPv4 addresses. Either ipv4_cidr_block or total_pv4_address_count input parameters must be provided in the resource.

    Note The VPC must have a default address prefix in the specified zone, and that prefix must have a free CIDR range with at least this number of addresses.

    Vpc string
    The VPC ID.
    Zone string
    The subnet zone name.
    AccessTags []string

    A list of access management tags to attach to the bare metal server.

    Note: You can attach only those access tags that already exists. For more information, about creating access tags, see working with tags. You must have the access listed in the Granting users access to tag resources for access_tags access_tags must be in the format key:value.

    IpVersion string
    The IP Version. The default is ipv4.
    Ipv4CidrBlock string

    The IPv4 range of the subnet.

    NOTE: If using a IPv4 range from a ibm.IsVpcAddressPrefix resource, add a depends_on to handle hidden ibm.IsVpcAddressPrefix dependency if not using interpolation.

    IsSubnetId string
    (String) The ID of the subnet.
    Name string
    The name of the subnet.
    NetworkAcl string
    The ID of the network ACL for the subnet.
    PublicGateway string
    The ID of the public gateway for the subnet that you want to attach to the subnet. You create the public gateway with the ibm.IsPublicGateway resource.
    ResourceGroup string
    The ID of the resource group where you want to create the subnet.
    RoutingTable string
    The routing table ID associated with the subnet.
    RoutingTableCrn string

    The routing table crn associated with the subnet.

    Note routing_table and routing_table_crn are mutually exclusive.

    Tags []string
    The tags associated with the subnet.
    Timeouts IsSubnetTimeoutsArgs
    TotalIpv4AddressCount float64

    The total number of IPv4 addresses. Either ipv4_cidr_block or total_pv4_address_count input parameters must be provided in the resource.

    Note The VPC must have a default address prefix in the specified zone, and that prefix must have a free CIDR range with at least this number of addresses.

    vpc String
    The VPC ID.
    zone String
    The subnet zone name.
    accessTags List<String>

    A list of access management tags to attach to the bare metal server.

    Note: You can attach only those access tags that already exists. For more information, about creating access tags, see working with tags. You must have the access listed in the Granting users access to tag resources for access_tags access_tags must be in the format key:value.

    ipVersion String
    The IP Version. The default is ipv4.
    ipv4CidrBlock String

    The IPv4 range of the subnet.

    NOTE: If using a IPv4 range from a ibm.IsVpcAddressPrefix resource, add a depends_on to handle hidden ibm.IsVpcAddressPrefix dependency if not using interpolation.

    isSubnetId String
    (String) The ID of the subnet.
    name String
    The name of the subnet.
    networkAcl String
    The ID of the network ACL for the subnet.
    publicGateway String
    The ID of the public gateway for the subnet that you want to attach to the subnet. You create the public gateway with the ibm.IsPublicGateway resource.
    resourceGroup String
    The ID of the resource group where you want to create the subnet.
    routingTable String
    The routing table ID associated with the subnet.
    routingTableCrn String

    The routing table crn associated with the subnet.

    Note routing_table and routing_table_crn are mutually exclusive.

    tags List<String>
    The tags associated with the subnet.
    timeouts IsSubnetTimeouts
    totalIpv4AddressCount Double

    The total number of IPv4 addresses. Either ipv4_cidr_block or total_pv4_address_count input parameters must be provided in the resource.

    Note The VPC must have a default address prefix in the specified zone, and that prefix must have a free CIDR range with at least this number of addresses.

    vpc string
    The VPC ID.
    zone string
    The subnet zone name.
    accessTags string[]

    A list of access management tags to attach to the bare metal server.

    Note: You can attach only those access tags that already exists. For more information, about creating access tags, see working with tags. You must have the access listed in the Granting users access to tag resources for access_tags access_tags must be in the format key:value.

    ipVersion string
    The IP Version. The default is ipv4.
    ipv4CidrBlock string

    The IPv4 range of the subnet.

    NOTE: If using a IPv4 range from a ibm.IsVpcAddressPrefix resource, add a depends_on to handle hidden ibm.IsVpcAddressPrefix dependency if not using interpolation.

    isSubnetId string
    (String) The ID of the subnet.
    name string
    The name of the subnet.
    networkAcl string
    The ID of the network ACL for the subnet.
    publicGateway string
    The ID of the public gateway for the subnet that you want to attach to the subnet. You create the public gateway with the ibm.IsPublicGateway resource.
    resourceGroup string
    The ID of the resource group where you want to create the subnet.
    routingTable string
    The routing table ID associated with the subnet.
    routingTableCrn string

    The routing table crn associated with the subnet.

    Note routing_table and routing_table_crn are mutually exclusive.

    tags string[]
    The tags associated with the subnet.
    timeouts IsSubnetTimeouts
    totalIpv4AddressCount number

    The total number of IPv4 addresses. Either ipv4_cidr_block or total_pv4_address_count input parameters must be provided in the resource.

    Note The VPC must have a default address prefix in the specified zone, and that prefix must have a free CIDR range with at least this number of addresses.

    vpc str
    The VPC ID.
    zone str
    The subnet zone name.
    access_tags Sequence[str]

    A list of access management tags to attach to the bare metal server.

    Note: You can attach only those access tags that already exists. For more information, about creating access tags, see working with tags. You must have the access listed in the Granting users access to tag resources for access_tags access_tags must be in the format key:value.

    ip_version str
    The IP Version. The default is ipv4.
    ipv4_cidr_block str

    The IPv4 range of the subnet.

    NOTE: If using a IPv4 range from a ibm.IsVpcAddressPrefix resource, add a depends_on to handle hidden ibm.IsVpcAddressPrefix dependency if not using interpolation.

    is_subnet_id str
    (String) The ID of the subnet.
    name str
    The name of the subnet.
    network_acl str
    The ID of the network ACL for the subnet.
    public_gateway str
    The ID of the public gateway for the subnet that you want to attach to the subnet. You create the public gateway with the ibm.IsPublicGateway resource.
    resource_group str
    The ID of the resource group where you want to create the subnet.
    routing_table str
    The routing table ID associated with the subnet.
    routing_table_crn str

    The routing table crn associated with the subnet.

    Note routing_table and routing_table_crn are mutually exclusive.

    tags Sequence[str]
    The tags associated with the subnet.
    timeouts IsSubnetTimeoutsArgs
    total_ipv4_address_count float

    The total number of IPv4 addresses. Either ipv4_cidr_block or total_pv4_address_count input parameters must be provided in the resource.

    Note The VPC must have a default address prefix in the specified zone, and that prefix must have a free CIDR range with at least this number of addresses.

    vpc String
    The VPC ID.
    zone String
    The subnet zone name.
    accessTags List<String>

    A list of access management tags to attach to the bare metal server.

    Note: You can attach only those access tags that already exists. For more information, about creating access tags, see working with tags. You must have the access listed in the Granting users access to tag resources for access_tags access_tags must be in the format key:value.

    ipVersion String
    The IP Version. The default is ipv4.
    ipv4CidrBlock String

    The IPv4 range of the subnet.

    NOTE: If using a IPv4 range from a ibm.IsVpcAddressPrefix resource, add a depends_on to handle hidden ibm.IsVpcAddressPrefix dependency if not using interpolation.

    isSubnetId String
    (String) The ID of the subnet.
    name String
    The name of the subnet.
    networkAcl String
    The ID of the network ACL for the subnet.
    publicGateway String
    The ID of the public gateway for the subnet that you want to attach to the subnet. You create the public gateway with the ibm.IsPublicGateway resource.
    resourceGroup String
    The ID of the resource group where you want to create the subnet.
    routingTable String
    The routing table ID associated with the subnet.
    routingTableCrn String

    The routing table crn associated with the subnet.

    Note routing_table and routing_table_crn are mutually exclusive.

    tags List<String>
    The tags associated with the subnet.
    timeouts Property Map
    totalIpv4AddressCount Number

    The total number of IPv4 addresses. Either ipv4_cidr_block or total_pv4_address_count input parameters must be provided in the resource.

    Note The VPC must have a default address prefix in the specified zone, and that prefix must have a free CIDR range with at least this number of addresses.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the IsSubnet resource produces the following output properties:

    AvailableIpv4AddressCount double
    (String) The total number of available IPv4 addresses.
    Crn string
    (String) The CRN of subnet.
    Id string
    The provider-assigned unique ID for this managed resource.
    ResourceControllerUrl string
    The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance
    ResourceCrn string
    The crn of the resource
    ResourceGroupName string
    The resource group name in which resource is provisioned
    ResourceName string
    The name of the resource
    ResourceStatus string
    The status of the resource
    Status string
    (String) The status of the subnet.
    AvailableIpv4AddressCount float64
    (String) The total number of available IPv4 addresses.
    Crn string
    (String) The CRN of subnet.
    Id string
    The provider-assigned unique ID for this managed resource.
    ResourceControllerUrl string
    The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance
    ResourceCrn string
    The crn of the resource
    ResourceGroupName string
    The resource group name in which resource is provisioned
    ResourceName string
    The name of the resource
    ResourceStatus string
    The status of the resource
    Status string
    (String) The status of the subnet.
    availableIpv4AddressCount Double
    (String) The total number of available IPv4 addresses.
    crn String
    (String) The CRN of subnet.
    id String
    The provider-assigned unique ID for this managed resource.
    resourceControllerUrl String
    The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance
    resourceCrn String
    The crn of the resource
    resourceGroupName String
    The resource group name in which resource is provisioned
    resourceName String
    The name of the resource
    resourceStatus String
    The status of the resource
    status String
    (String) The status of the subnet.
    availableIpv4AddressCount number
    (String) The total number of available IPv4 addresses.
    crn string
    (String) The CRN of subnet.
    id string
    The provider-assigned unique ID for this managed resource.
    resourceControllerUrl string
    The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance
    resourceCrn string
    The crn of the resource
    resourceGroupName string
    The resource group name in which resource is provisioned
    resourceName string
    The name of the resource
    resourceStatus string
    The status of the resource
    status string
    (String) The status of the subnet.
    available_ipv4_address_count float
    (String) The total number of available IPv4 addresses.
    crn str
    (String) The CRN of subnet.
    id str
    The provider-assigned unique ID for this managed resource.
    resource_controller_url str
    The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance
    resource_crn str
    The crn of the resource
    resource_group_name str
    The resource group name in which resource is provisioned
    resource_name str
    The name of the resource
    resource_status str
    The status of the resource
    status str
    (String) The status of the subnet.
    availableIpv4AddressCount Number
    (String) The total number of available IPv4 addresses.
    crn String
    (String) The CRN of subnet.
    id String
    The provider-assigned unique ID for this managed resource.
    resourceControllerUrl String
    The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance
    resourceCrn String
    The crn of the resource
    resourceGroupName String
    The resource group name in which resource is provisioned
    resourceName String
    The name of the resource
    resourceStatus String
    The status of the resource
    status String
    (String) The status of the subnet.

    Look up Existing IsSubnet Resource

    Get an existing IsSubnet resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: IsSubnetState, opts?: CustomResourceOptions): IsSubnet
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_tags: Optional[Sequence[str]] = None,
            available_ipv4_address_count: Optional[float] = None,
            crn: Optional[str] = None,
            ip_version: Optional[str] = None,
            ipv4_cidr_block: Optional[str] = None,
            is_subnet_id: Optional[str] = None,
            name: Optional[str] = None,
            network_acl: Optional[str] = None,
            public_gateway: Optional[str] = None,
            resource_controller_url: Optional[str] = None,
            resource_crn: Optional[str] = None,
            resource_group: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            resource_name: Optional[str] = None,
            resource_status: Optional[str] = None,
            routing_table: Optional[str] = None,
            routing_table_crn: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            timeouts: Optional[IsSubnetTimeoutsArgs] = None,
            total_ipv4_address_count: Optional[float] = None,
            vpc: Optional[str] = None,
            zone: Optional[str] = None) -> IsSubnet
    func GetIsSubnet(ctx *Context, name string, id IDInput, state *IsSubnetState, opts ...ResourceOption) (*IsSubnet, error)
    public static IsSubnet Get(string name, Input<string> id, IsSubnetState? state, CustomResourceOptions? opts = null)
    public static IsSubnet get(String name, Output<String> id, IsSubnetState state, CustomResourceOptions options)
    resources:  _:    type: ibm:IsSubnet    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AccessTags List<string>

    A list of access management tags to attach to the bare metal server.

    Note: You can attach only those access tags that already exists. For more information, about creating access tags, see working with tags. You must have the access listed in the Granting users access to tag resources for access_tags access_tags must be in the format key:value.

    AvailableIpv4AddressCount double
    (String) The total number of available IPv4 addresses.
    Crn string
    (String) The CRN of subnet.
    IpVersion string
    The IP Version. The default is ipv4.
    Ipv4CidrBlock string

    The IPv4 range of the subnet.

    NOTE: If using a IPv4 range from a ibm.IsVpcAddressPrefix resource, add a depends_on to handle hidden ibm.IsVpcAddressPrefix dependency if not using interpolation.

    IsSubnetId string
    (String) The ID of the subnet.
    Name string
    The name of the subnet.
    NetworkAcl string
    The ID of the network ACL for the subnet.
    PublicGateway string
    The ID of the public gateway for the subnet that you want to attach to the subnet. You create the public gateway with the ibm.IsPublicGateway resource.
    ResourceControllerUrl string
    The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance
    ResourceCrn string
    The crn of the resource
    ResourceGroup string
    The ID of the resource group where you want to create the subnet.
    ResourceGroupName string
    The resource group name in which resource is provisioned
    ResourceName string
    The name of the resource
    ResourceStatus string
    The status of the resource
    RoutingTable string
    The routing table ID associated with the subnet.
    RoutingTableCrn string

    The routing table crn associated with the subnet.

    Note routing_table and routing_table_crn are mutually exclusive.

    Status string
    (String) The status of the subnet.
    Tags List<string>
    The tags associated with the subnet.
    Timeouts IsSubnetTimeouts
    TotalIpv4AddressCount double

    The total number of IPv4 addresses. Either ipv4_cidr_block or total_pv4_address_count input parameters must be provided in the resource.

    Note The VPC must have a default address prefix in the specified zone, and that prefix must have a free CIDR range with at least this number of addresses.

    Vpc string
    The VPC ID.
    Zone string
    The subnet zone name.
    AccessTags []string

    A list of access management tags to attach to the bare metal server.

    Note: You can attach only those access tags that already exists. For more information, about creating access tags, see working with tags. You must have the access listed in the Granting users access to tag resources for access_tags access_tags must be in the format key:value.

    AvailableIpv4AddressCount float64
    (String) The total number of available IPv4 addresses.
    Crn string
    (String) The CRN of subnet.
    IpVersion string
    The IP Version. The default is ipv4.
    Ipv4CidrBlock string

    The IPv4 range of the subnet.

    NOTE: If using a IPv4 range from a ibm.IsVpcAddressPrefix resource, add a depends_on to handle hidden ibm.IsVpcAddressPrefix dependency if not using interpolation.

    IsSubnetId string
    (String) The ID of the subnet.
    Name string
    The name of the subnet.
    NetworkAcl string
    The ID of the network ACL for the subnet.
    PublicGateway string
    The ID of the public gateway for the subnet that you want to attach to the subnet. You create the public gateway with the ibm.IsPublicGateway resource.
    ResourceControllerUrl string
    The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance
    ResourceCrn string
    The crn of the resource
    ResourceGroup string
    The ID of the resource group where you want to create the subnet.
    ResourceGroupName string
    The resource group name in which resource is provisioned
    ResourceName string
    The name of the resource
    ResourceStatus string
    The status of the resource
    RoutingTable string
    The routing table ID associated with the subnet.
    RoutingTableCrn string

    The routing table crn associated with the subnet.

    Note routing_table and routing_table_crn are mutually exclusive.

    Status string
    (String) The status of the subnet.
    Tags []string
    The tags associated with the subnet.
    Timeouts IsSubnetTimeoutsArgs
    TotalIpv4AddressCount float64

    The total number of IPv4 addresses. Either ipv4_cidr_block or total_pv4_address_count input parameters must be provided in the resource.

    Note The VPC must have a default address prefix in the specified zone, and that prefix must have a free CIDR range with at least this number of addresses.

    Vpc string
    The VPC ID.
    Zone string
    The subnet zone name.
    accessTags List<String>

    A list of access management tags to attach to the bare metal server.

    Note: You can attach only those access tags that already exists. For more information, about creating access tags, see working with tags. You must have the access listed in the Granting users access to tag resources for access_tags access_tags must be in the format key:value.

    availableIpv4AddressCount Double
    (String) The total number of available IPv4 addresses.
    crn String
    (String) The CRN of subnet.
    ipVersion String
    The IP Version. The default is ipv4.
    ipv4CidrBlock String

    The IPv4 range of the subnet.

    NOTE: If using a IPv4 range from a ibm.IsVpcAddressPrefix resource, add a depends_on to handle hidden ibm.IsVpcAddressPrefix dependency if not using interpolation.

    isSubnetId String
    (String) The ID of the subnet.
    name String
    The name of the subnet.
    networkAcl String
    The ID of the network ACL for the subnet.
    publicGateway String
    The ID of the public gateway for the subnet that you want to attach to the subnet. You create the public gateway with the ibm.IsPublicGateway resource.
    resourceControllerUrl String
    The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance
    resourceCrn String
    The crn of the resource
    resourceGroup String
    The ID of the resource group where you want to create the subnet.
    resourceGroupName String
    The resource group name in which resource is provisioned
    resourceName String
    The name of the resource
    resourceStatus String
    The status of the resource
    routingTable String
    The routing table ID associated with the subnet.
    routingTableCrn String

    The routing table crn associated with the subnet.

    Note routing_table and routing_table_crn are mutually exclusive.

    status String
    (String) The status of the subnet.
    tags List<String>
    The tags associated with the subnet.
    timeouts IsSubnetTimeouts
    totalIpv4AddressCount Double

    The total number of IPv4 addresses. Either ipv4_cidr_block or total_pv4_address_count input parameters must be provided in the resource.

    Note The VPC must have a default address prefix in the specified zone, and that prefix must have a free CIDR range with at least this number of addresses.

    vpc String
    The VPC ID.
    zone String
    The subnet zone name.
    accessTags string[]

    A list of access management tags to attach to the bare metal server.

    Note: You can attach only those access tags that already exists. For more information, about creating access tags, see working with tags. You must have the access listed in the Granting users access to tag resources for access_tags access_tags must be in the format key:value.

    availableIpv4AddressCount number
    (String) The total number of available IPv4 addresses.
    crn string
    (String) The CRN of subnet.
    ipVersion string
    The IP Version. The default is ipv4.
    ipv4CidrBlock string

    The IPv4 range of the subnet.

    NOTE: If using a IPv4 range from a ibm.IsVpcAddressPrefix resource, add a depends_on to handle hidden ibm.IsVpcAddressPrefix dependency if not using interpolation.

    isSubnetId string
    (String) The ID of the subnet.
    name string
    The name of the subnet.
    networkAcl string
    The ID of the network ACL for the subnet.
    publicGateway string
    The ID of the public gateway for the subnet that you want to attach to the subnet. You create the public gateway with the ibm.IsPublicGateway resource.
    resourceControllerUrl string
    The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance
    resourceCrn string
    The crn of the resource
    resourceGroup string
    The ID of the resource group where you want to create the subnet.
    resourceGroupName string
    The resource group name in which resource is provisioned
    resourceName string
    The name of the resource
    resourceStatus string
    The status of the resource
    routingTable string
    The routing table ID associated with the subnet.
    routingTableCrn string

    The routing table crn associated with the subnet.

    Note routing_table and routing_table_crn are mutually exclusive.

    status string
    (String) The status of the subnet.
    tags string[]
    The tags associated with the subnet.
    timeouts IsSubnetTimeouts
    totalIpv4AddressCount number

    The total number of IPv4 addresses. Either ipv4_cidr_block or total_pv4_address_count input parameters must be provided in the resource.

    Note The VPC must have a default address prefix in the specified zone, and that prefix must have a free CIDR range with at least this number of addresses.

    vpc string
    The VPC ID.
    zone string
    The subnet zone name.
    access_tags Sequence[str]

    A list of access management tags to attach to the bare metal server.

    Note: You can attach only those access tags that already exists. For more information, about creating access tags, see working with tags. You must have the access listed in the Granting users access to tag resources for access_tags access_tags must be in the format key:value.

    available_ipv4_address_count float
    (String) The total number of available IPv4 addresses.
    crn str
    (String) The CRN of subnet.
    ip_version str
    The IP Version. The default is ipv4.
    ipv4_cidr_block str

    The IPv4 range of the subnet.

    NOTE: If using a IPv4 range from a ibm.IsVpcAddressPrefix resource, add a depends_on to handle hidden ibm.IsVpcAddressPrefix dependency if not using interpolation.

    is_subnet_id str
    (String) The ID of the subnet.
    name str
    The name of the subnet.
    network_acl str
    The ID of the network ACL for the subnet.
    public_gateway str
    The ID of the public gateway for the subnet that you want to attach to the subnet. You create the public gateway with the ibm.IsPublicGateway resource.
    resource_controller_url str
    The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance
    resource_crn str
    The crn of the resource
    resource_group str
    The ID of the resource group where you want to create the subnet.
    resource_group_name str
    The resource group name in which resource is provisioned
    resource_name str
    The name of the resource
    resource_status str
    The status of the resource
    routing_table str
    The routing table ID associated with the subnet.
    routing_table_crn str

    The routing table crn associated with the subnet.

    Note routing_table and routing_table_crn are mutually exclusive.

    status str
    (String) The status of the subnet.
    tags Sequence[str]
    The tags associated with the subnet.
    timeouts IsSubnetTimeoutsArgs
    total_ipv4_address_count float

    The total number of IPv4 addresses. Either ipv4_cidr_block or total_pv4_address_count input parameters must be provided in the resource.

    Note The VPC must have a default address prefix in the specified zone, and that prefix must have a free CIDR range with at least this number of addresses.

    vpc str
    The VPC ID.
    zone str
    The subnet zone name.
    accessTags List<String>

    A list of access management tags to attach to the bare metal server.

    Note: You can attach only those access tags that already exists. For more information, about creating access tags, see working with tags. You must have the access listed in the Granting users access to tag resources for access_tags access_tags must be in the format key:value.

    availableIpv4AddressCount Number
    (String) The total number of available IPv4 addresses.
    crn String
    (String) The CRN of subnet.
    ipVersion String
    The IP Version. The default is ipv4.
    ipv4CidrBlock String

    The IPv4 range of the subnet.

    NOTE: If using a IPv4 range from a ibm.IsVpcAddressPrefix resource, add a depends_on to handle hidden ibm.IsVpcAddressPrefix dependency if not using interpolation.

    isSubnetId String
    (String) The ID of the subnet.
    name String
    The name of the subnet.
    networkAcl String
    The ID of the network ACL for the subnet.
    publicGateway String
    The ID of the public gateway for the subnet that you want to attach to the subnet. You create the public gateway with the ibm.IsPublicGateway resource.
    resourceControllerUrl String
    The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance
    resourceCrn String
    The crn of the resource
    resourceGroup String
    The ID of the resource group where you want to create the subnet.
    resourceGroupName String
    The resource group name in which resource is provisioned
    resourceName String
    The name of the resource
    resourceStatus String
    The status of the resource
    routingTable String
    The routing table ID associated with the subnet.
    routingTableCrn String

    The routing table crn associated with the subnet.

    Note routing_table and routing_table_crn are mutually exclusive.

    status String
    (String) The status of the subnet.
    tags List<String>
    The tags associated with the subnet.
    timeouts Property Map
    totalIpv4AddressCount Number

    The total number of IPv4 addresses. Either ipv4_cidr_block or total_pv4_address_count input parameters must be provided in the resource.

    Note The VPC must have a default address prefix in the specified zone, and that prefix must have a free CIDR range with at least this number of addresses.

    vpc String
    The VPC ID.
    zone String
    The subnet zone name.

    Supporting Types

    IsSubnetTimeouts, IsSubnetTimeoutsArgs

    Create string
    Delete string
    Update string
    Create string
    Delete string
    Update string
    create String
    delete String
    update String
    create string
    delete string
    update string
    create str
    delete str
    update str
    create String
    delete String
    update String

    Import

    The ibm_is_subnet resource can be imported by using the ID.

    Syntax

    $ pulumi import ibm:index/isSubnet:IsSubnet example <subnet_ID>
    

    Example

    $ pulumi import ibm:index/isSubnet:IsSubnet example d7bec597-4726-451f-8a63-e62e6f12122c
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud