Open EugZol opened 2 years ago
I had to work around this by adding the association back into the config after the first run. This is far from ideal however
resource "oci_core_public_ip" "ip" {
compartment_id = local.compartment_ocid
display_name = "${var.name}-public-ip"
lifetime = "RESERVED"
private_ip_id = "ocid1.privateip.oc1.uk-london-1.abw...kya" # manually inserted after creation to stop tf trying to delete it. https://github.com/oracle/terraform-provider-oci/issues/1708
lifecycle {
prevent_destroy = true
}
}
Thank you for reporting the issue. We have raised an internal ticket to track this. Our service engineers will get back to you.
Community Note
Terraform Version and Provider Version
Affected Resource(s)
oci_core_public_ip
Terraform Configuration Files
Debug Output
First
terraform apply
: https://gist.github.com/EugZol/cf694a8ae3987ebf79017cdb535db851 Secondterraform apply
: https://gist.github.com/EugZol/6c861244f1c9dffb3633dbe8dcc11256Expected Behavior
Terraform doesn't try to unassign private IP from public IP resource.
Actual Behavior
Terraform does try to unassign private IP from public IP resource, when the same configuration is applied second (and subsequent) time.
Steps to Reproduce
terraform apply
terraform apply