Skip to content

Commit

Permalink
Subnet: documenting that both fields are required for the moment
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Oct 13, 2018
1 parent c8fc44d commit b4f271f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 0 additions & 2 deletions azurerm/resource_arm_subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@ func resourceArmSubnet() *schema.Resource {
"network_security_group_id": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Deprecated: "Use the `azurerm_subnet_network_security_group_association` resource instead.",
},

"route_table_id": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Deprecated: "Use the `azurerm_subnet_route_table_association` resource instead.",
},

Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/subnet.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ The following arguments are supported:

* `network_security_group_id` - (Optional / **Deprecated**) The ID of the Network Security Group to associate with the subnet.

-> **NOTE:** Subnet <-> Network Security Group associations can be configured either using this field (which is now Deprecated) - or by using the `azurerm_subnet_network_security_group_association` resource - however not both. As this field is now Deprecated, we recommend using the `azurerm_subnet_network_security_group_association` to configure this association going forward.
-> **NOTE:** At this time Subnet <-> Network Security Group associations need to be configured both using this field (which is now Deprecated) and/or using the `azurerm_subnet_network_security_group_association` resource. This field field is deprecated and will be removed in favour of that resource in the next major version (2.0) of the AzureRM Provider.

* `route_table_id` - (Optional / **Deprecated**) The ID of the Route Table to associate with the subnet.

-> **NOTE:** Subnet <-> Route Table associations can be configured either using this field (which is now Deprecated) - or by using the `azurerm_subnet_route_table_association` resource - however not both. As this field is now Deprecated, we recommend using the `azurerm_subnet_route_table_association` to configure this association going forward.
-> **NOTE:** At this time Subnet <-> Route Table associations need to be configured both using this field (which is now Deprecated) and/or using the `azurerm_subnet_route_table_association` resource. This field is deprecated and will be removed in favour of that resource in the next major version (2.0) of the AzureRM Provider.

* `service_endpoints` - (Optional) The list of Service endpoints to associate with the subnet. Possible values include: `Microsoft.Storage`, `Microsoft.Sql`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: |-

Associates a [Network Security Group](network_security_group.html) with a [Subnet](subnet.html) within a [Virtual Network](virtual_network.html).

-> **NOTE:** Subnet <-> Network Security Group associations can be configured either using this resource, or by using the `network_security_group_id` field within the `azurerm_subnet` resource - however not both. The `network_security_group_id` field within the `azurerm_subnet` resource is Deprecated - and we recommend using this resource going forward.
-> **NOTE:** Subnet <-> Network Security Group associations currently need to be configured on both this resource and using the `network_security_group_id` field on the `azurerm_subnet` resource. The next major version of the AzureRM Provider (2.0) will remove the `network_security_group_id` field from the `azurerm_subnet` resource such that this resource is used to link resources in future.

## Example Usage

Expand All @@ -29,10 +29,11 @@ resource "azurerm_virtual_network" "test" {
}
resource "azurerm_subnet" "test" {
name = "frontend"
resource_group_name = "${azurerm_resource_group.test.name}"
virtual_network_name = "${azurerm_virtual_network.test.name}"
address_prefix = "10.0.2.0/24"
name = "frontend"
resource_group_name = "${azurerm_resource_group.test.name}"
virtual_network_name = "${azurerm_virtual_network.test.name}"
address_prefix = "10.0.2.0/24"
network_security_group_id = "${azurerm_network_security_group.test.id}"
}
resource "azurerm_network_security_group" "test" {
Expand Down
3 changes: 2 additions & 1 deletion website/docs/r/subnet_route_table_association.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: |-

Associates a [Route Table](route_table.html) with a [Subnet](subnet.html) within a [Virtual Network](virtual_network.html).

-> **NOTE:** Subnet <-> Route Table associations can be configured either using this resource, or by using the `route_table_id` field within the `azurerm_subnet` resource - however not both. The `route_table_id` field within the `azurerm_subnet` resource is Deprecated - and we recommend using this resource going forward.
-> **NOTE:** Subnet <-> Route Table associations currently need to be configured on both this resource and using the `route_table_id` field on the `azurerm_subnet` resource. The next major version of the AzureRM Provider (2.0) will remove the `route_table_id` field from the `azurerm_subnet` resource such that this resource is used to link resources in future.

## Example Usage

Expand All @@ -33,6 +33,7 @@ resource "azurerm_subnet" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
virtual_network_name = "${azurerm_virtual_network.test.name}"
address_prefix = "10.0.2.0/24"
route_table_id = "${azurerm_route_table.test.id}"
}
resource "azurerm_route_table" "test" {
Expand Down

0 comments on commit b4f271f

Please sign in to comment.