Data Source: azurermSubnet
Use this data source to access information about an existing Subnet within a Virtual Network.
Example Usage
import * as cdktf from "cdktf";
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const dataAzurermSubnetExample =
new azurerm.dataAzurermSubnet.DataAzurermSubnet(this, "example", {
name: "backend",
resource_group_name: "networking",
virtual_network_name: "production",
});
new cdktf.TerraformOutput(this, "subnet_id", {
value: dataAzurermSubnetExample.id,
});
Argument Reference
name
- Specifies the name of the Subnet.virtualNetworkName
- Specifies the name of the Virtual Network this Subnet is located within.resourceGroupName
- Specifies the name of the resource group the Virtual Network is located in.
Attributes Reference
id
- The ID of the Subnet.addressPrefixes
- The address prefixes for the subnet.networkSecurityGroupId
- The ID of the Network Security Group associated with the subnet.routeTableId
- The ID of the Route Table associated with this subnet.serviceEndpoints
- A list of Service Endpoints within this subnet.privateEndpointNetworkPoliciesEnabled
- Enable or Disable network policies for the private endpoint on the subnet.privateLinkServiceNetworkPoliciesEnabled
- Enable or Disable network policies for the private link service on the subnet.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
read
- (Defaults to 5 minutes) Used when retrieving the Subnet located within a Virtual Network.