Skip to content

Commit

Permalink
Rename attribute, update test
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaweitao001 committed Jun 25, 2024
1 parent 2d79a25 commit bf51116
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func resourceArmDevTestVirtualNetwork() *pluginsdk.Resource {
ValidateFunc: validate.DevTestVirtualNetworkUsagePermissionType(),
},

"shared_public_ip_address_configuration": {
"shared_public_ip_address": {
Type: pluginsdk.TypeList,
Optional: true,
MaxItems: 1,
Expand Down Expand Up @@ -336,7 +336,7 @@ func expandDevTestVirtualNetworkSubnets(input []interface{}, subscriptionId, res

for _, val := range input {
v := val.(map[string]interface{})
sharedPublicIpAddressConfiguration := expandDevTestVirtualNetworkSubnetIpAddressConfiguration(v["shared_public_ip_address_configuration"].([]interface{}))
sharedPublicIpAddressConfiguration := expandDevTestVirtualNetworkSubnetIpAddressConfiguration(v["shared_public_ip_address"].([]interface{}))

subnet := virtualnetworks.SubnetOverride{
ResourceId: pointer.To(subnetId.ID()),
Expand Down Expand Up @@ -396,7 +396,7 @@ func flattenDevTestVirtualNetworkSubnets(input *[]virtualnetworks.SubnetOverride
}
output["use_public_ip_address"] = v.UsePublicIPAddressPermission
output["use_in_virtual_machine_creation"] = v.UseInVMCreationPermission
output["shared_public_ip_address_configuration"] = flattenDevTestVirtualNetworkSubnetIpAddressConfiguration(v.SharedPublicIPAddressConfiguration)
output["shared_public_ip_address"] = flattenDevTestVirtualNetworkSubnetIpAddressConfiguration(v.SharedPublicIPAddressConfiguration)

outputs = append(outputs, output)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,15 @@ resource "azurerm_dev_test_virtual_network" "test" {
subnet {
use_public_ip_address = "Deny"
use_in_virtual_machine_creation = "Allow"
shared_public_ip_address_configuration {
shared_public_ip_address {
allowed_ports {
backend_port = 22
transport_protocol = "Tcp"
}
allowed_ports {
backend_port = 80
transport_protocol = "Tcp"
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/dev_test_virtual_network.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ A `subnet` block supports the following:

* `use_in_virtual_machine_creation` - (Optional) Can this subnet be used for creating Virtual Machines? Possible values are `Allow`, `Default` and `Deny`. Defaults to `Allow`.

* `shared_public_ip_address_configuration` - (Optional) A `shared_public_ip_address_configuration` block as defined below.
* `shared_public_ip_address` - (Optional) A `shared_public_ip_address` block as defined below.

---

A `shared_public_ip_address_configuration` block supports the following:
A `shared_public_ip_address` block supports the following:

* `allowed_ports` - (Optional) A list of `allowed_ports` blocks as defined below.

Expand Down

0 comments on commit bf51116

Please sign in to comment.