diff --git a/image-pipeline.tf b/image-pipeline.tf index d5b890c..9c5f549 100644 --- a/image-pipeline.tf +++ b/image-pipeline.tf @@ -9,25 +9,30 @@ locals { moved { from = module.linux_image_pipeline - to = module.image_pipeline["linux-image-pipeline"] + to = module.image_pipeline_repos["linux-image-pipeline"] } moved { from = module.win_image_pipeline - to = module.image_pipeline["windows-image-pipeline"] + to = module.image_pipeline_repos["windows-image-pipeline"] } moved { from = module.goss-testing - to = module.image_pipeline["image-pipeline-goss-testing"] + to = module.image_pipeline_repos["image-pipeline-goss-testing"] } moved { from = module.image_pipeline_ansible_playbooks - to = module.image_pipeline["image-pipeline-ansible-playbooks"] + to = module.image_pipeline_repos["image-pipeline-ansible-playbooks"] } -module "image_pipeline" { +moved { + from = module.image_pipeline + to = module.aws_image_pipeline +} + +module "image_pipeline_repos" { for_each = toset(local.pipeline_repos) source = "git@github.e.it.census.gov:CSVD/terraform-github-repo" #github_codeowners_team = "CSVD" @@ -45,9 +50,9 @@ module "image_pipeline" { pull_request_bypassers = local.pull_request_bypassers extra_files = [ { - path = ".github/workflows/s3_upload.yml" + path = ".github/workflows/s3_upload.yaml" content = templatefile( - "${path.module}/workflow.yaml.tpl", + "${path.module}/workflows/s3_upload.yaml.tpl", { repo_name = each.value } @@ -75,7 +80,7 @@ module "asset_releases" { } # image-pipeline -module "image_pipeline" { +module "aws_image_pipeline" { source = "git@github.e.it.census.gov:CSVD/terraform-github-repo" #github_codeowners_team = "CSVD" github_repo_description = "Terraform Workspace for creating and managing AWS Image Pipelines" @@ -90,4 +95,15 @@ module "image_pipeline" { collaborators = local.collaborators admin_teams = [github_team.team.name] pull_request_bypassers = local.pull_request_bypassers + extra_files = [ + { + path = ".github/workflows/terraform-plan.yaml" + content = templatefile( + "${path.module}/workflows/terraform-plan.yaml.tpl", + { + repo_name = "aws-image-pipeline" + } + ) + } + ] } \ No newline at end of file diff --git a/workflow.yaml.tpl b/workflows/s3_upload.yaml.tpl similarity index 100% rename from workflow.yaml.tpl rename to workflows/s3_upload.yaml.tpl diff --git a/terraform-apply.yaml.tpl b/workflows/terraform-apply.yaml.tpl similarity index 100% rename from terraform-apply.yaml.tpl rename to workflows/terraform-apply.yaml.tpl diff --git a/terraform-plan.yaml.tpl b/workflows/terraform-plan.yaml.tpl similarity index 100% rename from terraform-plan.yaml.tpl rename to workflows/terraform-plan.yaml.tpl