Subnet
Manages a subnet. Subnets represent network segments within the IP space defined by the virtual network.
NOTE on Virtual Networks and Subnet’s: This provider currently provides both a standalone Subnet resource, and allows for Subnets to be defined in-line within the Virtual Network resource. At this time you cannot use a Virtual Network with in-line Subnets in conjunction with any Subnet resources. Doing so will cause a conflict of Subnet configurations and will overwrite Subnet’s.
Create a Subnet Resource
new Subnet(name: string, args: SubnetArgs, opts?: CustomResourceOptions);def Subnet(resource_name, opts=None, address_prefix=None, address_prefixes=None, delegations=None, enforce_private_link_endpoint_network_policies=None, enforce_private_link_service_network_policies=None, name=None, resource_group_name=None, service_endpoints=None, virtual_network_name=None, __props__=None);func NewSubnet(ctx *Context, name string, args SubnetArgs, opts ...ResourceOption) (*Subnet, error)public Subnet(string name, SubnetArgs args, CustomResourceOptions? opts = null)- 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.
- opts ResourceOptions
- A bag of options that control this 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.
Subnet Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Subnet resource accepts the following input properties:
- Resource
Group stringName The name of the resource group in which to create the subnet. Changing this forces a new resource to be created.
- Virtual
Network stringName The name of the virtual network to which to attach the subnet. Changing this forces a new resource to be created.
- Address
Prefix string The address prefix to use for the subnet.
- Address
Prefixes List<string> The address prefixes to use for the subnet.
- Delegations
List<Subnet
Delegation Args> One or more
delegationblocks as defined below.- Enforce
Private boolLink Endpoint Network Policies Enable or Disable network policies for the private link endpoint on the subnet. Default value is
false. Conflicts with enforce_private_link_service_network_policies.- Enforce
Private boolLink Service Network Policies Enable or Disable network policies for the private link service on the subnet. Default valule is
false. Conflicts withenforce_private_link_endpoint_network_policies.- Name string
The name of the subnet. Changing this forces a new resource to be created.
- Service
Endpoints List<string> The list of Service endpoints to associate with the subnet. Possible values include:
Microsoft.AzureActiveDirectory,Microsoft.AzureCosmosDB,Microsoft.ContainerRegistry,Microsoft.EventHub,Microsoft.KeyVault,Microsoft.ServiceBus,Microsoft.Sql,Microsoft.StorageandMicrosoft.Web.
- Resource
Group stringName The name of the resource group in which to create the subnet. Changing this forces a new resource to be created.
- Virtual
Network stringName The name of the virtual network to which to attach the subnet. Changing this forces a new resource to be created.
- Address
Prefix string The address prefix to use for the subnet.
- Address
Prefixes []string The address prefixes to use for the subnet.
- Delegations
[]Subnet
Delegation One or more
delegationblocks as defined below.- Enforce
Private boolLink Endpoint Network Policies Enable or Disable network policies for the private link endpoint on the subnet. Default value is
false. Conflicts with enforce_private_link_service_network_policies.- Enforce
Private boolLink Service Network Policies Enable or Disable network policies for the private link service on the subnet. Default valule is
false. Conflicts withenforce_private_link_endpoint_network_policies.- Name string
The name of the subnet. Changing this forces a new resource to be created.
- Service
Endpoints []string The list of Service endpoints to associate with the subnet. Possible values include:
Microsoft.AzureActiveDirectory,Microsoft.AzureCosmosDB,Microsoft.ContainerRegistry,Microsoft.EventHub,Microsoft.KeyVault,Microsoft.ServiceBus,Microsoft.Sql,Microsoft.StorageandMicrosoft.Web.
- resource
Group stringName The name of the resource group in which to create the subnet. Changing this forces a new resource to be created.
- virtual
Network stringName The name of the virtual network to which to attach the subnet. Changing this forces a new resource to be created.
- address
Prefix string The address prefix to use for the subnet.
- address
Prefixes string[] The address prefixes to use for the subnet.
- delegations
Subnet
Delegation[] One or more
delegationblocks as defined below.- enforce
Private booleanLink Endpoint Network Policies Enable or Disable network policies for the private link endpoint on the subnet. Default value is
false. Conflicts with enforce_private_link_service_network_policies.- enforce
Private booleanLink Service Network Policies Enable or Disable network policies for the private link service on the subnet. Default valule is
false. Conflicts withenforce_private_link_endpoint_network_policies.- name string
The name of the subnet. Changing this forces a new resource to be created.
- service
Endpoints string[] The list of Service endpoints to associate with the subnet. Possible values include:
Microsoft.AzureActiveDirectory,Microsoft.AzureCosmosDB,Microsoft.ContainerRegistry,Microsoft.EventHub,Microsoft.KeyVault,Microsoft.ServiceBus,Microsoft.Sql,Microsoft.StorageandMicrosoft.Web.
- resource_
group_ strname The name of the resource group in which to create the subnet. Changing this forces a new resource to be created.
- virtual_
network_ strname The name of the virtual network to which to attach the subnet. Changing this forces a new resource to be created.
- address_
prefix str The address prefix to use for the subnet.
- address_
prefixes List[str] The address prefixes to use for the subnet.
- delegations
List[Subnet
Delegation] One or more
delegationblocks as defined below.- enforce_
private_ boollink_ endpoint_ network_ policies Enable or Disable network policies for the private link endpoint on the subnet. Default value is
false. Conflicts with enforce_private_link_service_network_policies.- enforce_
private_ boollink_ service_ network_ policies Enable or Disable network policies for the private link service on the subnet. Default valule is
false. Conflicts withenforce_private_link_endpoint_network_policies.- name str
The name of the subnet. Changing this forces a new resource to be created.
- service_
endpoints List[str] The list of Service endpoints to associate with the subnet. Possible values include:
Microsoft.AzureActiveDirectory,Microsoft.AzureCosmosDB,Microsoft.ContainerRegistry,Microsoft.EventHub,Microsoft.KeyVault,Microsoft.ServiceBus,Microsoft.Sql,Microsoft.StorageandMicrosoft.Web.
Outputs
All input properties are implicitly available as output properties. Additionally, the Subnet resource produces the following output properties:
Look up an 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): Subnetstatic get(resource_name, id, opts=None, address_prefix=None, address_prefixes=None, delegations=None, enforce_private_link_endpoint_network_policies=None, enforce_private_link_service_network_policies=None, name=None, resource_group_name=None, service_endpoints=None, virtual_network_name=None, __props__=None);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)- 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.
The following state arguments are supported:
- Address
Prefix string The address prefix to use for the subnet.
- Address
Prefixes List<string> The address prefixes to use for the subnet.
- Delegations
List<Subnet
Delegation Args> One or more
delegationblocks as defined below.- Enforce
Private boolLink Endpoint Network Policies Enable or Disable network policies for the private link endpoint on the subnet. Default value is
false. Conflicts with enforce_private_link_service_network_policies.- Enforce
Private boolLink Service Network Policies Enable or Disable network policies for the private link service on the subnet. Default valule is
false. Conflicts withenforce_private_link_endpoint_network_policies.- Name string
The name of the subnet. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the resource group in which to create the subnet. Changing this forces a new resource to be created.
- Service
Endpoints List<string> The list of Service endpoints to associate with the subnet. Possible values include:
Microsoft.AzureActiveDirectory,Microsoft.AzureCosmosDB,Microsoft.ContainerRegistry,Microsoft.EventHub,Microsoft.KeyVault,Microsoft.ServiceBus,Microsoft.Sql,Microsoft.StorageandMicrosoft.Web.- Virtual
Network stringName The name of the virtual network to which to attach the subnet. Changing this forces a new resource to be created.
- Address
Prefix string The address prefix to use for the subnet.
- Address
Prefixes []string The address prefixes to use for the subnet.
- Delegations
[]Subnet
Delegation One or more
delegationblocks as defined below.- Enforce
Private boolLink Endpoint Network Policies Enable or Disable network policies for the private link endpoint on the subnet. Default value is
false. Conflicts with enforce_private_link_service_network_policies.- Enforce
Private boolLink Service Network Policies Enable or Disable network policies for the private link service on the subnet. Default valule is
false. Conflicts withenforce_private_link_endpoint_network_policies.- Name string
The name of the subnet. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the resource group in which to create the subnet. Changing this forces a new resource to be created.
- Service
Endpoints []string The list of Service endpoints to associate with the subnet. Possible values include:
Microsoft.AzureActiveDirectory,Microsoft.AzureCosmosDB,Microsoft.ContainerRegistry,Microsoft.EventHub,Microsoft.KeyVault,Microsoft.ServiceBus,Microsoft.Sql,Microsoft.StorageandMicrosoft.Web.- Virtual
Network stringName The name of the virtual network to which to attach the subnet. Changing this forces a new resource to be created.
- address
Prefix string The address prefix to use for the subnet.
- address
Prefixes string[] The address prefixes to use for the subnet.
- delegations
Subnet
Delegation[] One or more
delegationblocks as defined below.- enforce
Private booleanLink Endpoint Network Policies Enable or Disable network policies for the private link endpoint on the subnet. Default value is
false. Conflicts with enforce_private_link_service_network_policies.- enforce
Private booleanLink Service Network Policies Enable or Disable network policies for the private link service on the subnet. Default valule is
false. Conflicts withenforce_private_link_endpoint_network_policies.- name string
The name of the subnet. Changing this forces a new resource to be created.
- resource
Group stringName The name of the resource group in which to create the subnet. Changing this forces a new resource to be created.
- service
Endpoints string[] The list of Service endpoints to associate with the subnet. Possible values include:
Microsoft.AzureActiveDirectory,Microsoft.AzureCosmosDB,Microsoft.ContainerRegistry,Microsoft.EventHub,Microsoft.KeyVault,Microsoft.ServiceBus,Microsoft.Sql,Microsoft.StorageandMicrosoft.Web.- virtual
Network stringName The name of the virtual network to which to attach the subnet. Changing this forces a new resource to be created.
- address_
prefix str The address prefix to use for the subnet.
- address_
prefixes List[str] The address prefixes to use for the subnet.
- delegations
List[Subnet
Delegation] One or more
delegationblocks as defined below.- enforce_
private_ boollink_ endpoint_ network_ policies Enable or Disable network policies for the private link endpoint on the subnet. Default value is
false. Conflicts with enforce_private_link_service_network_policies.- enforce_
private_ boollink_ service_ network_ policies Enable or Disable network policies for the private link service on the subnet. Default valule is
false. Conflicts withenforce_private_link_endpoint_network_policies.- name str
The name of the subnet. Changing this forces a new resource to be created.
- resource_
group_ strname The name of the resource group in which to create the subnet. Changing this forces a new resource to be created.
- service_
endpoints List[str] The list of Service endpoints to associate with the subnet. Possible values include:
Microsoft.AzureActiveDirectory,Microsoft.AzureCosmosDB,Microsoft.ContainerRegistry,Microsoft.EventHub,Microsoft.KeyVault,Microsoft.ServiceBus,Microsoft.Sql,Microsoft.StorageandMicrosoft.Web.- virtual_
network_ strname The name of the virtual network to which to attach the subnet. Changing this forces a new resource to be created.
Supporting Types
SubnetDelegation
- Name string
A name for this delegation.
- Service
Delegation SubnetDelegation Service Delegation Args A
service_delegationblock as defined below.
- Name string
A name for this delegation.
- Service
Delegation SubnetDelegation Service Delegation A
service_delegationblock as defined below.
- name string
A name for this delegation.
- service
Delegation SubnetDelegation Service Delegation A
service_delegationblock as defined below.
- name str
A name for this delegation.
- service
Delegation Dict[SubnetDelegation Service Delegation] A
service_delegationblock as defined below.
SubnetDelegationServiceDelegation
- Name string
The name of service to delegate to. Possible values include
Microsoft.BareMetal/AzureVMware,Microsoft.BareMetal/CrayServers,Microsoft.Batch/batchAccounts,Microsoft.ContainerInstance/containerGroups,Microsoft.Databricks/workspaces,Microsoft.DBforPostgreSQL/serversv2,Microsoft.HardwareSecurityModules/dedicatedHSMs,Microsoft.Logic/integrationServiceEnvironments,Microsoft.Netapp/volumes,Microsoft.ServiceFabricMesh/networks,Microsoft.Sql/managedInstances,Microsoft.Sql/servers,Microsoft.StreamAnalytics/streamingJobs,Microsoft.Web/hostingEnvironmentsandMicrosoft.Web/serverFarms.- Actions List<string>
A list of Actions which should be delegated. This list is specific to the service to delegate to. Possible values include
Microsoft.Network/networkinterfaces/*,Microsoft.Network/virtualNetworks/subnets/action,Microsoft.Network/virtualNetworks/subnets/join/action,Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/actionandMicrosoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action.
- Name string
The name of service to delegate to. Possible values include
Microsoft.BareMetal/AzureVMware,Microsoft.BareMetal/CrayServers,Microsoft.Batch/batchAccounts,Microsoft.ContainerInstance/containerGroups,Microsoft.Databricks/workspaces,Microsoft.DBforPostgreSQL/serversv2,Microsoft.HardwareSecurityModules/dedicatedHSMs,Microsoft.Logic/integrationServiceEnvironments,Microsoft.Netapp/volumes,Microsoft.ServiceFabricMesh/networks,Microsoft.Sql/managedInstances,Microsoft.Sql/servers,Microsoft.StreamAnalytics/streamingJobs,Microsoft.Web/hostingEnvironmentsandMicrosoft.Web/serverFarms.- Actions []string
A list of Actions which should be delegated. This list is specific to the service to delegate to. Possible values include
Microsoft.Network/networkinterfaces/*,Microsoft.Network/virtualNetworks/subnets/action,Microsoft.Network/virtualNetworks/subnets/join/action,Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/actionandMicrosoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action.
- name string
The name of service to delegate to. Possible values include
Microsoft.BareMetal/AzureVMware,Microsoft.BareMetal/CrayServers,Microsoft.Batch/batchAccounts,Microsoft.ContainerInstance/containerGroups,Microsoft.Databricks/workspaces,Microsoft.DBforPostgreSQL/serversv2,Microsoft.HardwareSecurityModules/dedicatedHSMs,Microsoft.Logic/integrationServiceEnvironments,Microsoft.Netapp/volumes,Microsoft.ServiceFabricMesh/networks,Microsoft.Sql/managedInstances,Microsoft.Sql/servers,Microsoft.StreamAnalytics/streamingJobs,Microsoft.Web/hostingEnvironmentsandMicrosoft.Web/serverFarms.- actions string[]
A list of Actions which should be delegated. This list is specific to the service to delegate to. Possible values include
Microsoft.Network/networkinterfaces/*,Microsoft.Network/virtualNetworks/subnets/action,Microsoft.Network/virtualNetworks/subnets/join/action,Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/actionandMicrosoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action.
- name str
The name of service to delegate to. Possible values include
Microsoft.BareMetal/AzureVMware,Microsoft.BareMetal/CrayServers,Microsoft.Batch/batchAccounts,Microsoft.ContainerInstance/containerGroups,Microsoft.Databricks/workspaces,Microsoft.DBforPostgreSQL/serversv2,Microsoft.HardwareSecurityModules/dedicatedHSMs,Microsoft.Logic/integrationServiceEnvironments,Microsoft.Netapp/volumes,Microsoft.ServiceFabricMesh/networks,Microsoft.Sql/managedInstances,Microsoft.Sql/servers,Microsoft.StreamAnalytics/streamingJobs,Microsoft.Web/hostingEnvironmentsandMicrosoft.Web/serverFarms.- actions List[str]
A list of Actions which should be delegated. This list is specific to the service to delegate to. Possible values include
Microsoft.Network/networkinterfaces/*,Microsoft.Network/virtualNetworks/subnets/action,Microsoft.Network/virtualNetworks/subnets/join/action,Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/actionandMicrosoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.