digitalocean / terraform-provider-digitalocean

Terraform DigitalOcean provider
https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs
Mozilla Public License 2.0
509 stars 278 forks source link

Missing `URN` attribute in `digitalocean_container_registry` #1238

Open adam-kulagowski opened 1 month ago

adam-kulagowski commented 1 month ago

Is your feature request related to a problem? Please describe.

I'm trying to attach Container registry to my project using OpenTofu. However it looks like that digitalocean_project_resources requires URN id in order to attach it to selected project.

In terms of code:

# Create docker registry
resource "digitalocean_container_registry" "XXX_registry" {
  name                   = "XXX-registry"
  subscription_tier_slug = "basic"
}

# Assign registry to XXX project
resource "digitalocean_project_resources" "registry" {
  project = digitalocean_project.XXX.id
  resources = [ digitalocean_container_registry.XXX_registry.urn ]
}

Which ends up w/ error that there is no URN attribute for digitalocean_container_registry and quick documentation search confirms it.

Describe the solution you'd like

digitalocean_container_registry should have URN attribute as other Digital Ocean resources.

Describe alternatives you've considered

In terms of TF: None as my TF skills are pretty limited :) Others: Using UI which suggests that Container Registry cannot by assigned to a project?

Additional context

I'm using 2.42.0 release I would be happy with any TF workaround.

andrewsomething commented 1 month ago

Others: Using UI which suggests that Container Registry cannot by assigned to a project?

That's correct. This is currently a product limitation. A Container Registry cannot be assigned to a project at this time. When that changes, we'll be sure to support it here in Terraform.

adam-kulagowski commented 1 month ago

Ah, that explains it. Thanks for the clarification :)