Open arLevi opened 1 year ago
For now, what we're done is basically saying "if Terraform didn't create the resource - i won't be able to destroy" - so we're creating the resources vs using the parameters, but that could have saved many lines of code:
# Replacing this
route_table_association_enabled = true
route_table_propagation_enabled = true
# With this:
resource "alicloud_cen_transit_router_route_table_association" "related_vpc" { ... }
resource "alicloud_cen_transit_router_route_table_propagation" "related_vpc" { ... }
resource "alicloud_cen_transit_router_route_table_association" "related_peer" { ... }
resource "alicloud_cen_transit_router_route_table_propagation" "related_peer" { ... }
Can you please fix it ? when wanting to destroy a CEN - it should destroy automatically everything related to the CEN ( including transit routers, router associations etc ... )
Terraform Version
Affected Resource(s)
CEN / VPC
Terraform Configuration Files
Debug Output
https://gist.github.com/arLevi/91c0371dde2edaecb189c98b6b67c41e
Expected Behavior
I expect that
terraform destroy
will deassociate and unattache the routing tables before trying to remove the transit-routers. Or a way to tell terraform to run X tasks before the actualdestroy
begins.Actual Behavior
Receiving errors with the debug messages inside the gist link. it cannot destroy the CEN while the TR associate & propagate exists.
Steps to Reproduce
terraform apply
- this should work just fineterraform destroy
you should see the error.Thanks