1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Core
  5. Subnet
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.Core.Subnet

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

    This resource provides the Subnet resource in Oracle Cloud Infrastructure Core service.

    Creates a new subnet in the specified VCN. You can’t change the size of the subnet after creation, so it’s important to think about the size of subnets you need before creating them. For more information, see VCNs and Subnets. For information on the number of subnets you can have in a VCN, see Service Limits.

    For the purposes of access control, you must provide the OCID of the compartment where you want the subnet to reside. Notice that the subnet doesn’t have to be in the same compartment as the VCN, route tables, or other Networking Service components. If you’re not sure which compartment to use, put the subnet in the same compartment as the VCN. For more information about compartments and access control, see Overview of the IAM Service. For information about OCIDs, see Resource Identifiers.

    You may optionally associate a route table with the subnet. If you don’t, the subnet will use the VCN’s default route table. For more information about route tables, see Route Tables.

    You may optionally associate a security list with the subnet. If you don’t, the subnet will use the VCN’s default security list. For more information about security lists, see Security Lists.

    You may optionally associate a set of DHCP options with the subnet. If you don’t, the subnet will use the VCN’s default set. For more information about DHCP options, see DHCP Options.

    You may optionally specify a display name for the subnet, otherwise a default is provided. It does not have to be unique, and you can change it. Avoid entering confidential information.

    You can also add a DNS label for the subnet, which is required if you want the Internet and VCN Resolver to resolve hostnames for instances in the subnet. For more information, see DNS in Your Virtual Cloud Network.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testSubnet = new oci.core.Subnet("test_subnet", {
        cidrBlock: subnetCidrBlock,
        compartmentId: compartmentId,
        vcnId: testVcn.id,
        availabilityDomain: subnetAvailabilityDomain,
        definedTags: {
            "Operations.CostCenter": "42",
        },
        dhcpOptionsId: testDhcpOptions.id,
        displayName: subnetDisplayName,
        dnsLabel: subnetDnsLabel,
        freeformTags: {
            Department: "Finance",
        },
        ipv6cidrBlock: subnetIpv6cidrBlock,
        ipv6cidrBlocks: subnetIpv6cidrBlocks,
        prohibitInternetIngress: subnetProhibitInternetIngress,
        prohibitPublicIpOnVnic: subnetProhibitPublicIpOnVnic,
        routeTableId: testRouteTable.id,
        securityListIds: subnetSecurityListIds,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_subnet = oci.core.Subnet("test_subnet",
        cidr_block=subnet_cidr_block,
        compartment_id=compartment_id,
        vcn_id=test_vcn["id"],
        availability_domain=subnet_availability_domain,
        defined_tags={
            "Operations.CostCenter": "42",
        },
        dhcp_options_id=test_dhcp_options["id"],
        display_name=subnet_display_name,
        dns_label=subnet_dns_label,
        freeform_tags={
            "Department": "Finance",
        },
        ipv6cidr_block=subnet_ipv6cidr_block,
        ipv6cidr_blocks=subnet_ipv6cidr_blocks,
        prohibit_internet_ingress=subnet_prohibit_internet_ingress,
        prohibit_public_ip_on_vnic=subnet_prohibit_public_ip_on_vnic,
        route_table_id=test_route_table["id"],
        security_list_ids=subnet_security_list_ids)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/Core"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Core.NewSubnet(ctx, "test_subnet", &Core.SubnetArgs{
    			CidrBlock:          pulumi.Any(subnetCidrBlock),
    			CompartmentId:      pulumi.Any(compartmentId),
    			VcnId:              pulumi.Any(testVcn.Id),
    			AvailabilityDomain: pulumi.Any(subnetAvailabilityDomain),
    			DefinedTags: pulumi.StringMap{
    				"Operations.CostCenter": pulumi.String("42"),
    			},
    			DhcpOptionsId: pulumi.Any(testDhcpOptions.Id),
    			DisplayName:   pulumi.Any(subnetDisplayName),
    			DnsLabel:      pulumi.Any(subnetDnsLabel),
    			FreeformTags: pulumi.StringMap{
    				"Department": pulumi.String("Finance"),
    			},
    			Ipv6cidrBlock:           pulumi.Any(subnetIpv6cidrBlock),
    			Ipv6cidrBlocks:          pulumi.Any(subnetIpv6cidrBlocks),
    			ProhibitInternetIngress: pulumi.Any(subnetProhibitInternetIngress),
    			ProhibitPublicIpOnVnic:  pulumi.Any(subnetProhibitPublicIpOnVnic),
    			RouteTableId:            pulumi.Any(testRouteTable.Id),
    			SecurityListIds:         pulumi.Any(subnetSecurityListIds),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testSubnet = new Oci.Core.Subnet("test_subnet", new()
        {
            CidrBlock = subnetCidrBlock,
            CompartmentId = compartmentId,
            VcnId = testVcn.Id,
            AvailabilityDomain = subnetAvailabilityDomain,
            DefinedTags = 
            {
                { "Operations.CostCenter", "42" },
            },
            DhcpOptionsId = testDhcpOptions.Id,
            DisplayName = subnetDisplayName,
            DnsLabel = subnetDnsLabel,
            FreeformTags = 
            {
                { "Department", "Finance" },
            },
            Ipv6cidrBlock = subnetIpv6cidrBlock,
            Ipv6cidrBlocks = subnetIpv6cidrBlocks,
            ProhibitInternetIngress = subnetProhibitInternetIngress,
            ProhibitPublicIpOnVnic = subnetProhibitPublicIpOnVnic,
            RouteTableId = testRouteTable.Id,
            SecurityListIds = subnetSecurityListIds,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Core.Subnet;
    import com.pulumi.oci.Core.SubnetArgs;
    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 testSubnet = new Subnet("testSubnet", SubnetArgs.builder()
                .cidrBlock(subnetCidrBlock)
                .compartmentId(compartmentId)
                .vcnId(testVcn.id())
                .availabilityDomain(subnetAvailabilityDomain)
                .definedTags(Map.of("Operations.CostCenter", "42"))
                .dhcpOptionsId(testDhcpOptions.id())
                .displayName(subnetDisplayName)
                .dnsLabel(subnetDnsLabel)
                .freeformTags(Map.of("Department", "Finance"))
                .ipv6cidrBlock(subnetIpv6cidrBlock)
                .ipv6cidrBlocks(subnetIpv6cidrBlocks)
                .prohibitInternetIngress(subnetProhibitInternetIngress)
                .prohibitPublicIpOnVnic(subnetProhibitPublicIpOnVnic)
                .routeTableId(testRouteTable.id())
                .securityListIds(subnetSecurityListIds)
                .build());
    
        }
    }
    
    resources:
      testSubnet:
        type: oci:Core:Subnet
        name: test_subnet
        properties:
          cidrBlock: ${subnetCidrBlock}
          compartmentId: ${compartmentId}
          vcnId: ${testVcn.id}
          availabilityDomain: ${subnetAvailabilityDomain}
          definedTags:
            Operations.CostCenter: '42'
          dhcpOptionsId: ${testDhcpOptions.id}
          displayName: ${subnetDisplayName}
          dnsLabel: ${subnetDnsLabel}
          freeformTags:
            Department: Finance
          ipv6cidrBlock: ${subnetIpv6cidrBlock}
          ipv6cidrBlocks: ${subnetIpv6cidrBlocks}
          prohibitInternetIngress: ${subnetProhibitInternetIngress}
          prohibitPublicIpOnVnic: ${subnetProhibitPublicIpOnVnic}
          routeTableId: ${testRouteTable.id}
          securityListIds: ${subnetSecurityListIds}
    

    Create Subnet Resource

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

    Constructor syntax

    new Subnet(name: string, args: SubnetArgs, opts?: CustomResourceOptions);
    @overload
    def Subnet(resource_name: str,
               args: SubnetArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Subnet(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               vcn_id: Optional[str] = None,
               cidr_block: Optional[str] = None,
               compartment_id: Optional[str] = None,
               dns_label: Optional[str] = None,
               dhcp_options_id: Optional[str] = None,
               display_name: Optional[str] = None,
               availability_domain: Optional[str] = None,
               freeform_tags: Optional[Mapping[str, str]] = None,
               ipv6cidr_block: Optional[str] = None,
               ipv6cidr_blocks: Optional[Sequence[str]] = None,
               prohibit_internet_ingress: Optional[bool] = None,
               prohibit_public_ip_on_vnic: Optional[bool] = None,
               route_table_id: Optional[str] = None,
               security_list_ids: Optional[Sequence[str]] = None,
               defined_tags: Optional[Mapping[str, str]] = None)
    func NewSubnet(ctx *Context, name string, args SubnetArgs, opts ...ResourceOption) (*Subnet, error)
    public Subnet(string name, SubnetArgs args, CustomResourceOptions? opts = null)
    public Subnet(String name, SubnetArgs args)
    public Subnet(String name, SubnetArgs args, CustomResourceOptions options)
    
    type: oci:Core:Subnet
    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 SubnetArgs
    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 SubnetArgs
    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 SubnetArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SubnetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SubnetArgs
    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 subnetResource = new Oci.Core.Subnet("subnetResource", new()
    {
        VcnId = "string",
        CidrBlock = "string",
        CompartmentId = "string",
        DnsLabel = "string",
        DhcpOptionsId = "string",
        DisplayName = "string",
        AvailabilityDomain = "string",
        FreeformTags = 
        {
            { "string", "string" },
        },
        Ipv6cidrBlock = "string",
        Ipv6cidrBlocks = new[]
        {
            "string",
        },
        ProhibitInternetIngress = false,
        ProhibitPublicIpOnVnic = false,
        RouteTableId = "string",
        SecurityListIds = new[]
        {
            "string",
        },
        DefinedTags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := Core.NewSubnet(ctx, "subnetResource", &Core.SubnetArgs{
    	VcnId:              pulumi.String("string"),
    	CidrBlock:          pulumi.String("string"),
    	CompartmentId:      pulumi.String("string"),
    	DnsLabel:           pulumi.String("string"),
    	DhcpOptionsId:      pulumi.String("string"),
    	DisplayName:        pulumi.String("string"),
    	AvailabilityDomain: pulumi.String("string"),
    	FreeformTags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Ipv6cidrBlock: pulumi.String("string"),
    	Ipv6cidrBlocks: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ProhibitInternetIngress: pulumi.Bool(false),
    	ProhibitPublicIpOnVnic:  pulumi.Bool(false),
    	RouteTableId:            pulumi.String("string"),
    	SecurityListIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	DefinedTags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var subnetResource = new Subnet("subnetResource", SubnetArgs.builder()
        .vcnId("string")
        .cidrBlock("string")
        .compartmentId("string")
        .dnsLabel("string")
        .dhcpOptionsId("string")
        .displayName("string")
        .availabilityDomain("string")
        .freeformTags(Map.of("string", "string"))
        .ipv6cidrBlock("string")
        .ipv6cidrBlocks("string")
        .prohibitInternetIngress(false)
        .prohibitPublicIpOnVnic(false)
        .routeTableId("string")
        .securityListIds("string")
        .definedTags(Map.of("string", "string"))
        .build());
    
    subnet_resource = oci.core.Subnet("subnetResource",
        vcn_id="string",
        cidr_block="string",
        compartment_id="string",
        dns_label="string",
        dhcp_options_id="string",
        display_name="string",
        availability_domain="string",
        freeform_tags={
            "string": "string",
        },
        ipv6cidr_block="string",
        ipv6cidr_blocks=["string"],
        prohibit_internet_ingress=False,
        prohibit_public_ip_on_vnic=False,
        route_table_id="string",
        security_list_ids=["string"],
        defined_tags={
            "string": "string",
        })
    
    const subnetResource = new oci.core.Subnet("subnetResource", {
        vcnId: "string",
        cidrBlock: "string",
        compartmentId: "string",
        dnsLabel: "string",
        dhcpOptionsId: "string",
        displayName: "string",
        availabilityDomain: "string",
        freeformTags: {
            string: "string",
        },
        ipv6cidrBlock: "string",
        ipv6cidrBlocks: ["string"],
        prohibitInternetIngress: false,
        prohibitPublicIpOnVnic: false,
        routeTableId: "string",
        securityListIds: ["string"],
        definedTags: {
            string: "string",
        },
    });
    
    type: oci:Core:Subnet
    properties:
        availabilityDomain: string
        cidrBlock: string
        compartmentId: string
        definedTags:
            string: string
        dhcpOptionsId: string
        displayName: string
        dnsLabel: string
        freeformTags:
            string: string
        ipv6cidrBlock: string
        ipv6cidrBlocks:
            - string
        prohibitInternetIngress: false
        prohibitPublicIpOnVnic: false
        routeTableId: string
        securityListIds:
            - string
        vcnId: string
    

    Subnet 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 Subnet resource accepts the following input properties:

    CidrBlock string

    (Updatable) The CIDR IP address range of the subnet. The CIDR must maintain the following rules -

    a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

    Example: 10.0.1.0/24

    CompartmentId string
    (Updatable) The OCID of the compartment to contain the subnet.
    VcnId string

    The OCID of the VCN to contain the subnet.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    AvailabilityDomain string

    Controls whether the subnet is regional or specific to an availability domain. Oracle recommends creating regional subnets because they're more flexible and make it easier to implement failover across availability domains. Originally, AD-specific subnets were the only kind available to use.

    To create a regional subnet, omit this attribute. Then any resources later created in this subnet (such as a Compute instance) can be created in any availability domain in the region.

    To instead create an AD-specific subnet, set this attribute to the availability domain you want this subnet to be in. Then any resources later created in this subnet can only be created in that availability domain.

    Example: Uocm:PHX-AD-1

    DefinedTags Dictionary<string, string>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DhcpOptionsId string
    (Updatable) The OCID of the set of DHCP options the subnet will use. If you don't provide a value, the subnet uses the VCN's default set of DHCP options.
    DisplayName string
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    DnsLabel string

    A DNS label for the subnet, used in conjunction with the VNIC's hostname and VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet (for example, bminstance1.subnet123.vcn1.oraclevcn.com). Must be an alphanumeric string that begins with a letter and is unique within the VCN. The value cannot be changed.

    This value must be set if you want to use the Internet and VCN Resolver to resolve the hostnames of instances in the subnet. It can only be set if the VCN itself was created with a DNS label.

    For more information, see DNS in Your Virtual Cloud Network.

    Example: subnet123

    FreeformTags Dictionary<string, string>
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Ipv6cidrBlock string

    (Updatable) Use this to enable IPv6 addressing for this subnet. The VCN must be enabled for IPv6. You can't change this subnet characteristic later. All subnets are /64 in size. The subnet portion of the IPv6 address is the fourth hextet from the left (1111 in the following example).

    For important details about IPv6 addressing in a VCN, see IPv6 Addresses.

    Example: 2001:0db8:0123:1111::/64

    Ipv6cidrBlocks List<string>
    (Updatable) The list of all IPv6 prefixes (Oracle allocated IPv6 GUA, ULA or private IPv6 prefixes, BYOIPv6 prefixes) for the subnet that meets the following criteria:

    • The prefixes must be valid.
    • Multiple prefixes must not overlap each other or the on-premises network prefix.
    • The number of prefixes must not exceed the limit of IPv6 prefixes allowed to a subnet.
    ProhibitInternetIngress bool

    Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.

    For IPv6, if prohibitInternetIngress is set to true, internet access is not allowed for any IPv6s assigned to VNICs in the subnet. Otherwise, ingress internet traffic is allowed by default.

    prohibitPublicIpOnVnic will be set to the value of prohibitInternetIngress to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.

    Example: true

    ProhibitPublicIpOnVnic bool

    Whether VNICs within this subnet can have public IP addresses. Defaults to false, which means VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch or VNIC creation (with the assignPublicIp flag in CreateVnicDetails). If prohibitPublicIpOnVnic is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it's a private subnet).

    If you intend to use an IPv6 prefix, you should use the flag prohibitInternetIngress to specify ingress internet traffic behavior of the subnet.

    Example: true

    RouteTableId string
    (Updatable) The OCID of the route table the subnet will use. If you don't provide a value, the subnet uses the VCN's default route table.
    SecurityListIds List<string>
    (Updatable) The OCIDs of the security list or lists the subnet will use. If you don't provide a value, the subnet uses the VCN's default security list. Remember that security lists are associated with the subnet, but the rules are applied to the individual VNICs in the subnet.
    CidrBlock string

    (Updatable) The CIDR IP address range of the subnet. The CIDR must maintain the following rules -

    a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

    Example: 10.0.1.0/24

    CompartmentId string
    (Updatable) The OCID of the compartment to contain the subnet.
    VcnId string

    The OCID of the VCN to contain the subnet.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    AvailabilityDomain string

    Controls whether the subnet is regional or specific to an availability domain. Oracle recommends creating regional subnets because they're more flexible and make it easier to implement failover across availability domains. Originally, AD-specific subnets were the only kind available to use.

    To create a regional subnet, omit this attribute. Then any resources later created in this subnet (such as a Compute instance) can be created in any availability domain in the region.

    To instead create an AD-specific subnet, set this attribute to the availability domain you want this subnet to be in. Then any resources later created in this subnet can only be created in that availability domain.

    Example: Uocm:PHX-AD-1

    DefinedTags map[string]string
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DhcpOptionsId string
    (Updatable) The OCID of the set of DHCP options the subnet will use. If you don't provide a value, the subnet uses the VCN's default set of DHCP options.
    DisplayName string
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    DnsLabel string

    A DNS label for the subnet, used in conjunction with the VNIC's hostname and VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet (for example, bminstance1.subnet123.vcn1.oraclevcn.com). Must be an alphanumeric string that begins with a letter and is unique within the VCN. The value cannot be changed.

    This value must be set if you want to use the Internet and VCN Resolver to resolve the hostnames of instances in the subnet. It can only be set if the VCN itself was created with a DNS label.

    For more information, see DNS in Your Virtual Cloud Network.

    Example: subnet123

    FreeformTags map[string]string
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Ipv6cidrBlock string

    (Updatable) Use this to enable IPv6 addressing for this subnet. The VCN must be enabled for IPv6. You can't change this subnet characteristic later. All subnets are /64 in size. The subnet portion of the IPv6 address is the fourth hextet from the left (1111 in the following example).

    For important details about IPv6 addressing in a VCN, see IPv6 Addresses.

    Example: 2001:0db8:0123:1111::/64

    Ipv6cidrBlocks []string
    (Updatable) The list of all IPv6 prefixes (Oracle allocated IPv6 GUA, ULA or private IPv6 prefixes, BYOIPv6 prefixes) for the subnet that meets the following criteria:

    • The prefixes must be valid.
    • Multiple prefixes must not overlap each other or the on-premises network prefix.
    • The number of prefixes must not exceed the limit of IPv6 prefixes allowed to a subnet.
    ProhibitInternetIngress bool

    Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.

    For IPv6, if prohibitInternetIngress is set to true, internet access is not allowed for any IPv6s assigned to VNICs in the subnet. Otherwise, ingress internet traffic is allowed by default.

    prohibitPublicIpOnVnic will be set to the value of prohibitInternetIngress to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.

    Example: true

    ProhibitPublicIpOnVnic bool

    Whether VNICs within this subnet can have public IP addresses. Defaults to false, which means VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch or VNIC creation (with the assignPublicIp flag in CreateVnicDetails). If prohibitPublicIpOnVnic is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it's a private subnet).

    If you intend to use an IPv6 prefix, you should use the flag prohibitInternetIngress to specify ingress internet traffic behavior of the subnet.

    Example: true

    RouteTableId string
    (Updatable) The OCID of the route table the subnet will use. If you don't provide a value, the subnet uses the VCN's default route table.
    SecurityListIds []string
    (Updatable) The OCIDs of the security list or lists the subnet will use. If you don't provide a value, the subnet uses the VCN's default security list. Remember that security lists are associated with the subnet, but the rules are applied to the individual VNICs in the subnet.
    cidrBlock String

    (Updatable) The CIDR IP address range of the subnet. The CIDR must maintain the following rules -

    a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

    Example: 10.0.1.0/24

    compartmentId String
    (Updatable) The OCID of the compartment to contain the subnet.
    vcnId String

    The OCID of the VCN to contain the subnet.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    availabilityDomain String

    Controls whether the subnet is regional or specific to an availability domain. Oracle recommends creating regional subnets because they're more flexible and make it easier to implement failover across availability domains. Originally, AD-specific subnets were the only kind available to use.

    To create a regional subnet, omit this attribute. Then any resources later created in this subnet (such as a Compute instance) can be created in any availability domain in the region.

    To instead create an AD-specific subnet, set this attribute to the availability domain you want this subnet to be in. Then any resources later created in this subnet can only be created in that availability domain.

    Example: Uocm:PHX-AD-1

    definedTags Map<String,String>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    dhcpOptionsId String
    (Updatable) The OCID of the set of DHCP options the subnet will use. If you don't provide a value, the subnet uses the VCN's default set of DHCP options.
    displayName String
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    dnsLabel String

    A DNS label for the subnet, used in conjunction with the VNIC's hostname and VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet (for example, bminstance1.subnet123.vcn1.oraclevcn.com). Must be an alphanumeric string that begins with a letter and is unique within the VCN. The value cannot be changed.

    This value must be set if you want to use the Internet and VCN Resolver to resolve the hostnames of instances in the subnet. It can only be set if the VCN itself was created with a DNS label.

    For more information, see DNS in Your Virtual Cloud Network.

    Example: subnet123

    freeformTags Map<String,String>
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    ipv6cidrBlock String

    (Updatable) Use this to enable IPv6 addressing for this subnet. The VCN must be enabled for IPv6. You can't change this subnet characteristic later. All subnets are /64 in size. The subnet portion of the IPv6 address is the fourth hextet from the left (1111 in the following example).

    For important details about IPv6 addressing in a VCN, see IPv6 Addresses.

    Example: 2001:0db8:0123:1111::/64

    ipv6cidrBlocks List<String>
    (Updatable) The list of all IPv6 prefixes (Oracle allocated IPv6 GUA, ULA or private IPv6 prefixes, BYOIPv6 prefixes) for the subnet that meets the following criteria:

    • The prefixes must be valid.
    • Multiple prefixes must not overlap each other or the on-premises network prefix.
    • The number of prefixes must not exceed the limit of IPv6 prefixes allowed to a subnet.
    prohibitInternetIngress Boolean

    Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.

    For IPv6, if prohibitInternetIngress is set to true, internet access is not allowed for any IPv6s assigned to VNICs in the subnet. Otherwise, ingress internet traffic is allowed by default.

    prohibitPublicIpOnVnic will be set to the value of prohibitInternetIngress to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.

    Example: true

    prohibitPublicIpOnVnic Boolean

    Whether VNICs within this subnet can have public IP addresses. Defaults to false, which means VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch or VNIC creation (with the assignPublicIp flag in CreateVnicDetails). If prohibitPublicIpOnVnic is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it's a private subnet).

    If you intend to use an IPv6 prefix, you should use the flag prohibitInternetIngress to specify ingress internet traffic behavior of the subnet.

    Example: true

    routeTableId String
    (Updatable) The OCID of the route table the subnet will use. If you don't provide a value, the subnet uses the VCN's default route table.
    securityListIds List<String>
    (Updatable) The OCIDs of the security list or lists the subnet will use. If you don't provide a value, the subnet uses the VCN's default security list. Remember that security lists are associated with the subnet, but the rules are applied to the individual VNICs in the subnet.
    cidrBlock string

    (Updatable) The CIDR IP address range of the subnet. The CIDR must maintain the following rules -

    a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

    Example: 10.0.1.0/24

    compartmentId string
    (Updatable) The OCID of the compartment to contain the subnet.
    vcnId string

    The OCID of the VCN to contain the subnet.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    availabilityDomain string

    Controls whether the subnet is regional or specific to an availability domain. Oracle recommends creating regional subnets because they're more flexible and make it easier to implement failover across availability domains. Originally, AD-specific subnets were the only kind available to use.

    To create a regional subnet, omit this attribute. Then any resources later created in this subnet (such as a Compute instance) can be created in any availability domain in the region.

    To instead create an AD-specific subnet, set this attribute to the availability domain you want this subnet to be in. Then any resources later created in this subnet can only be created in that availability domain.

    Example: Uocm:PHX-AD-1

    definedTags {[key: string]: string}
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    dhcpOptionsId string
    (Updatable) The OCID of the set of DHCP options the subnet will use. If you don't provide a value, the subnet uses the VCN's default set of DHCP options.
    displayName string
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    dnsLabel string

    A DNS label for the subnet, used in conjunction with the VNIC's hostname and VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet (for example, bminstance1.subnet123.vcn1.oraclevcn.com). Must be an alphanumeric string that begins with a letter and is unique within the VCN. The value cannot be changed.

    This value must be set if you want to use the Internet and VCN Resolver to resolve the hostnames of instances in the subnet. It can only be set if the VCN itself was created with a DNS label.

    For more information, see DNS in Your Virtual Cloud Network.

    Example: subnet123

    freeformTags {[key: string]: string}
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    ipv6cidrBlock string

    (Updatable) Use this to enable IPv6 addressing for this subnet. The VCN must be enabled for IPv6. You can't change this subnet characteristic later. All subnets are /64 in size. The subnet portion of the IPv6 address is the fourth hextet from the left (1111 in the following example).

    For important details about IPv6 addressing in a VCN, see IPv6 Addresses.

    Example: 2001:0db8:0123:1111::/64

    ipv6cidrBlocks string[]
    (Updatable) The list of all IPv6 prefixes (Oracle allocated IPv6 GUA, ULA or private IPv6 prefixes, BYOIPv6 prefixes) for the subnet that meets the following criteria:

    • The prefixes must be valid.
    • Multiple prefixes must not overlap each other or the on-premises network prefix.
    • The number of prefixes must not exceed the limit of IPv6 prefixes allowed to a subnet.
    prohibitInternetIngress boolean

    Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.

    For IPv6, if prohibitInternetIngress is set to true, internet access is not allowed for any IPv6s assigned to VNICs in the subnet. Otherwise, ingress internet traffic is allowed by default.

    prohibitPublicIpOnVnic will be set to the value of prohibitInternetIngress to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.

    Example: true

    prohibitPublicIpOnVnic boolean

    Whether VNICs within this subnet can have public IP addresses. Defaults to false, which means VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch or VNIC creation (with the assignPublicIp flag in CreateVnicDetails). If prohibitPublicIpOnVnic is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it's a private subnet).

    If you intend to use an IPv6 prefix, you should use the flag prohibitInternetIngress to specify ingress internet traffic behavior of the subnet.

    Example: true

    routeTableId string
    (Updatable) The OCID of the route table the subnet will use. If you don't provide a value, the subnet uses the VCN's default route table.
    securityListIds string[]
    (Updatable) The OCIDs of the security list or lists the subnet will use. If you don't provide a value, the subnet uses the VCN's default security list. Remember that security lists are associated with the subnet, but the rules are applied to the individual VNICs in the subnet.
    cidr_block str

    (Updatable) The CIDR IP address range of the subnet. The CIDR must maintain the following rules -

    a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

    Example: 10.0.1.0/24

    compartment_id str
    (Updatable) The OCID of the compartment to contain the subnet.
    vcn_id str

    The OCID of the VCN to contain the subnet.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    availability_domain str

    Controls whether the subnet is regional or specific to an availability domain. Oracle recommends creating regional subnets because they're more flexible and make it easier to implement failover across availability domains. Originally, AD-specific subnets were the only kind available to use.

    To create a regional subnet, omit this attribute. Then any resources later created in this subnet (such as a Compute instance) can be created in any availability domain in the region.

    To instead create an AD-specific subnet, set this attribute to the availability domain you want this subnet to be in. Then any resources later created in this subnet can only be created in that availability domain.

    Example: Uocm:PHX-AD-1

    defined_tags Mapping[str, str]
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    dhcp_options_id str
    (Updatable) The OCID of the set of DHCP options the subnet will use. If you don't provide a value, the subnet uses the VCN's default set of DHCP options.
    display_name str
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    dns_label str

    A DNS label for the subnet, used in conjunction with the VNIC's hostname and VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet (for example, bminstance1.subnet123.vcn1.oraclevcn.com). Must be an alphanumeric string that begins with a letter and is unique within the VCN. The value cannot be changed.

    This value must be set if you want to use the Internet and VCN Resolver to resolve the hostnames of instances in the subnet. It can only be set if the VCN itself was created with a DNS label.

    For more information, see DNS in Your Virtual Cloud Network.

    Example: subnet123

    freeform_tags Mapping[str, str]
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    ipv6cidr_block str

    (Updatable) Use this to enable IPv6 addressing for this subnet. The VCN must be enabled for IPv6. You can't change this subnet characteristic later. All subnets are /64 in size. The subnet portion of the IPv6 address is the fourth hextet from the left (1111 in the following example).

    For important details about IPv6 addressing in a VCN, see IPv6 Addresses.

    Example: 2001:0db8:0123:1111::/64

    ipv6cidr_blocks Sequence[str]
    (Updatable) The list of all IPv6 prefixes (Oracle allocated IPv6 GUA, ULA or private IPv6 prefixes, BYOIPv6 prefixes) for the subnet that meets the following criteria:

    • The prefixes must be valid.
    • Multiple prefixes must not overlap each other or the on-premises network prefix.
    • The number of prefixes must not exceed the limit of IPv6 prefixes allowed to a subnet.
    prohibit_internet_ingress bool

    Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.

    For IPv6, if prohibitInternetIngress is set to true, internet access is not allowed for any IPv6s assigned to VNICs in the subnet. Otherwise, ingress internet traffic is allowed by default.

    prohibitPublicIpOnVnic will be set to the value of prohibitInternetIngress to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.

    Example: true

    prohibit_public_ip_on_vnic bool

    Whether VNICs within this subnet can have public IP addresses. Defaults to false, which means VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch or VNIC creation (with the assignPublicIp flag in CreateVnicDetails). If prohibitPublicIpOnVnic is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it's a private subnet).

    If you intend to use an IPv6 prefix, you should use the flag prohibitInternetIngress to specify ingress internet traffic behavior of the subnet.

    Example: true

    route_table_id str
    (Updatable) The OCID of the route table the subnet will use. If you don't provide a value, the subnet uses the VCN's default route table.
    security_list_ids Sequence[str]
    (Updatable) The OCIDs of the security list or lists the subnet will use. If you don't provide a value, the subnet uses the VCN's default security list. Remember that security lists are associated with the subnet, but the rules are applied to the individual VNICs in the subnet.
    cidrBlock String

    (Updatable) The CIDR IP address range of the subnet. The CIDR must maintain the following rules -

    a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

    Example: 10.0.1.0/24

    compartmentId String
    (Updatable) The OCID of the compartment to contain the subnet.
    vcnId String

    The OCID of the VCN to contain the subnet.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    availabilityDomain String

    Controls whether the subnet is regional or specific to an availability domain. Oracle recommends creating regional subnets because they're more flexible and make it easier to implement failover across availability domains. Originally, AD-specific subnets were the only kind available to use.

    To create a regional subnet, omit this attribute. Then any resources later created in this subnet (such as a Compute instance) can be created in any availability domain in the region.

    To instead create an AD-specific subnet, set this attribute to the availability domain you want this subnet to be in. Then any resources later created in this subnet can only be created in that availability domain.

    Example: Uocm:PHX-AD-1

    definedTags Map<String>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    dhcpOptionsId String
    (Updatable) The OCID of the set of DHCP options the subnet will use. If you don't provide a value, the subnet uses the VCN's default set of DHCP options.
    displayName String
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    dnsLabel String

    A DNS label for the subnet, used in conjunction with the VNIC's hostname and VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet (for example, bminstance1.subnet123.vcn1.oraclevcn.com). Must be an alphanumeric string that begins with a letter and is unique within the VCN. The value cannot be changed.

    This value must be set if you want to use the Internet and VCN Resolver to resolve the hostnames of instances in the subnet. It can only be set if the VCN itself was created with a DNS label.

    For more information, see DNS in Your Virtual Cloud Network.

    Example: subnet123

    freeformTags Map<String>
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    ipv6cidrBlock String

    (Updatable) Use this to enable IPv6 addressing for this subnet. The VCN must be enabled for IPv6. You can't change this subnet characteristic later. All subnets are /64 in size. The subnet portion of the IPv6 address is the fourth hextet from the left (1111 in the following example).

    For important details about IPv6 addressing in a VCN, see IPv6 Addresses.

    Example: 2001:0db8:0123:1111::/64

    ipv6cidrBlocks List<String>
    (Updatable) The list of all IPv6 prefixes (Oracle allocated IPv6 GUA, ULA or private IPv6 prefixes, BYOIPv6 prefixes) for the subnet that meets the following criteria:

    • The prefixes must be valid.
    • Multiple prefixes must not overlap each other or the on-premises network prefix.
    • The number of prefixes must not exceed the limit of IPv6 prefixes allowed to a subnet.
    prohibitInternetIngress Boolean

    Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.

    For IPv6, if prohibitInternetIngress is set to true, internet access is not allowed for any IPv6s assigned to VNICs in the subnet. Otherwise, ingress internet traffic is allowed by default.

    prohibitPublicIpOnVnic will be set to the value of prohibitInternetIngress to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.

    Example: true

    prohibitPublicIpOnVnic Boolean

    Whether VNICs within this subnet can have public IP addresses. Defaults to false, which means VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch or VNIC creation (with the assignPublicIp flag in CreateVnicDetails). If prohibitPublicIpOnVnic is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it's a private subnet).

    If you intend to use an IPv6 prefix, you should use the flag prohibitInternetIngress to specify ingress internet traffic behavior of the subnet.

    Example: true

    routeTableId String
    (Updatable) The OCID of the route table the subnet will use. If you don't provide a value, the subnet uses the VCN's default route table.
    securityListIds List<String>
    (Updatable) The OCIDs of the security list or lists the subnet will use. If you don't provide a value, the subnet uses the VCN's default security list. Remember that security lists are associated with the subnet, but the rules are applied to the individual VNICs in the subnet.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Ipv6virtualRouterIp string
    For an IPv6-enabled subnet, this is the IPv6 address of the virtual router. Example: 2001:0db8:0123:1111:89ab:cdef:1234:5678
    State string
    The subnet's current state.
    SubnetDomainName string
    The subnet's domain name, which consists of the subnet's DNS label, the VCN's DNS label, and the oraclevcn.com domain.
    TimeCreated string
    The date and time the subnet was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    VirtualRouterIp string
    The IP address of the virtual router. Example: 10.0.14.1
    VirtualRouterMac string
    The MAC address of the virtual router. Example: 00:00:00:00:00:01
    Id string
    The provider-assigned unique ID for this managed resource.
    Ipv6virtualRouterIp string
    For an IPv6-enabled subnet, this is the IPv6 address of the virtual router. Example: 2001:0db8:0123:1111:89ab:cdef:1234:5678
    State string
    The subnet's current state.
    SubnetDomainName string
    The subnet's domain name, which consists of the subnet's DNS label, the VCN's DNS label, and the oraclevcn.com domain.
    TimeCreated string
    The date and time the subnet was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    VirtualRouterIp string
    The IP address of the virtual router. Example: 10.0.14.1
    VirtualRouterMac string
    The MAC address of the virtual router. Example: 00:00:00:00:00:01
    id String
    The provider-assigned unique ID for this managed resource.
    ipv6virtualRouterIp String
    For an IPv6-enabled subnet, this is the IPv6 address of the virtual router. Example: 2001:0db8:0123:1111:89ab:cdef:1234:5678
    state String
    The subnet's current state.
    subnetDomainName String
    The subnet's domain name, which consists of the subnet's DNS label, the VCN's DNS label, and the oraclevcn.com domain.
    timeCreated String
    The date and time the subnet was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    virtualRouterIp String
    The IP address of the virtual router. Example: 10.0.14.1
    virtualRouterMac String
    The MAC address of the virtual router. Example: 00:00:00:00:00:01
    id string
    The provider-assigned unique ID for this managed resource.
    ipv6virtualRouterIp string
    For an IPv6-enabled subnet, this is the IPv6 address of the virtual router. Example: 2001:0db8:0123:1111:89ab:cdef:1234:5678
    state string
    The subnet's current state.
    subnetDomainName string
    The subnet's domain name, which consists of the subnet's DNS label, the VCN's DNS label, and the oraclevcn.com domain.
    timeCreated string
    The date and time the subnet was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    virtualRouterIp string
    The IP address of the virtual router. Example: 10.0.14.1
    virtualRouterMac string
    The MAC address of the virtual router. Example: 00:00:00:00:00:01
    id str
    The provider-assigned unique ID for this managed resource.
    ipv6virtual_router_ip str
    For an IPv6-enabled subnet, this is the IPv6 address of the virtual router. Example: 2001:0db8:0123:1111:89ab:cdef:1234:5678
    state str
    The subnet's current state.
    subnet_domain_name str
    The subnet's domain name, which consists of the subnet's DNS label, the VCN's DNS label, and the oraclevcn.com domain.
    time_created str
    The date and time the subnet was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    virtual_router_ip str
    The IP address of the virtual router. Example: 10.0.14.1
    virtual_router_mac str
    The MAC address of the virtual router. Example: 00:00:00:00:00:01
    id String
    The provider-assigned unique ID for this managed resource.
    ipv6virtualRouterIp String
    For an IPv6-enabled subnet, this is the IPv6 address of the virtual router. Example: 2001:0db8:0123:1111:89ab:cdef:1234:5678
    state String
    The subnet's current state.
    subnetDomainName String
    The subnet's domain name, which consists of the subnet's DNS label, the VCN's DNS label, and the oraclevcn.com domain.
    timeCreated String
    The date and time the subnet was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    virtualRouterIp String
    The IP address of the virtual router. Example: 10.0.14.1
    virtualRouterMac String
    The MAC address of the virtual router. Example: 00:00:00:00:00:01

    Look up Existing Subnet Resource

    Get an existing Subnet 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?: SubnetState, opts?: CustomResourceOptions): Subnet
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            availability_domain: Optional[str] = None,
            cidr_block: Optional[str] = None,
            compartment_id: Optional[str] = None,
            defined_tags: Optional[Mapping[str, str]] = None,
            dhcp_options_id: Optional[str] = None,
            display_name: Optional[str] = None,
            dns_label: Optional[str] = None,
            freeform_tags: Optional[Mapping[str, str]] = None,
            ipv6cidr_block: Optional[str] = None,
            ipv6cidr_blocks: Optional[Sequence[str]] = None,
            ipv6virtual_router_ip: Optional[str] = None,
            prohibit_internet_ingress: Optional[bool] = None,
            prohibit_public_ip_on_vnic: Optional[bool] = None,
            route_table_id: Optional[str] = None,
            security_list_ids: Optional[Sequence[str]] = None,
            state: Optional[str] = None,
            subnet_domain_name: Optional[str] = None,
            time_created: Optional[str] = None,
            vcn_id: Optional[str] = None,
            virtual_router_ip: Optional[str] = None,
            virtual_router_mac: Optional[str] = None) -> Subnet
    func GetSubnet(ctx *Context, name string, id IDInput, state *SubnetState, opts ...ResourceOption) (*Subnet, error)
    public static Subnet Get(string name, Input<string> id, SubnetState? state, CustomResourceOptions? opts = null)
    public static Subnet get(String name, Output<String> id, SubnetState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    AvailabilityDomain string

    Controls whether the subnet is regional or specific to an availability domain. Oracle recommends creating regional subnets because they're more flexible and make it easier to implement failover across availability domains. Originally, AD-specific subnets were the only kind available to use.

    To create a regional subnet, omit this attribute. Then any resources later created in this subnet (such as a Compute instance) can be created in any availability domain in the region.

    To instead create an AD-specific subnet, set this attribute to the availability domain you want this subnet to be in. Then any resources later created in this subnet can only be created in that availability domain.

    Example: Uocm:PHX-AD-1

    CidrBlock string

    (Updatable) The CIDR IP address range of the subnet. The CIDR must maintain the following rules -

    a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

    Example: 10.0.1.0/24

    CompartmentId string
    (Updatable) The OCID of the compartment to contain the subnet.
    DefinedTags Dictionary<string, string>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DhcpOptionsId string
    (Updatable) The OCID of the set of DHCP options the subnet will use. If you don't provide a value, the subnet uses the VCN's default set of DHCP options.
    DisplayName string
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    DnsLabel string

    A DNS label for the subnet, used in conjunction with the VNIC's hostname and VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet (for example, bminstance1.subnet123.vcn1.oraclevcn.com). Must be an alphanumeric string that begins with a letter and is unique within the VCN. The value cannot be changed.

    This value must be set if you want to use the Internet and VCN Resolver to resolve the hostnames of instances in the subnet. It can only be set if the VCN itself was created with a DNS label.

    For more information, see DNS in Your Virtual Cloud Network.

    Example: subnet123

    FreeformTags Dictionary<string, string>
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Ipv6cidrBlock string

    (Updatable) Use this to enable IPv6 addressing for this subnet. The VCN must be enabled for IPv6. You can't change this subnet characteristic later. All subnets are /64 in size. The subnet portion of the IPv6 address is the fourth hextet from the left (1111 in the following example).

    For important details about IPv6 addressing in a VCN, see IPv6 Addresses.

    Example: 2001:0db8:0123:1111::/64

    Ipv6cidrBlocks List<string>
    (Updatable) The list of all IPv6 prefixes (Oracle allocated IPv6 GUA, ULA or private IPv6 prefixes, BYOIPv6 prefixes) for the subnet that meets the following criteria:

    • The prefixes must be valid.
    • Multiple prefixes must not overlap each other or the on-premises network prefix.
    • The number of prefixes must not exceed the limit of IPv6 prefixes allowed to a subnet.
    Ipv6virtualRouterIp string
    For an IPv6-enabled subnet, this is the IPv6 address of the virtual router. Example: 2001:0db8:0123:1111:89ab:cdef:1234:5678
    ProhibitInternetIngress bool

    Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.

    For IPv6, if prohibitInternetIngress is set to true, internet access is not allowed for any IPv6s assigned to VNICs in the subnet. Otherwise, ingress internet traffic is allowed by default.

    prohibitPublicIpOnVnic will be set to the value of prohibitInternetIngress to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.

    Example: true

    ProhibitPublicIpOnVnic bool

    Whether VNICs within this subnet can have public IP addresses. Defaults to false, which means VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch or VNIC creation (with the assignPublicIp flag in CreateVnicDetails). If prohibitPublicIpOnVnic is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it's a private subnet).

    If you intend to use an IPv6 prefix, you should use the flag prohibitInternetIngress to specify ingress internet traffic behavior of the subnet.

    Example: true

    RouteTableId string
    (Updatable) The OCID of the route table the subnet will use. If you don't provide a value, the subnet uses the VCN's default route table.
    SecurityListIds List<string>
    (Updatable) The OCIDs of the security list or lists the subnet will use. If you don't provide a value, the subnet uses the VCN's default security list. Remember that security lists are associated with the subnet, but the rules are applied to the individual VNICs in the subnet.
    State string
    The subnet's current state.
    SubnetDomainName string
    The subnet's domain name, which consists of the subnet's DNS label, the VCN's DNS label, and the oraclevcn.com domain.
    TimeCreated string
    The date and time the subnet was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    VcnId string

    The OCID of the VCN to contain the subnet.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    VirtualRouterIp string
    The IP address of the virtual router. Example: 10.0.14.1
    VirtualRouterMac string
    The MAC address of the virtual router. Example: 00:00:00:00:00:01
    AvailabilityDomain string

    Controls whether the subnet is regional or specific to an availability domain. Oracle recommends creating regional subnets because they're more flexible and make it easier to implement failover across availability domains. Originally, AD-specific subnets were the only kind available to use.

    To create a regional subnet, omit this attribute. Then any resources later created in this subnet (such as a Compute instance) can be created in any availability domain in the region.

    To instead create an AD-specific subnet, set this attribute to the availability domain you want this subnet to be in. Then any resources later created in this subnet can only be created in that availability domain.

    Example: Uocm:PHX-AD-1

    CidrBlock string

    (Updatable) The CIDR IP address range of the subnet. The CIDR must maintain the following rules -

    a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

    Example: 10.0.1.0/24

    CompartmentId string
    (Updatable) The OCID of the compartment to contain the subnet.
    DefinedTags map[string]string
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DhcpOptionsId string
    (Updatable) The OCID of the set of DHCP options the subnet will use. If you don't provide a value, the subnet uses the VCN's default set of DHCP options.
    DisplayName string
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    DnsLabel string

    A DNS label for the subnet, used in conjunction with the VNIC's hostname and VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet (for example, bminstance1.subnet123.vcn1.oraclevcn.com). Must be an alphanumeric string that begins with a letter and is unique within the VCN. The value cannot be changed.

    This value must be set if you want to use the Internet and VCN Resolver to resolve the hostnames of instances in the subnet. It can only be set if the VCN itself was created with a DNS label.

    For more information, see DNS in Your Virtual Cloud Network.

    Example: subnet123

    FreeformTags map[string]string
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Ipv6cidrBlock string

    (Updatable) Use this to enable IPv6 addressing for this subnet. The VCN must be enabled for IPv6. You can't change this subnet characteristic later. All subnets are /64 in size. The subnet portion of the IPv6 address is the fourth hextet from the left (1111 in the following example).

    For important details about IPv6 addressing in a VCN, see IPv6 Addresses.

    Example: 2001:0db8:0123:1111::/64

    Ipv6cidrBlocks []string
    (Updatable) The list of all IPv6 prefixes (Oracle allocated IPv6 GUA, ULA or private IPv6 prefixes, BYOIPv6 prefixes) for the subnet that meets the following criteria:

    • The prefixes must be valid.
    • Multiple prefixes must not overlap each other or the on-premises network prefix.
    • The number of prefixes must not exceed the limit of IPv6 prefixes allowed to a subnet.
    Ipv6virtualRouterIp string
    For an IPv6-enabled subnet, this is the IPv6 address of the virtual router. Example: 2001:0db8:0123:1111:89ab:cdef:1234:5678
    ProhibitInternetIngress bool

    Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.

    For IPv6, if prohibitInternetIngress is set to true, internet access is not allowed for any IPv6s assigned to VNICs in the subnet. Otherwise, ingress internet traffic is allowed by default.

    prohibitPublicIpOnVnic will be set to the value of prohibitInternetIngress to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.

    Example: true

    ProhibitPublicIpOnVnic bool

    Whether VNICs within this subnet can have public IP addresses. Defaults to false, which means VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch or VNIC creation (with the assignPublicIp flag in CreateVnicDetails). If prohibitPublicIpOnVnic is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it's a private subnet).

    If you intend to use an IPv6 prefix, you should use the flag prohibitInternetIngress to specify ingress internet traffic behavior of the subnet.

    Example: true

    RouteTableId string
    (Updatable) The OCID of the route table the subnet will use. If you don't provide a value, the subnet uses the VCN's default route table.
    SecurityListIds []string
    (Updatable) The OCIDs of the security list or lists the subnet will use. If you don't provide a value, the subnet uses the VCN's default security list. Remember that security lists are associated with the subnet, but the rules are applied to the individual VNICs in the subnet.
    State string
    The subnet's current state.
    SubnetDomainName string
    The subnet's domain name, which consists of the subnet's DNS label, the VCN's DNS label, and the oraclevcn.com domain.
    TimeCreated string
    The date and time the subnet was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    VcnId string

    The OCID of the VCN to contain the subnet.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    VirtualRouterIp string
    The IP address of the virtual router. Example: 10.0.14.1
    VirtualRouterMac string
    The MAC address of the virtual router. Example: 00:00:00:00:00:01
    availabilityDomain String

    Controls whether the subnet is regional or specific to an availability domain. Oracle recommends creating regional subnets because they're more flexible and make it easier to implement failover across availability domains. Originally, AD-specific subnets were the only kind available to use.

    To create a regional subnet, omit this attribute. Then any resources later created in this subnet (such as a Compute instance) can be created in any availability domain in the region.

    To instead create an AD-specific subnet, set this attribute to the availability domain you want this subnet to be in. Then any resources later created in this subnet can only be created in that availability domain.

    Example: Uocm:PHX-AD-1

    cidrBlock String

    (Updatable) The CIDR IP address range of the subnet. The CIDR must maintain the following rules -

    a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

    Example: 10.0.1.0/24

    compartmentId String
    (Updatable) The OCID of the compartment to contain the subnet.
    definedTags Map<String,String>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    dhcpOptionsId String
    (Updatable) The OCID of the set of DHCP options the subnet will use. If you don't provide a value, the subnet uses the VCN's default set of DHCP options.
    displayName String
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    dnsLabel String

    A DNS label for the subnet, used in conjunction with the VNIC's hostname and VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet (for example, bminstance1.subnet123.vcn1.oraclevcn.com). Must be an alphanumeric string that begins with a letter and is unique within the VCN. The value cannot be changed.

    This value must be set if you want to use the Internet and VCN Resolver to resolve the hostnames of instances in the subnet. It can only be set if the VCN itself was created with a DNS label.

    For more information, see DNS in Your Virtual Cloud Network.

    Example: subnet123

    freeformTags Map<String,String>
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    ipv6cidrBlock String

    (Updatable) Use this to enable IPv6 addressing for this subnet. The VCN must be enabled for IPv6. You can't change this subnet characteristic later. All subnets are /64 in size. The subnet portion of the IPv6 address is the fourth hextet from the left (1111 in the following example).

    For important details about IPv6 addressing in a VCN, see IPv6 Addresses.

    Example: 2001:0db8:0123:1111::/64

    ipv6cidrBlocks List<String>
    (Updatable) The list of all IPv6 prefixes (Oracle allocated IPv6 GUA, ULA or private IPv6 prefixes, BYOIPv6 prefixes) for the subnet that meets the following criteria:

    • The prefixes must be valid.
    • Multiple prefixes must not overlap each other or the on-premises network prefix.
    • The number of prefixes must not exceed the limit of IPv6 prefixes allowed to a subnet.
    ipv6virtualRouterIp String
    For an IPv6-enabled subnet, this is the IPv6 address of the virtual router. Example: 2001:0db8:0123:1111:89ab:cdef:1234:5678
    prohibitInternetIngress Boolean

    Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.

    For IPv6, if prohibitInternetIngress is set to true, internet access is not allowed for any IPv6s assigned to VNICs in the subnet. Otherwise, ingress internet traffic is allowed by default.

    prohibitPublicIpOnVnic will be set to the value of prohibitInternetIngress to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.

    Example: true

    prohibitPublicIpOnVnic Boolean

    Whether VNICs within this subnet can have public IP addresses. Defaults to false, which means VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch or VNIC creation (with the assignPublicIp flag in CreateVnicDetails). If prohibitPublicIpOnVnic is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it's a private subnet).

    If you intend to use an IPv6 prefix, you should use the flag prohibitInternetIngress to specify ingress internet traffic behavior of the subnet.

    Example: true

    routeTableId String
    (Updatable) The OCID of the route table the subnet will use. If you don't provide a value, the subnet uses the VCN's default route table.
    securityListIds List<String>
    (Updatable) The OCIDs of the security list or lists the subnet will use. If you don't provide a value, the subnet uses the VCN's default security list. Remember that security lists are associated with the subnet, but the rules are applied to the individual VNICs in the subnet.
    state String
    The subnet's current state.
    subnetDomainName String
    The subnet's domain name, which consists of the subnet's DNS label, the VCN's DNS label, and the oraclevcn.com domain.
    timeCreated String
    The date and time the subnet was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    vcnId String

    The OCID of the VCN to contain the subnet.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    virtualRouterIp String
    The IP address of the virtual router. Example: 10.0.14.1
    virtualRouterMac String
    The MAC address of the virtual router. Example: 00:00:00:00:00:01
    availabilityDomain string

    Controls whether the subnet is regional or specific to an availability domain. Oracle recommends creating regional subnets because they're more flexible and make it easier to implement failover across availability domains. Originally, AD-specific subnets were the only kind available to use.

    To create a regional subnet, omit this attribute. Then any resources later created in this subnet (such as a Compute instance) can be created in any availability domain in the region.

    To instead create an AD-specific subnet, set this attribute to the availability domain you want this subnet to be in. Then any resources later created in this subnet can only be created in that availability domain.

    Example: Uocm:PHX-AD-1

    cidrBlock string

    (Updatable) The CIDR IP address range of the subnet. The CIDR must maintain the following rules -

    a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

    Example: 10.0.1.0/24

    compartmentId string
    (Updatable) The OCID of the compartment to contain the subnet.
    definedTags {[key: string]: string}
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    dhcpOptionsId string
    (Updatable) The OCID of the set of DHCP options the subnet will use. If you don't provide a value, the subnet uses the VCN's default set of DHCP options.
    displayName string
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    dnsLabel string

    A DNS label for the subnet, used in conjunction with the VNIC's hostname and VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet (for example, bminstance1.subnet123.vcn1.oraclevcn.com). Must be an alphanumeric string that begins with a letter and is unique within the VCN. The value cannot be changed.

    This value must be set if you want to use the Internet and VCN Resolver to resolve the hostnames of instances in the subnet. It can only be set if the VCN itself was created with a DNS label.

    For more information, see DNS in Your Virtual Cloud Network.

    Example: subnet123

    freeformTags {[key: string]: string}
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    ipv6cidrBlock string

    (Updatable) Use this to enable IPv6 addressing for this subnet. The VCN must be enabled for IPv6. You can't change this subnet characteristic later. All subnets are /64 in size. The subnet portion of the IPv6 address is the fourth hextet from the left (1111 in the following example).

    For important details about IPv6 addressing in a VCN, see IPv6 Addresses.

    Example: 2001:0db8:0123:1111::/64

    ipv6cidrBlocks string[]
    (Updatable) The list of all IPv6 prefixes (Oracle allocated IPv6 GUA, ULA or private IPv6 prefixes, BYOIPv6 prefixes) for the subnet that meets the following criteria:

    • The prefixes must be valid.
    • Multiple prefixes must not overlap each other or the on-premises network prefix.
    • The number of prefixes must not exceed the limit of IPv6 prefixes allowed to a subnet.
    ipv6virtualRouterIp string
    For an IPv6-enabled subnet, this is the IPv6 address of the virtual router. Example: 2001:0db8:0123:1111:89ab:cdef:1234:5678
    prohibitInternetIngress boolean

    Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.

    For IPv6, if prohibitInternetIngress is set to true, internet access is not allowed for any IPv6s assigned to VNICs in the subnet. Otherwise, ingress internet traffic is allowed by default.

    prohibitPublicIpOnVnic will be set to the value of prohibitInternetIngress to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.

    Example: true

    prohibitPublicIpOnVnic boolean

    Whether VNICs within this subnet can have public IP addresses. Defaults to false, which means VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch or VNIC creation (with the assignPublicIp flag in CreateVnicDetails). If prohibitPublicIpOnVnic is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it's a private subnet).

    If you intend to use an IPv6 prefix, you should use the flag prohibitInternetIngress to specify ingress internet traffic behavior of the subnet.

    Example: true

    routeTableId string
    (Updatable) The OCID of the route table the subnet will use. If you don't provide a value, the subnet uses the VCN's default route table.
    securityListIds string[]
    (Updatable) The OCIDs of the security list or lists the subnet will use. If you don't provide a value, the subnet uses the VCN's default security list. Remember that security lists are associated with the subnet, but the rules are applied to the individual VNICs in the subnet.
    state string
    The subnet's current state.
    subnetDomainName string
    The subnet's domain name, which consists of the subnet's DNS label, the VCN's DNS label, and the oraclevcn.com domain.
    timeCreated string
    The date and time the subnet was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    vcnId string

    The OCID of the VCN to contain the subnet.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    virtualRouterIp string
    The IP address of the virtual router. Example: 10.0.14.1
    virtualRouterMac string
    The MAC address of the virtual router. Example: 00:00:00:00:00:01
    availability_domain str

    Controls whether the subnet is regional or specific to an availability domain. Oracle recommends creating regional subnets because they're more flexible and make it easier to implement failover across availability domains. Originally, AD-specific subnets were the only kind available to use.

    To create a regional subnet, omit this attribute. Then any resources later created in this subnet (such as a Compute instance) can be created in any availability domain in the region.

    To instead create an AD-specific subnet, set this attribute to the availability domain you want this subnet to be in. Then any resources later created in this subnet can only be created in that availability domain.

    Example: Uocm:PHX-AD-1

    cidr_block str

    (Updatable) The CIDR IP address range of the subnet. The CIDR must maintain the following rules -

    a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

    Example: 10.0.1.0/24

    compartment_id str
    (Updatable) The OCID of the compartment to contain the subnet.
    defined_tags Mapping[str, str]
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    dhcp_options_id str
    (Updatable) The OCID of the set of DHCP options the subnet will use. If you don't provide a value, the subnet uses the VCN's default set of DHCP options.
    display_name str
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    dns_label str

    A DNS label for the subnet, used in conjunction with the VNIC's hostname and VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet (for example, bminstance1.subnet123.vcn1.oraclevcn.com). Must be an alphanumeric string that begins with a letter and is unique within the VCN. The value cannot be changed.

    This value must be set if you want to use the Internet and VCN Resolver to resolve the hostnames of instances in the subnet. It can only be set if the VCN itself was created with a DNS label.

    For more information, see DNS in Your Virtual Cloud Network.

    Example: subnet123

    freeform_tags Mapping[str, str]
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    ipv6cidr_block str

    (Updatable) Use this to enable IPv6 addressing for this subnet. The VCN must be enabled for IPv6. You can't change this subnet characteristic later. All subnets are /64 in size. The subnet portion of the IPv6 address is the fourth hextet from the left (1111 in the following example).

    For important details about IPv6 addressing in a VCN, see IPv6 Addresses.

    Example: 2001:0db8:0123:1111::/64

    ipv6cidr_blocks Sequence[str]
    (Updatable) The list of all IPv6 prefixes (Oracle allocated IPv6 GUA, ULA or private IPv6 prefixes, BYOIPv6 prefixes) for the subnet that meets the following criteria:

    • The prefixes must be valid.
    • Multiple prefixes must not overlap each other or the on-premises network prefix.
    • The number of prefixes must not exceed the limit of IPv6 prefixes allowed to a subnet.
    ipv6virtual_router_ip str
    For an IPv6-enabled subnet, this is the IPv6 address of the virtual router. Example: 2001:0db8:0123:1111:89ab:cdef:1234:5678
    prohibit_internet_ingress bool

    Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.

    For IPv6, if prohibitInternetIngress is set to true, internet access is not allowed for any IPv6s assigned to VNICs in the subnet. Otherwise, ingress internet traffic is allowed by default.

    prohibitPublicIpOnVnic will be set to the value of prohibitInternetIngress to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.

    Example: true

    prohibit_public_ip_on_vnic bool

    Whether VNICs within this subnet can have public IP addresses. Defaults to false, which means VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch or VNIC creation (with the assignPublicIp flag in CreateVnicDetails). If prohibitPublicIpOnVnic is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it's a private subnet).

    If you intend to use an IPv6 prefix, you should use the flag prohibitInternetIngress to specify ingress internet traffic behavior of the subnet.

    Example: true

    route_table_id str
    (Updatable) The OCID of the route table the subnet will use. If you don't provide a value, the subnet uses the VCN's default route table.
    security_list_ids Sequence[str]
    (Updatable) The OCIDs of the security list or lists the subnet will use. If you don't provide a value, the subnet uses the VCN's default security list. Remember that security lists are associated with the subnet, but the rules are applied to the individual VNICs in the subnet.
    state str
    The subnet's current state.
    subnet_domain_name str
    The subnet's domain name, which consists of the subnet's DNS label, the VCN's DNS label, and the oraclevcn.com domain.
    time_created str
    The date and time the subnet was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    vcn_id str

    The OCID of the VCN to contain the subnet.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    virtual_router_ip str
    The IP address of the virtual router. Example: 10.0.14.1
    virtual_router_mac str
    The MAC address of the virtual router. Example: 00:00:00:00:00:01
    availabilityDomain String

    Controls whether the subnet is regional or specific to an availability domain. Oracle recommends creating regional subnets because they're more flexible and make it easier to implement failover across availability domains. Originally, AD-specific subnets were the only kind available to use.

    To create a regional subnet, omit this attribute. Then any resources later created in this subnet (such as a Compute instance) can be created in any availability domain in the region.

    To instead create an AD-specific subnet, set this attribute to the availability domain you want this subnet to be in. Then any resources later created in this subnet can only be created in that availability domain.

    Example: Uocm:PHX-AD-1

    cidrBlock String

    (Updatable) The CIDR IP address range of the subnet. The CIDR must maintain the following rules -

    a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

    Example: 10.0.1.0/24

    compartmentId String
    (Updatable) The OCID of the compartment to contain the subnet.
    definedTags Map<String>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    dhcpOptionsId String
    (Updatable) The OCID of the set of DHCP options the subnet will use. If you don't provide a value, the subnet uses the VCN's default set of DHCP options.
    displayName String
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    dnsLabel String

    A DNS label for the subnet, used in conjunction with the VNIC's hostname and VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet (for example, bminstance1.subnet123.vcn1.oraclevcn.com). Must be an alphanumeric string that begins with a letter and is unique within the VCN. The value cannot be changed.

    This value must be set if you want to use the Internet and VCN Resolver to resolve the hostnames of instances in the subnet. It can only be set if the VCN itself was created with a DNS label.

    For more information, see DNS in Your Virtual Cloud Network.

    Example: subnet123

    freeformTags Map<String>
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    ipv6cidrBlock String

    (Updatable) Use this to enable IPv6 addressing for this subnet. The VCN must be enabled for IPv6. You can't change this subnet characteristic later. All subnets are /64 in size. The subnet portion of the IPv6 address is the fourth hextet from the left (1111 in the following example).

    For important details about IPv6 addressing in a VCN, see IPv6 Addresses.

    Example: 2001:0db8:0123:1111::/64

    ipv6cidrBlocks List<String>
    (Updatable) The list of all IPv6 prefixes (Oracle allocated IPv6 GUA, ULA or private IPv6 prefixes, BYOIPv6 prefixes) for the subnet that meets the following criteria:

    • The prefixes must be valid.
    • Multiple prefixes must not overlap each other or the on-premises network prefix.
    • The number of prefixes must not exceed the limit of IPv6 prefixes allowed to a subnet.
    ipv6virtualRouterIp String
    For an IPv6-enabled subnet, this is the IPv6 address of the virtual router. Example: 2001:0db8:0123:1111:89ab:cdef:1234:5678
    prohibitInternetIngress Boolean

    Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.

    For IPv6, if prohibitInternetIngress is set to true, internet access is not allowed for any IPv6s assigned to VNICs in the subnet. Otherwise, ingress internet traffic is allowed by default.

    prohibitPublicIpOnVnic will be set to the value of prohibitInternetIngress to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.

    Example: true

    prohibitPublicIpOnVnic Boolean

    Whether VNICs within this subnet can have public IP addresses. Defaults to false, which means VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch or VNIC creation (with the assignPublicIp flag in CreateVnicDetails). If prohibitPublicIpOnVnic is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it's a private subnet).

    If you intend to use an IPv6 prefix, you should use the flag prohibitInternetIngress to specify ingress internet traffic behavior of the subnet.

    Example: true

    routeTableId String
    (Updatable) The OCID of the route table the subnet will use. If you don't provide a value, the subnet uses the VCN's default route table.
    securityListIds List<String>
    (Updatable) The OCIDs of the security list or lists the subnet will use. If you don't provide a value, the subnet uses the VCN's default security list. Remember that security lists are associated with the subnet, but the rules are applied to the individual VNICs in the subnet.
    state String
    The subnet's current state.
    subnetDomainName String
    The subnet's domain name, which consists of the subnet's DNS label, the VCN's DNS label, and the oraclevcn.com domain.
    timeCreated String
    The date and time the subnet was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    vcnId String

    The OCID of the VCN to contain the subnet.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    virtualRouterIp String
    The IP address of the virtual router. Example: 10.0.14.1
    virtualRouterMac String
    The MAC address of the virtual router. Example: 00:00:00:00:00:01

    Import

    Subnets can be imported using the id, e.g.

    $ pulumi import oci:Core/subnet:Subnet test_subnet "id"
    

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

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi