When creating an IONOS Cloud Container Registry using the Terraform provider, the hostname attribute is not available. This causes issues with configurations that depend on the hostname attribute being available immediately after the resource is created.
Expected behavior
The Terraform provider should only consider the ionoscloud_container_registry as created if it is actually available and ready to use (not in the 'WaitingForStorage' state anymore) and all its attributes are set.
Environment
Terraform version:
1.5.7
Provider version:
v6.4.18
OS:
Alpine Linux v3.18 (Terraform's official Docker image https://hub.docker.com/r/hashicorp/terraform)
terraform init && terraform plan && terraform apply -auto-approve
Immediately try to access the hostname attribute of the container registry.
Error and Debug Output
terraform apply output (note that the hostname value is an empty string):
<skipped for brevity>
Plan: 2 to add, 0 to change, 0 to destroy.
ionoscloud_container_registry.registry: Creating...
ionoscloud_container_registry.registry: Creation complete after 7s [id=f14425ec-071e-440b-b60a-f8ea965e37e2]
data.ionoscloud_container_registry.registry: Reading...
data.ionoscloud_container_registry.registry: Read complete after 2s [id=f14425ec-071e-440b-b60a-f8ea965e37e2]
null_resource.test: Creating...
null_resource.test: Provisioning with 'local-exec'...
null_resource.test (local-exec): Executing: ["/bin/sh" "-c" "echo container registry hostname: ''"]
null_resource.test (local-exec): container registry hostname:
null_resource.test: Creation complete after 0s [id=1638570349943663561]
<skipped for brevity>
Accessing the state:
$ terraform state show ionoscloud_container_registry.registry
# ionoscloud_container_registry.registry:
resource "ionoscloud_container_registry" "registry" {
id = "a92abcee-4265-4b3d-afd3-1cdd4ac6aa7d"
location = "de/fra"
name = "cr-bug-report"
storage_usage = [
{
bytes = 0
updated_at = ""
},
]
features {
vulnerability_scanning = false
}
garbage_collection_schedule {
days = [
"Monday",
]
time = "06:00:00+00:00"
}
}
$ terraform state show data.ionoscloud_container_registry.registry
# data.ionoscloud_container_registry.registry:
data "ionoscloud_container_registry" "registry" {
features = [
{
vulnerability_scanning = false
},
]
garbage_collection_schedule = [
{
days = [
"Monday",
]
time = "06:00:00+00:00"
},
]
id = "a92abcee-4265-4b3d-afd3-1cdd4ac6aa7d"
location = "de/fra"
name = "cr-bug-report"
partial_match = false
storage_usage = [
{
bytes = 0
updated_at = ""
},
]
}
Additional Notes
I am fully aware that this is an eventual consistency error, but I believe it is better for the Terraform provider to ensure that created resources are actually ready to use before considering them as created. This would help prevent issues with dependent resources and provisioners that rely on the resource being fully available and all its attributes being set.
Description
When creating an IONOS Cloud Container Registry using the Terraform provider, the
hostname
attribute is not available. This causes issues with configurations that depend on thehostname
attribute being available immediately after the resource is created.Expected behavior
The Terraform provider should only consider the
ionoscloud_container_registry
as created if it is actually available and ready to use (not in the 'WaitingForStorage' state anymore) and all its attributes are set.Environment
Terraform version:
Provider version:
OS:
Configuration Files
How to Reproduce
terraform init && terraform plan && terraform apply -auto-approve
Error and Debug Output
terraform apply
output (note that the hostname value is an empty string):Accessing the state:
Additional Notes
I am fully aware that this is an eventual consistency error, but I believe it is better for the Terraform provider to ensure that created resources are actually ready to use before considering them as created. This would help prevent issues with dependent resources and provisioners that rely on the resource being fully available and all its attributes being set.