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
terraform-provider-azurerm fails to identify dependencies #2629
Comments
hey @juanjojulian Thanks for opening this issue :) Terraform infers the dependencies between resources in one of two ways - ether using an Implicit Dependency or using an Explicit Dependency. We'd recommend using an Implicit Dependency where possible - which is where you use the Interpolation Syntax to reference between resources, for example: resource "azurerm_resource_group" "main" {
name = "example-resource-group"
location = "West Europe"
}
resource "azurerm_public_ip" "main" {
name = "my-example-public-ip"
location = "${azurerm_resource_group.main.location}"
resource_group_name = "${azurerm_resource_group.main.name}"
public_ip_address_allocation = "Dynamic"
} The other approach would be to use an Explicit Dependency which can be achieved using the Would you be able to take a look and see if using an Implicit Dependency works for you? Since this is a question about Terraform Configuration rather than a bug in Terraform, I'm going to close this issue for the moment (but we'll continue responding 😄) Thanks! |
Thanks Tom, I will try using interpolation syntax :-) |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Community Note
Terraform (and AzureRM Provider) Version
Terraform v0.11.11
Affected Resource(s)
*azurerm_public_ip
*azurerm_resource_group
Terraform Configuration Files
Expected Behavior
Terraform should understand that the resource group should be created prior to attempting the public ip creation.
Actual Behavior
###NOTE
This problem is solved using depends_on = ["azurerm_resource_group.main"] but as per Terraform documentation this should not be necessary as Terraform should solve all dependencies.
The text was updated successfully, but these errors were encountered: