oci.Core.Subnet
Explore with Pulumi AI
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:
- Cidr
Block 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
- Compartment
Id string - (Updatable) The OCID of the compartment to contain the subnet.
- Vcn
Id 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
- Availability
Domain 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
- 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"}
- Dhcp
Options stringId - (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 string - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Dns
Label 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
- 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"}
- Ipv6cidr
Block 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
- Ipv6cidr
Blocks 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.
- Prohibit
Internet boolIngress Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.
For IPv6, if
prohibitInternetIngress
is set totrue
, 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 ofprohibitInternetIngress
to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.Example:
true
- Prohibit
Public boolIp On Vnic 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). IfprohibitPublicIpOnVnic
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 stringId - (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 List<string>Ids - (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 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
- Compartment
Id string - (Updatable) The OCID of the compartment to contain the subnet.
- Vcn
Id 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
- Availability
Domain 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
- 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"}
- Dhcp
Options stringId - (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 string - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Dns
Label 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
- 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"}
- Ipv6cidr
Block 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
- Ipv6cidr
Blocks []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.
- Prohibit
Internet boolIngress Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.
For IPv6, if
prohibitInternetIngress
is set totrue
, 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 ofprohibitInternetIngress
to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.Example:
true
- Prohibit
Public boolIp On Vnic 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). IfprohibitPublicIpOnVnic
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 stringId - (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 []stringIds - (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 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
- compartment
Id String - (Updatable) The OCID of the compartment to contain the subnet.
- vcn
Id 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
- availability
Domain 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
- 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"}
- dhcp
Options StringId - (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 String - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- dns
Label 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
- 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"}
- ipv6cidr
Block 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
- ipv6cidr
Blocks 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.
- prohibit
Internet BooleanIngress Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.
For IPv6, if
prohibitInternetIngress
is set totrue
, 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 ofprohibitInternetIngress
to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.Example:
true
- prohibit
Public BooleanIp On Vnic 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). IfprohibitPublicIpOnVnic
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 StringId - (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 List<String>Ids - (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 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
- compartment
Id string - (Updatable) The OCID of the compartment to contain the subnet.
- vcn
Id 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
- availability
Domain 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
- {[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"}
- dhcp
Options stringId - (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 string - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- dns
Label 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
- {[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"}
- ipv6cidr
Block 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
- ipv6cidr
Blocks 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.
- prohibit
Internet booleanIngress Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.
For IPv6, if
prohibitInternetIngress
is set totrue
, 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 ofprohibitInternetIngress
to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.Example:
true
- prohibit
Public booleanIp On Vnic 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). IfprohibitPublicIpOnVnic
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 stringId - (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 string[]Ids - (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
- 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_ strid - (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
- 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_ boolingress Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.
For IPv6, if
prohibitInternetIngress
is set totrue
, 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 ofprohibitInternetIngress
to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.Example:
true
- prohibit_
public_ boolip_ on_ vnic 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). IfprohibitPublicIpOnVnic
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_ strid - (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_ Sequence[str]ids - (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 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
- compartment
Id String - (Updatable) The OCID of the compartment to contain the subnet.
- vcn
Id 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
- availability
Domain 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
- 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"}
- dhcp
Options StringId - (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 String - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- dns
Label 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
- 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"}
- ipv6cidr
Block 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
- ipv6cidr
Blocks 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.
- prohibit
Internet BooleanIngress Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.
For IPv6, if
prohibitInternetIngress
is set totrue
, 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 ofprohibitInternetIngress
to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.Example:
true
- prohibit
Public BooleanIp On Vnic 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). IfprohibitPublicIpOnVnic
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 StringId - (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 List<String>Ids - (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.
- Ipv6virtual
Router stringIp - 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.
- Subnet
Domain stringName - 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 string - The date and time the subnet was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- Virtual
Router stringIp - The IP address of the virtual router. Example:
10.0.14.1
- Virtual
Router stringMac - 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.
- Ipv6virtual
Router stringIp - 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.
- Subnet
Domain stringName - 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 string - The date and time the subnet was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- Virtual
Router stringIp - The IP address of the virtual router. Example:
10.0.14.1
- Virtual
Router stringMac - 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.
- ipv6virtual
Router StringIp - 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.
- subnet
Domain StringName - 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 String - The date and time the subnet was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- virtual
Router StringIp - The IP address of the virtual router. Example:
10.0.14.1
- virtual
Router StringMac - 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.
- ipv6virtual
Router stringIp - 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.
- subnet
Domain stringName - 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 string - The date and time the subnet was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- virtual
Router stringIp - The IP address of the virtual router. Example:
10.0.14.1
- virtual
Router stringMac - 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_ strip - 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_ strname - 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_ strip - The IP address of the virtual router. Example:
10.0.14.1
- virtual_
router_ strmac - 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.
- ipv6virtual
Router StringIp - 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.
- subnet
Domain StringName - 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 String - The date and time the subnet was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- virtual
Router StringIp - The IP address of the virtual router. Example:
10.0.14.1
- virtual
Router StringMac - 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.
- Availability
Domain 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
- Cidr
Block 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
- Compartment
Id string - (Updatable) The OCID of the compartment to contain the subnet.
- 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"}
- Dhcp
Options stringId - (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 string - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Dns
Label 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
- 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"}
- Ipv6cidr
Block 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
- Ipv6cidr
Blocks 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.
- Ipv6virtual
Router stringIp - 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 boolIngress Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.
For IPv6, if
prohibitInternetIngress
is set totrue
, 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 ofprohibitInternetIngress
to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.Example:
true
- Prohibit
Public boolIp On Vnic 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). IfprohibitPublicIpOnVnic
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 stringId - (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 List<string>Ids - (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.
- Subnet
Domain stringName - 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 string - The date and time the subnet was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- Vcn
Id 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
- Virtual
Router stringIp - The IP address of the virtual router. Example:
10.0.14.1
- Virtual
Router stringMac - The MAC address of the virtual router. Example:
00:00:00:00:00:01
- Availability
Domain 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
- Cidr
Block 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
- Compartment
Id string - (Updatable) The OCID of the compartment to contain the subnet.
- 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"}
- Dhcp
Options stringId - (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 string - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Dns
Label 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
- 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"}
- Ipv6cidr
Block 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
- Ipv6cidr
Blocks []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.
- Ipv6virtual
Router stringIp - 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 boolIngress Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.
For IPv6, if
prohibitInternetIngress
is set totrue
, 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 ofprohibitInternetIngress
to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.Example:
true
- Prohibit
Public boolIp On Vnic 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). IfprohibitPublicIpOnVnic
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 stringId - (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 []stringIds - (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.
- Subnet
Domain stringName - 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 string - The date and time the subnet was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- Vcn
Id 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
- Virtual
Router stringIp - The IP address of the virtual router. Example:
10.0.14.1
- Virtual
Router stringMac - The MAC address of the virtual router. Example:
00:00:00:00:00:01
- availability
Domain 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
- cidr
Block 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
- compartment
Id String - (Updatable) The OCID of the compartment to contain the subnet.
- 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"}
- dhcp
Options StringId - (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 String - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- dns
Label 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
- 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"}
- ipv6cidr
Block 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
- ipv6cidr
Blocks 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.
- ipv6virtual
Router StringIp - 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 BooleanIngress Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.
For IPv6, if
prohibitInternetIngress
is set totrue
, 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 ofprohibitInternetIngress
to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.Example:
true
- prohibit
Public BooleanIp On Vnic 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). IfprohibitPublicIpOnVnic
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 StringId - (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 List<String>Ids - (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.
- subnet
Domain StringName - 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 String - The date and time the subnet was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vcn
Id 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
- virtual
Router StringIp - The IP address of the virtual router. Example:
10.0.14.1
- virtual
Router StringMac - The MAC address of the virtual router. Example:
00:00:00:00:00:01
- availability
Domain 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
- cidr
Block 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
- compartment
Id string - (Updatable) The OCID of the compartment to contain the subnet.
- {[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"}
- dhcp
Options stringId - (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 string - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- dns
Label 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
- {[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"}
- ipv6cidr
Block 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
- ipv6cidr
Blocks 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.
- ipv6virtual
Router stringIp - 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 booleanIngress Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.
For IPv6, if
prohibitInternetIngress
is set totrue
, 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 ofprohibitInternetIngress
to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.Example:
true
- prohibit
Public booleanIp On Vnic 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). IfprohibitPublicIpOnVnic
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 stringId - (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 string[]Ids - (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.
- subnet
Domain stringName - 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 string - The date and time the subnet was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vcn
Id 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
- virtual
Router stringIp - The IP address of the virtual router. Example:
10.0.14.1
- virtual
Router stringMac - 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.
- 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_ strid - (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
- 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_ strip - 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_ boolingress Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.
For IPv6, if
prohibitInternetIngress
is set totrue
, 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 ofprohibitInternetIngress
to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.Example:
true
- prohibit_
public_ boolip_ on_ vnic 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). IfprohibitPublicIpOnVnic
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_ strid - (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_ Sequence[str]ids - (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_ strname - 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_ strip - The IP address of the virtual router. Example:
10.0.14.1
- virtual_
router_ strmac - The MAC address of the virtual router. Example:
00:00:00:00:00:01
- availability
Domain 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
- cidr
Block 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
- compartment
Id String - (Updatable) The OCID of the compartment to contain the subnet.
- 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"}
- dhcp
Options StringId - (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 String - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- dns
Label 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
- 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"}
- ipv6cidr
Block 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
- ipv6cidr
Blocks 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.
- ipv6virtual
Router StringIp - 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 BooleanIngress Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.
For IPv6, if
prohibitInternetIngress
is set totrue
, 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 ofprohibitInternetIngress
to dictate IPv4 behavior in this subnet. Only one or the other flag should be specified.Example:
true
- prohibit
Public BooleanIp On Vnic 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). IfprohibitPublicIpOnVnic
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 StringId - (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 List<String>Ids - (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.
- subnet
Domain StringName - 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 String - The date and time the subnet was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vcn
Id 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
- virtual
Router StringIp - The IP address of the virtual router. Example:
10.0.14.1
- virtual
Router StringMac - 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.