diff --git a/.gitignore b/.gitignore index 2b2cdd2..de2b79d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -# vim swap files **/*.sw[po] # don't commit terraform state or lock. the repo code is the only state we care about. @@ -6,13 +5,10 @@ **/.terraform.lock.hcl **/.terraform -# IDE Folders **/.vscode -# Mac Finder cache **/.DS_Store -# Plan output plan-output.txt # Generated pre-commit configuration diff --git a/AGENTS.md b/AGENTS.md index 8f12d98..7273b28 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -44,3 +44,12 @@ have changed. Re-run `make test` to refresh it and run the checks. - `images` - Contains tfroot-runner image and canonical pre-commit config - `shared-workflows` - Contains the reusable OpenTofu workflow + +## Import ID Formats + +Use the provider's resource-specific ID format when adopting existing GitHub +objects: + +- repositories: `` +- `main` branch protections: `:main` +- Actions secrets: `/` diff --git a/gh-iam.tf b/gh-iam.tf index 5f1c7be..122b5e6 100644 --- a/gh-iam.tf +++ b/gh-iam.tf @@ -3,7 +3,6 @@ resource "github_membership" "admin" { role = "admin" } -# Teams for ArgoCD RBAC integration resource "github_team" "admins" { name = "admins" description = "ArgoCD administrators" @@ -16,7 +15,6 @@ resource "github_team" "developers" { privacy = "closed" } -# Team memberships resource "github_team_membership" "admins_xnoto" { team_id = github_team.admins.id username = "xnoto" diff --git a/gh-protections.tf b/gh-protections.tf index 50d2ade..e3d4b7e 100644 --- a/gh-protections.tf +++ b/gh-protections.tf @@ -1,11 +1,3 @@ -/* -import { - for_each = local.github_repositories - to = github_branch_protection.protections[each.key] - id = "${each.key}:main" -} -*/ - resource "github_branch_protection" "protections" { for_each = toset([for repo in local.github_repositories : repo if !contains(local.archived_github_repositories, repo)]) repository_id = github_repository.repositories[each.key].node_id diff --git a/gh-repositories.tf b/gh-repositories.tf index 822b902..a33c0d8 100644 --- a/gh-repositories.tf +++ b/gh-repositories.tf @@ -1,11 +1,3 @@ -/* -import { - for_each = local.github_repositories - to = github_repository.repositories[each.key] - id = each.key -} -*/ - resource "github_repository" "repositories" { for_each = local.github_repositories name = each.key diff --git a/gh-secrets.tf b/gh-secrets.tf index af96242..921268e 100644 --- a/gh-secrets.tf +++ b/gh-secrets.tf @@ -11,14 +11,6 @@ locals { ]) } -/* -import { - for_each = { for pair in local.secret_repo_pairs : "${pair.repository}_${pair.name}" => pair } - to = github_actions_secret.secrets["${each.value.repository}_${each.value.name}"] - id = "${each.value.repository}/${each.value.name}" -} -*/ - resource "github_actions_secret" "secrets" { for_each = { for pair in local.secret_repo_pairs : "${pair.repository}_${pair.name}" => pair } repository = each.value.repository diff --git a/opencode.json b/opencode.json index 5289d54..f7777ca 100644 --- a/opencode.json +++ b/opencode.json @@ -16,6 +16,7 @@ "aws-prod": {"enabled": false}, "grafana": {"enabled": false}, "terraform-docs": {"enabled": false}, + "argocd-makeitwork": {"enabled": true}, "argocd-staging-eks": {"enabled": false}, "argocd-prod-eks": {"enabled": false} }, @@ -30,6 +31,7 @@ "aws-prod_*": false, "grafana_*": false, "terraform-docs_*": false, + "argocd-makeitwork_*": true, "argocd-staging-eks_*": false, "argocd-prod-eks_*": false }