Closed nprime496 closed 4 months ago
Hey @nprime496
You'll want to use the repository_id
, instead of the id
attribute, of the artifact registry resource.
data "google_artifact_registry_docker_image" "my_image" {
location = google_artifact_registry_repository.my_repo.location
repository_id = google_artifact_registry_repository.my_repo.repository_id
image = "demo"
}
Thanks!
The documentation is misleading then.
The example usage is
data "google_artifact_registry_docker_image" "my_image" {
repository = google_artifact_registry_repository.my_repo.id
image = "my-image"
tag = "my-tag"
}
when it should be
data "google_artifact_registry_docker_image" "my_image" {
repository_id = google_artifact_registry_repository.my_repo.repository_id
image_name = "my-image"
tag = "my-tag"
}
Yes, the docs have already been updated in https://github.com/hashicorp/terraform-provider-google/pull/18541
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Question
Hi, I am following the documentation on Google Clood Artifact Registry and can't find what is the syntax for the attribute
image_name
(here is the attribute description).The example in documentation seems wrong as it use the
name
attribute and I tried this format (just the name/tag of my image), it doesn't work. My image exists, yet I get an error. Find it below.Can you please tell me how to write
image_name
if this is the cause of all this.Here is my code:
Here is the traceback of my error:
Note: I notice that there seems to be a semantically broken url in the error :
/v1/projects/<project-id>/locations/<region>/repositories/projects/<project-id>/locations/<location>/repositories/repository/dockerImages?alt=json&orderBy=update_time+desc