1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Core
  5. Subnet
Oracle Cloud Infrastructure v1.29.0 published on Thursday, Mar 28, 2024 by Pulumi

oci.Core.Subnet

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.29.0 published on Thursday, Mar 28, 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("testSubnet", {
        cidrBlock: _var.subnet_cidr_block,
        compartmentId: _var.compartment_id,
        vcnId: oci_core_vcn.test_vcn.id,
        availabilityDomain: _var.subnet_availability_domain,
        definedTags: {
            "Operations.CostCenter": "42",
        },
        dhcpOptionsId: oci_core_dhcp_options.test_dhcp_options.id,
        displayName: _var.subnet_display_name,
        dnsLabel: _var.subnet_dns_label,
        freeformTags: {
            Department: "Finance",
        },
        ipv6cidrBlock: _var.subnet_ipv6cidr_block,
        ipv6cidrBlocks: _var.subnet_ipv6cidr_blocks,
        prohibitInternetIngress: _var.subnet_prohibit_internet_ingress,
        prohibitPublicIpOnVnic: _var.subnet_prohibit_public_ip_on_vnic,
        routeTableId: oci_core_route_table.test_route_table.id,
        securityListIds: _var.subnet_security_list_ids,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_subnet = oci.core.Subnet("testSubnet",
        cidr_block=var["subnet_cidr_block"],
        compartment_id=var["compartment_id"],
        vcn_id=oci_core_vcn["test_vcn"]["id"],
        availability_domain=var["subnet_availability_domain"],
        defined_tags={
            "Operations.CostCenter": "42",
        },
        dhcp_options_id=oci_core_dhcp_options["test_dhcp_options"]["id"],
        display_name=var["subnet_display_name"],
        dns_label=var["subnet_dns_label"],
        freeform_tags={
            "Department": "Finance",
        },
        ipv6cidr_block=var["subnet_ipv6cidr_block"],
        ipv6cidr_blocks=var["subnet_ipv6cidr_blocks"],
        prohibit_internet_ingress=var["subnet_prohibit_internet_ingress"],
        prohibit_public_ip_on_vnic=var["subnet_prohibit_public_ip_on_vnic"],
        route_table_id=oci_core_route_table["test_route_table"]["id"],
        security_list_ids=var["subnet_security_list_ids"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/Core"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Core.NewSubnet(ctx, "testSubnet", &Core.SubnetArgs{
    			CidrBlock:          pulumi.Any(_var.Subnet_cidr_block),
    			CompartmentId:      pulumi.Any(_var.Compartment_id),
    			VcnId:              pulumi.Any(oci_core_vcn.Test_vcn.Id),
    			AvailabilityDomain: pulumi.Any(_var.Subnet_availability_domain),
    			DefinedTags: pulumi.Map{
    				"Operations.CostCenter": pulumi.Any("42"),
    			},
    			DhcpOptionsId: pulumi.Any(oci_core_dhcp_options.Test_dhcp_options.Id),
    			DisplayName:   pulumi.Any(_var.Subnet_display_name),
    			DnsLabel:      pulumi.Any(_var.Subnet_dns_label),
    			FreeformTags: pulumi.Map{
    				"Department": pulumi.Any("Finance"),
    			},
    			Ipv6cidrBlock:           pulumi.Any(_var.Subnet_ipv6cidr_block),
    			Ipv6cidrBlocks:          pulumi.Any(_var.Subnet_ipv6cidr_blocks),
    			ProhibitInternetIngress: pulumi.Any(_var.Subnet_prohibit_internet_ingress),
    			ProhibitPublicIpOnVnic:  pulumi.Any(_var.Subnet_prohibit_public_ip_on_vnic),
    			RouteTableId:            pulumi.Any(oci_core_route_table.Test_route_table.Id),
    			SecurityListIds:         pulumi.Any(_var.Subnet_security_list_ids),
    		})
    		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("testSubnet", new()
        {
            CidrBlock = @var.Subnet_cidr_block,
            CompartmentId = @var.Compartment_id,
            VcnId = oci_core_vcn.Test_vcn.Id,
            AvailabilityDomain = @var.Subnet_availability_domain,
            DefinedTags = 
            {
                { "Operations.CostCenter", "42" },
            },
            DhcpOptionsId = oci_core_dhcp_options.Test_dhcp_options.Id,
            DisplayName = @var.Subnet_display_name,
            DnsLabel = @var.Subnet_dns_label,
            FreeformTags = 
            {
                { "Department", "Finance" },
            },
            Ipv6cidrBlock = @var.Subnet_ipv6cidr_block,
            Ipv6cidrBlocks = @var.Subnet_ipv6cidr_blocks,
            ProhibitInternetIngress = @var.Subnet_prohibit_internet_ingress,
            ProhibitPublicIpOnVnic = @var.Subnet_prohibit_public_ip_on_vnic,
            RouteTableId = oci_core_route_table.Test_route_table.Id,
            SecurityListIds = @var.Subnet_security_list_ids,
        });
    
    });
    
    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(var_.subnet_cidr_block())
                .compartmentId(var_.compartment_id())
                .vcnId(oci_core_vcn.test_vcn().id())
                .availabilityDomain(var_.subnet_availability_domain())
                .definedTags(Map.of("Operations.CostCenter", "42"))
                .dhcpOptionsId(oci_core_dhcp_options.test_dhcp_options().id())
                .displayName(var_.subnet_display_name())
                .dnsLabel(var_.subnet_dns_label())
                .freeformTags(Map.of("Department", "Finance"))
                .ipv6cidrBlock(var_.subnet_ipv6cidr_block())
                .ipv6cidrBlocks(var_.subnet_ipv6cidr_blocks())
                .prohibitInternetIngress(var_.subnet_prohibit_internet_ingress())
                .prohibitPublicIpOnVnic(var_.subnet_prohibit_public_ip_on_vnic())
                .routeTableId(oci_core_route_table.test_route_table().id())
                .securityListIds(var_.subnet_security_list_ids())
                .build());
    
        }
    }
    
    resources:
      testSubnet:
        type: oci:Core:Subnet
        properties:
          #Required
          cidrBlock: ${var.subnet_cidr_block}
          compartmentId: ${var.compartment_id}
          vcnId: ${oci_core_vcn.test_vcn.id}
          #Optional
          availabilityDomain: ${var.subnet_availability_domain}
          definedTags:
            Operations.CostCenter: '42'
          dhcpOptionsId: ${oci_core_dhcp_options.test_dhcp_options.id}
          displayName: ${var.subnet_display_name}
          dnsLabel: ${var.subnet_dns_label}
          freeformTags:
            Department: Finance
          ipv6cidrBlock: ${var.subnet_ipv6cidr_block}
          ipv6cidrBlocks: ${var.subnet_ipv6cidr_blocks}
          prohibitInternetIngress: ${var.subnet_prohibit_internet_ingress}
          prohibitPublicIpOnVnic: ${var.subnet_prohibit_public_ip_on_vnic}
          routeTableId: ${oci_core_route_table.test_route_table.id}
          securityListIds: ${var.subnet_security_list_ids}
    

    Create Subnet Resource

    new Subnet(name: string, args: SubnetArgs, opts?: CustomResourceOptions);
    @overload
    def Subnet(resource_name: 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, Any]] = None,
               dhcp_options_id: Optional[str] = None,
               display_name: Optional[str] = None,
               dns_label: Optional[str] = None,
               freeform_tags: Optional[Mapping[str, Any]] = 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,
               vcn_id: Optional[str] = None)
    @overload
    def Subnet(resource_name: str,
               args: SubnetArgs,
               opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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

    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, object>
    (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, object>
    (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]interface{}
    (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]interface{}
    (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,Object>
    (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,Object>
    (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]: any}
    (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]: any}
    (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, Any]
    (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, Any]
    (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<Any>
    (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<Any>
    (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, Any]] = None,
            dhcp_options_id: Optional[str] = None,
            display_name: Optional[str] = None,
            dns_label: Optional[str] = None,
            freeform_tags: Optional[Mapping[str, Any]] = 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, object>
    (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, object>
    (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]interface{}
    (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]interface{}
    (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,Object>
    (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,Object>
    (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]: any}
    (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]: any}
    (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, Any]
    (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, Any]
    (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<Any>
    (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<Any>
    (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"
    

    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 v1.29.0 published on Thursday, Mar 28, 2024 by Pulumi