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

Refs platform/#3202 #14

Merged
merged 10 commits into from
Oct 17, 2024
Prev Previous commit
Next Next commit
refs platform/#3202: remove unnecessary locals and data
  • Loading branch information
Stevesibilia committed Oct 16, 2024
commit 6b08b9ff4a2285cec4ae537e60ae3876154dbdb5
21 changes: 1 addition & 20 deletions main.tf
Original file line number Diff line number Diff line change
@@ -33,31 +33,12 @@ locals {
}
}
custom_role_artifact_registry_lister_id = "projects/${var.project_id}/roles/${var.artifact_registry_listers_custom_role_name}"
remote_repositories = {
for repository_id, repository in var.repositories : repository_id => {
repository_id = repository_id
username_password_credentials_username = lookup(repository.remote_repository_config_docker, "username_password_credentials_username", "")
username_password_credentials_password_secret_name = lookup(repository.remote_repository_config_docker, "username_password_credentials_password_secret_name", "")
username_password_credentials_password_secret_version = lookup(repository.remote_repository_config_docker, "username_password_credentials_password_secret_version", "latest")
}
if repository.mode == "REMOTE_REPOSITORY"
}
}

data "google_project" "project" {
project_id = var.project_id
}

data "google_secret_manager_secret_version" "remote_repository_secrets" {
for_each = {
for key, value in local.remote_repositories : key => value
if alltrue([value.username_password_credentials_username != "", value.username_password_credentials_password_secret_name != ""])
}

project = var.project_id
secret = each.value.username_password_credentials_password_secret_name
version = each.value.username_password_credentials_password_secret_version
}

resource "google_artifact_registry_repository" "repositories" {
for_each = var.repositories

Loading