You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resource"equinix_metal_device""test" {
# ... other device settings
metro ="any"
}
Debug Output
No response
Panic Output
No response
Expected Behavior
The device should be created successfully, and a subsequent terraform plan should not show any changes
Actual Behavior
The device is created successfully, but terraform plan always wants to delete and recreate the device because the config value any does not match the actual metro in which the device was deployed (e.g., sv)
Steps to Reproduce
Configure an equinix_metal_device resource with metro = "any"
Run terraform plan
Run terraform apply
Run terraform plan again and see that the device will be recreated
The text was updated successfully, but these errors were encountered:
To avoid deleting and recreating a device created with metro = "any", you can tell terraform to ignore changes to the metro attribute:
resource"equinix_metal_device""test" {
# ... other device settings
metro ="any"lifecycle {
ignore_changes = ["metro"]
}
}
If you need to reference the actual metro in which the device was created (for example, you want to create the device in any metro and then create a VLAN in the same metro), you can use an equinix_metal_device datasource to determine the deployed metro:
resource"equinix_metal_device""test" {
# ... other device settings
metro ="any"lifecycle {
ignore_changes = ["metro"]
}
}
data"equinix_metal_device""test" {
id = equinix_metal_device.test.id
}
resource"equinix_metal_vlan""test" {
metro =data.equinix_metal_device.test.metro
}
Terraform Version
Terraform v1.5.7 on darwin_arm64
Equinix Provider Version
version = "1.32.0"
Affected Terraform Resources
equinix_metal_device
Terraform Config Files
Debug Output
No response
Panic Output
No response
Expected Behavior
The device should be created successfully, and a subsequent
terraform plan
should not show any changesActual Behavior
The device is created successfully, but
terraform plan
always wants to delete and recreate the device because the config valueany
does not match the actual metro in which the device was deployed (e.g.,sv
)Steps to Reproduce
equinix_metal_device
resource withmetro = "any"
terraform plan
terraform apply
terraform plan
again and see that the device will be recreatedThe text was updated successfully, but these errors were encountered: