Bug Report
The digitalocean_container_registry data source doesn't work as expected since the provider version 2.71.0
Describe the bug
Since the provider version 2.71.0 all the attributes of the digitalocean_container_registry data source have null instead of relevant values.
Conditional usage of digitalocean_container_registry resource and data source(s) in the TF stack is crucial for the multi-workspace setups, when the registry is managed in one Terraform workspace, and all other workspaces rely on the same data from the data source.
Affected Resource(s)
digitalocean_container_registry data source
Expected Behavior
The data source fetches registry data by name and stores the state. Expected output from the console:
> data.digitalocean_container_registry.registry
{
"created_at" = "2026-05-13 09:33:40 +0000 UTC"
"endpoint" = "registry.digitalocean.com/my-registry"
"id" = "my-registry"
"name" = "my-registry"
"region" = "fra1"
"server_url" = "registry.digitalocean.com"
"storage_usage_bytes" = 0
"subscription_tier_slug" = "basic"
}
>
Actual Behavior
All the attributes are null. Output from the console
> data.digitalocean_container_registry.registry
{
"created_at" = tostring(null)
"endpoint" = tostring(null)
"id" = tostring(null)
"name" = tostring(null)
"region" = tostring(null)
"server_url" = tostring(null)
"storage_usage_bytes" = tonumber(null)
"subscription_tier_slug" = tostring(null)
}
>
Steps to Reproduce
- Define the
digitalocean_container_registry data source
- Apply the code
Terraform Configuration Files
data "digitalocean_container_registry" "registry" {
name = "my-registry"
}
output "registry" {
value = data.digitalocean_container_registry.registry
}
DigitalOcean Terraform Provider version
2.71.0
2.73.0
2.75.0
2.80.0
2.81.0
2.84.0
2.85.1
Terraform version
Debug Output
Panic Output
Additional context
The same TF code but with older provider versions fetches data. Works with provider versions:
2.16.0
2.34.0
2.43.0
2.50.0
2.70.0
Important Factoids
It looks like the content of the name argument is required by the data source validation, but actually doesn't have any effect. For example, with any of the mentioned provider versions, the data source result is always the same with any straight value (string, boolean, or number), supplied instead of the actual created registry name.
For the checked versions from 2.16.0 to 2.70.0 the result shows data about the existing registry, even if the name argument supplies an irrelevant value.
For the checked versions from 2.71.0 to 2.85.1 the result shows all attributes as null, even if the name argument supplies an irrelevant value.
But, the data source documentation states that the error should be triggered:
An error is triggered if the provided container registry name does not exist.
One more interesting point. There is an available digitalocean_container_registries data source for the 2.85.1 provider version. But it's not stated in the provider documentation. The only available argument is name, which also allows any straight input, and the result also contains null for all attributes.
Terraform code:
data "digitalocean_container_registries" "registries" {
name = "all"
}
output "registries" {
value = data.digitalocean_container_registries.registries
}
Console output:
> data.digitalocean_container_registries.registries
{
"created_at" = tostring(null)
"endpoint" = tostring(null)
"id" = tostring(null)
"name" = tostring(null)
"region" = tostring(null)
"server_url" = tostring(null)
"storage_usage_bytes" = tonumber(null)
"subscription_tier_slug" = tostring(null)
}
>
References
Bug Report
The
digitalocean_container_registrydata source doesn't work as expected since the provider version2.71.0Describe the bug
Since the provider version
2.71.0all the attributes of thedigitalocean_container_registrydata source havenullinstead of relevant values.Conditional usage of
digitalocean_container_registryresource and data source(s) in the TF stack is crucial for the multi-workspace setups, when the registry is managed in one Terraform workspace, and all other workspaces rely on the same data from the data source.Affected Resource(s)
digitalocean_container_registrydata sourceExpected Behavior
The data source fetches registry data by name and stores the state. Expected output from the console:
Actual Behavior
All the attributes are
null. Output from the consoleSteps to Reproduce
digitalocean_container_registrydata sourceTerraform Configuration Files
DigitalOcean Terraform Provider version
2.71.02.73.02.75.02.80.02.81.02.84.02.85.1Terraform version
1.11.41.15.3Debug Output
Panic Output
Additional context
The same TF code but with older provider versions fetches data. Works with provider versions:
2.16.02.34.02.43.02.50.02.70.0Important Factoids
It looks like the content of the
nameargument is required by the data source validation, but actually doesn't have any effect. For example, with any of the mentioned provider versions, the data source result is always the same with any straight value (string, boolean, or number), supplied instead of the actual created registry name.For the checked versions from
2.16.0to2.70.0the result shows data about the existing registry, even if thenameargument supplies an irrelevant value.For the checked versions from
2.71.0to2.85.1the result shows all attributes asnull, even if thenameargument supplies an irrelevant value.But, the data source documentation states that the error should be triggered:
One more interesting point. There is an available
digitalocean_container_registriesdata source for the2.85.1provider version. But it's not stated in the provider documentation. The only available argument isname, which also allows any straight input, and the result also containsnullfor all attributes.Terraform code:
Console output:
References
digitalocean_container_registrydata source