/iac-github-mgmt

Manages Github resources - Repo managed by Terraform repo iac-github-mgmt (Github)

Primary LanguageHCL

terraform-github-mgmt

Terraform Configuration Run

Manages my personal Github resources.

Entrypoint for Github.

Secrets

Two secrets must be set in the repository:

  • GH_API_TOKEN
  • TF_API_TOKEN

Importing

Github:

  1. repo: terraform import 'module.misc_project_repos["my-repo"].github_repository.repo' my-repo
  2. branch default terraform import 'module.misc_project_repos["my-repo"].github_branch_default.default' my-repo

TODO

After migration back to github on 9/24/22, re-add github workflow.

Moving to new module

# Diehlabs ONLY
terraform state mv 'module.misc_project_repos_diehlabs["pre-commit-hooks"].data.github_branch.main' 'module.diehlabs_repos.module.repos["repo_0001"].data.github_branch.main' &&\
terraform state mv 'module.misc_project_repos_diehlabs["pre-commit-hooks"].github_branch_default.default' 'module.diehlabs_repos.module.repos["repo_0001"].github_branch_default.default' &&\
terraform state mv 'module.misc_project_repos_diehlabs["pre-commit-hooks"].github_repository.repo' 'module.diehlabs_repos.module.repos["repo_0001"].github_repository.repo'

# CultClassik ONLY
terraform state mv 'module.misc_project_repos["kubernetes-my-way"].data.github_branch.main' 'module.cultclassik_repos.module.repos["repo_0003"].data.github_branch.main' &&\
terraform state mv 'module.misc_project_repos["kubernetes-my-way"].github_branch_default.default' 'module.cultclassik_repos.module.repos["repo_0003"].github_branch_default.default' &&\
terraform state mv 'module.misc_project_repos["kubernetes-my-way"].github_repository.repo' 'module.cultclassik_repos.module.repos["repo_0003"].github_repository.repo'

Requirements

Name Version
terraform >= 1.0.0
github ~> 4.24.0
tfe ~> 0.28.0
vault ~> 3.3.0

Providers

Name Version
github 4.24.1
github.diehlabs 4.24.1
terraform n/a
tfe 0.28.1
vault 3.3.1

Modules

Name Source Version
ansible_control git::https://github.com/Diehlabs/terraform-github-repo.git tags/v0.0.2
ansible_roles git::https://github.com/Diehlabs/terraform-github-repo.git tags/v0.0.2
diehlabs_ansible_roles git::https://github.com/Diehlabs/terraform-github-repo.git tags/v0.0.2
diehlabs_azdo_terraform_pipeline_templates git::https://github.com/Diehlabs/terraform-github-repo.git tags/v0.0.2
diehlabs_iac_repos git::https://github.com/Diehlabs/terraform-github-repo.git tags/v0.0.2
diehlabs_terraform_module_repos git::https://github.com/Diehlabs/terraform-github-repo.git tags/v0.0.2
github_action_templates git::https://github.com/Diehlabs/terraform-github-repo.git tags/v0.0.2
github_workflow_templates git::https://github.com/Diehlabs/terraform-github-repo.git tags/v0.0.2
iac_repos git::https://github.com/Diehlabs/terraform-github-repo.git tags/v0.0.2
misc_project_repos git::https://github.com/Diehlabs/terraform-github-repo.git tags/v0.0.2
misc_project_repos_diehlabs git::https://github.com/Diehlabs/terraform-github-repo.git tags/v0.0.2
terraform_module_repo_template git::https://github.com/Diehlabs/terraform-github-repo.git tags/v0.0.2

Resources

Name Type
github_actions_organization_secret.gh_arm_client_id resource
github_actions_organization_secret.gh_arm_client_secret resource
github_actions_organization_secret.gh_arm_sub_id resource
github_actions_organization_secret.gh_arm_tenant_id resource
github_user_ssh_key.ssh_key_cultclassik resource
tfe_workspace.iac_ws resource
terraform_remote_state.vault_mgmt data source
vault_generic_secret.github_token data source
vault_generic_secret.spn_terraform data source
vault_generic_secret.ssh data source
vault_generic_secret.tfe_tokens data source

Inputs

Name Description Type Default Required
repo_name The name on this Git repo. Used in descriptions of managed resources. string n/a yes

Outputs

No outputs.