Skip to content

docs: interaction between instances and reserved ip #371

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

Merged

Conversation

muse-sisay
Copy link
Contributor

When using civo_instance_reserved_ip_assignment resource to assign a reserved IP address to a civo_instance subsequent resources are not able to use it’s public_ip attribute, because it is empty.

For example, the following Terraform code snippet creates a reserved ip and an instance, and using civo_instance_reserved_ip_assignment resource assign the public IP to the instance. Resources that relay on instance public ip attribute, such as outputting instance IP address, fail. This PR adds a disclaimer and alternative solution.

resource "civo_reserved_ip" "this" {
...
}

resource "civo_instance" "this" {
...
}

resource "civo_instance_reserved_ip_assignment" "webserver-www" {
  instance_id    = civo_instance.this.id
  reserved_ip_id = civo_reserved_ip.this.id
}

output "public_ip_reservation" {
  value = civo_instance.this.ip
} 

@alessandroargentieri alessandroargentieri merged commit 11707cd into civo:master Mar 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants