-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provider/azurerm: Fixes for azurerm subnet properties #8791
Conversation
I think the fact that network_security_group_id and route_table_id are computed resources is relevant. I don't completely understand the use of 'computed' in the schema, but when I compile without it, I get the correct behaviour. It's perfectly reasonable to create route tables and NSGs and not link them with any subnets. |
So I think that 'computed' in the resource schema does not match the actual relationship of subnet to route_table_id and network_security_group_id. A Route Table is not created when a Subnet is created, and neither is any relationship established. The linkage is manual and depends on the Route Table being created and it's ID provided to the subnet. |
de73f01
to
a92cb7a
Compare
This is ready for review. Fully fixes GH-8227 and route_table_id &network_security_group_id associations in the azurerm subnet resource. There will be an impact on those who have manually set route table or NSG associations and do not have a corresponding entry in the subnet resource. Previously during the plan it will ignore route table or NSG associations and leave real-life associations. The new behaviour will remove any existing associations if route_table_id and network_security_group_id are ommitted or set to "". |
a0257c1
to
aa66a31
Compare
cc90cbc
to
79c425e
Compare
Added TestAccAzureRMSubnet_update() to show the problem with removing route table and NSG associations on the subnet. |
Computed attributed does not describe the relationship between subnet and route tables or NSGs. They are independent resources linked together. This is show by setting route_table_id to empty and you will see the the route_table_id is not removed but left at whatever value is present. Care should be taken with existing resources as the behaviour that relies of subnets ignoring route table and NSG associations will no longer work.
79c425e
to
0f7c189
Compare
@stack72 Can someone review this / advise on next steps please? It's been hanging around for a while. |
I think it will need another look due to the recent merge of #9646 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Partially fixes GH-8227
So far this implements the setting of address range, route table association and network security group association for azurerm subnet resource.
There is still failure when going from a set resource to none for route tables and nsg, e.g.
to