diff --git a/external_actions.tf b/external_actions.tf index 94c1669..ae62523 100644 --- a/external_actions.tf +++ b/external_actions.tf @@ -1,26 +1,26 @@ -module github_script { - source = "HappyPathway/gh-actions/importer" - version = "0.0.15" - git_repo_url = "https://github.com/actions/github-script.git" +module "github_script" { + source = "HappyPathway/gh-actions/importer" + version = "0.0.15" + git_repo_url = "https://github.com/actions/github-script.git" git_repo_path = "/home/a/arnol377/git/gh-actions-github-script" - repo_name = "gh-actions-github-script" - repo_org = "CSVD" + repo_name = "gh-actions-github-script" + repo_org = "CSVD" } -module github_checkout { - source = "HappyPathway/gh-actions/importer" - version = "0.0.15" - git_repo_url = "https://github.com/actions/checkout.git" +module "github_checkout" { + source = "HappyPathway/gh-actions/importer" + version = "0.0.15" + git_repo_url = "https://github.com/actions/checkout.git" git_repo_path = "/home/a/arnol377/git/gh-actions-checkout" - repo_name = "gh-actions-checkout" - repo_org = "CSVD" + repo_name = "gh-actions-checkout" + repo_org = "CSVD" } -module setup_python { - source = "HappyPathway/gh-actions/importer" - version = "0.0.15" - git_repo_url = "https://github.com/actions/setup-python.git" +module "setup_python" { + source = "HappyPathway/gh-actions/importer" + version = "0.0.15" + git_repo_url = "https://github.com/actions/setup-python.git" git_repo_path = "/home/a/arnol377/git/gh-actions-setup-python" - repo_name = "gh-actions-setup-python" - repo_org = "CSVD" + repo_name = "gh-actions-setup-python" + repo_org = "CSVD" } diff --git a/main.tf b/main.tf index 1389279..3a030d4 100644 --- a/main.tf +++ b/main.tf @@ -1,13 +1,13 @@ locals { - pipeline_repos = [ + pipeline_repos = [ "aws-image-pipeline", "linux-image-pipeline", "windows-image-pipeline", "image-pipeline-goss-testing", "image-pipeline-ansible-playbooks", ] - workspace_repos = [ + workspace_repos = [ "automation-repos", "ghe-runners" ] @@ -16,65 +16,65 @@ locals { local.workspace_repos ) secrets = [ - "AWS_SECRET_ACCESS_KEY", - "AWS_SESSION_TOKEN", - "AWS_ACCESS_KEY_ID", - "GITHUB_TOKEN" + "AWS_SECRET_ACCESS_KEY", + "AWS_SESSION_TOKEN", + "AWS_ACCESS_KEY_ID", + "GITHUB_TOKEN" ] } module "runner" { - source = "HappyPathway/runner/ghe" + source = "HappyPathway/runner/ghe" github_base_url = "https://github.e.it.census.gov" github_owner = "CSVD" runner_basedir = "/apps/terraform/workspaces/arnol377/git/ghe-runner" runner_tarball = "/apps/terraform/workspaces/arnol377/actions-runner-linux-x64-2.304.0.tar.gz" - repos = local.pipeline_repos + repos = local.pipeline_repos runner_labels = [ "image-pipeline" ] } module "tf_workspace_runners" { - source = "HappyPathway/runner/ghe" + source = "HappyPathway/runner/ghe" github_base_url = "https://github.e.it.census.gov" github_owner = "CSVD" runner_basedir = "/apps/terraform/workspaces/arnol377/git/ghe-runner" runner_tarball = "/apps/terraform/workspaces/arnol377/actions-runner-linux-x64-2.304.0.tar.gz" - repos = local.workspace_repos + repos = local.workspace_repos runner_labels = [ "terraform-workspaces" ] } -module env_var { - source = "HappyPathway/var/env" +module "env_var" { + source = "HappyPathway/var/env" for_each = toset(local.secrets) - env_var = each.value + env_var = each.value } -module repo_secrets { - source = "HappyPathway/vars/repo" +module "repo_secrets" { + source = "HappyPathway/vars/repo" for_each = toset(local.all_repos) repo = { name = each.value } secrets = [ - for secret in [for secret in local.secrets : secret if secret != "AWS_ACCESS_KEY_ID"]: - { - name = replace(secret, "GITHUB", "GH") - value = lookup(module.env_var, secret).value - } + for secret in [for secret in local.secrets : secret if secret != "AWS_ACCESS_KEY_ID"] : + { + name = replace(secret, "GITHUB", "GH") + value = lookup(module.env_var, secret).value + } ] vars = [ { - name = "AWS_ACCESS_KEY_ID" - value = lookup(module.env_var, "AWS_ACCESS_KEY_ID").value + name = "AWS_ACCESS_KEY_ID" + value = lookup(module.env_var, "AWS_ACCESS_KEY_ID").value } ] - + } -output secrets { +output "secrets" { value = module.env_var }