Kubernetes and docker registry's resources created in the wrong project

Hello there!

I’m currently working on a project in which my goal is to setup a kubernetes cluster, https termination, domain, docker registry and database, all using Terraform and Azure Pipelines.

I’ve got everything working and it’s pretty neat, the only obstacle I’m facing is that I find it hard to get my docker registry’s spaces object and my loadbalancer (created by an Ingress controller) to be placed inside of the correct DO project. They are placed in my default project instead of the project that I want them to be in together with the other resources.

I’ve already attempted to get the loadbalancer in my project by adding do:kubernetes:${} to my project’s resources. This does not seem to throw any errors, but the expected resources are still not showing up in my special project.

Is it possible to somehow predict the URN of the resource like do:loadbalancer:<predict this?>? Or does my k8s cluster perhaps contain the ID of the loadbalancer somewhere in its settings?

I understand that I might be talking to the wrong people here and I should be talking to the maintainers of the Terraform DO provider, but I just wanted to be sure and pose the question here as well.

TL;DR: How do I get my k8s-created loadbalancer and docker-registry’s spaces resource to show up in the correct DO project if I can’t predict/trace their name?

Yours sincerely,



Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Update: I’ve managed to get the loadbalancer ID by looking in the ingress’ metadata (data.kubernetes_service.ingress_service.metadata[0].annotations[“”]) so I could form the URN like do:loadbalancer:<id>.

Are there easier options to accomplish this?