diff --git a/CHANGELOG.md b/CHANGELOG.md index be235d8..ed70f00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,12 @@ Following semver, any non backwards compatible feature implies that the next rel ## [Unreleased] +## [0.6.0] - 2024-10-09 + +[Compare with previous version](https://github.com/sparkfabrik/terraform-google-gcp-artifact-registry/compare/0.5.0...0.6.0) + +- FEATURE: add support for mirror public registry (Docker Hub) if `custom_repository_uri` is `DOCKER_HUB` + ## [0.5.0] - 2024-08-29 [Compare with previous version](https://github.com/sparkfabrik/terraform-google-gcp-artifact-registry/compare/0.4.0...0.5.0) diff --git a/main.tf b/main.tf index 9de5388..37c7ad6 100644 --- a/main.tf +++ b/main.tf @@ -90,9 +90,19 @@ resource "google_artifact_registry_repository" "repositories" { content { description = remote_repository_config.value.description == "" ? each.value.description : remote_repository_config.value.description - docker_repository { - custom_repository { - uri = remote_repository_config.value.custom_repository_uri + dynamic "docker_repository" { + for_each = remote_repository_config.value.custom_repository_uri != "DOCKER_HUB" ? [remote_repository_config.value] : [] + content { + custom_repository { + uri = remote_repository_config.value.custom_repository_uri + } + } + } + + dynamic "docker_repository" { + for_each = remote_repository_config.value.custom_repository_uri == "DOCKER_HUB" ? [remote_repository_config.value] : [] + content { + public_repository = "DOCKER_HUB" } }