Skip to content
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

[Docs]: import existing repos #83

Open
felipecruz91 opened this issue Jan 31, 2025 · 2 comments
Open

[Docs]: import existing repos #83

felipecruz91 opened this issue Jan 31, 2025 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@felipecruz91
Copy link

Documentation Link

https://github.com/docker/terraform-provider-docker/blob/main/README.md

Description

👋 I'm looking into managing Hub repositories using the terraform-provider-docker. Is it possible to import existing repos into my TF state? I haven't found that mentioned in the docs.

References

No response

Would you like to implement a fix?

None

@felipecruz91 felipecruz91 added the documentation Improvements or additions to documentation label Jan 31, 2025
@ryanhristovski
Copy link
Member

Hello again @felipecruz91 🙂

Yes, you can import existing repositories with the provider. Here's an example of how that would look:

resource "docker_hub_repository" "docker-repo" {
  name = "docker-repo"
  namespace = "docker-namespace"
}

terraform import docker_hub_repository.docker-repo docker-namespace/docker-repo


Looks like its missing in the docs, so I'll be using this ticket for tracking the work to update all imports. Thanks for opening the issue!

@felipecruz91
Copy link
Author

That's great news, thank you @ryanhristovski!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants