Skip to content

feat: bootstrap OpenTofu root - #1

Merged
xnoto merged 5 commits into
mainfrom
bootstrap/opentofu-root
Sep 3, 2026
Merged

feat: bootstrap OpenTofu root#1
xnoto merged 5 commits into
mainfrom
bootstrap/opentofu-root

Conversation

@xnoto

@xnoto xnoto commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Bootstrap tfroot-twilio as a no-resource OpenTofu root. It evaluates the pinned RJPearson94/twilio 0.27.1 provider, adds the shared OpenTofu caller, and documents the future SOPS/backend and least-privilege credential gates.

The PR also seeds the two exact tfroot-github-generated Dependabot files through the required pull-request path. This resolves the existing direct-commit/branch-protection conflict without changing protection rules or assigning downstream ownership.

The bootstrap deliberately omits an S3 backend because its Makefile initializes with -backend=false; a permanent encrypted backend remains a follow-up prerequisite before Twilio resources can be managed.

Fixes # N/A — owner-approved Twilio root bootstrap and centralized Dependabot delivery repair.

Type of change

  • Bug fix
  • Feature / enhancement
  • Documentation
  • Infrastructure (OpenTofu root or module)
  • GitOps desired state (manifests, kustomize, charts, SOPS/KSOPS secrets)
  • Container image
  • CI / reusable workflow
  • Refactor / cleanup
  • Breaking change

Validation

  • Required pull-request checks pass — OpenTofu test and no-resource plan succeeded in run 33818165420.
  • Plan reports no changes; there are no provider configurations, data sources, or Twilio resources.
  • Generated or centrally distributed files were regenerated by their owning automation, not hand-edited — the two generated files are an exact PR-based seed from tfroot-github/gh-dependabot.tf; central ownership remains unchanged and will adopt them after merge.

The exact repository-scoped GitHub OIDC subject was validated through the separately applied tfroot-aws PR #40. No local OpenTofu, SOPS, state, import, plan, or apply operations were run. Registry review verified RJPearson94/twilio 0.27.1 supports phone-number and inbound messaging-webhook fields; the bootstrap intentionally has no provider configuration or Twilio resources.

Impact and rollout

Producer/consumer chain: images/tfroot-runner supplies the canonical CI toolchain, shared-workflows supplies the reusable OpenTofu workflow, tfroot-twilio becomes the future Twilio phone/webhook owner, and tfroot-github remains the sole long-term owner of the seeded Dependabot files.

Merging will submit the environment-gated main workflow. This bootstrap's apply has no provider-side effect because there are no configured providers, data sources, or resources. A later reviewed change must first establish encrypted backend and credential-delivery inputs with least privilege before managing Twilio inventory. Twilio provisioning and webhook changes remain separately confirmation-gated.

Rollback is a normal revert of this bootstrap PR. Do not manually edit the seeded Dependabot files after merge.

Safety and secrets

  • Contains no plaintext secrets, decrypted SOPS values, state files, kubeconfigs, tokens, or private endpoints.
  • No local OpenTofu init/plan/apply/destroy/import/state operations were run or claimed — plans come from pull-request checks.
  • Breaking or irreversible effects are described above with rollback notes.

Repository-side secret scanning is unavailable because GitHub Advanced Security is not enabled; the committed diff was manually inspected before publication.

AI agent materially produced this change; reviewers should confirm the retained no-resource bootstrap boundary and central generated-file ownership.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

OpenTofu Test

OpenTofu test passed.

View the workflow run.

View run output
Terraform validate.......................................................Passed
Terraform validate with tflint...........................................Passed
Checkov..................................................................Passed
Terraform fmt............................................................Passed
Terraform docs...........................................................Passed
Detect hardcoded secrets.................................................Passed
check for case conflicts.................................................Passed
check for merge conflicts................................................Passed
check for broken symlinks............................(no files to check)Skipped
check vcs permalinks.....................................................Passed
detect destroyed symlinks................................................Passed
detect private key.......................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
don't commit to branch..................................................Skipped
check for added large files..............................................Passed

xnoto added a commit to makeitworkcloud/tfroot-aws that referenced this pull request Sep 3, 2026
## Summary

Replace the just-applied human-readable `tfroot-twilio` trust pattern
with the exact organization/repository-ID subject emitted by its GitHub
Actions OIDC token:
`repo:makeitworkcloud@195502628/tfroot-twilio@1356437102:pull_request`.

The repository's bootstrap plan still fails because the subject format
differs from the older roots. A temporary, secret-free diagnostic job
emitted only this non-sensitive claim; it is removed from the
Twilio-root branch before merge.

Fixes # N/A — restore the intended single-repository KMS OIDC trust
boundary.

## Type of change

- [x] Bug fix
- [ ] Feature / enhancement
- [ ] Documentation
- [x] Infrastructure (OpenTofu root or module)
- [ ] GitOps desired state (manifests, kustomize, charts, SOPS/KSOPS
secrets)
- [ ] Container image
- [ ] CI / reusable workflow
- [ ] Refactor / cleanup
- [ ] Breaking change

## Validation

- [x] Required pull-request checks pass — OpenTofu test and plan
succeeded.
- [x] OpenTofu plan changes only `github-actions-sops-kms`: `0 to add, 1
to change, 0 to destroy`.
- [x] Generated or centrally distributed files were regenerated by their
owning automation, not hand-edited — none are changed.

The failed revalidation in [`tfroot-twilio` PR
#1](makeitworkcloud/tfroot-twilio#1) established
that the initial subject pattern does not match. Its temporary
diagnostic job emitted the exact repository-scoped subject without
exposing a token. No local OpenTofu, SOPS, state, import, plan, or apply
operations were run.

## Impact and rollout

Producer: `tfroot-aws` owns the `github-actions-sops-kms` trust policy.

Consumer: only `tfroot-twilio` is affected. This replaces one
repository-scoped subject expression with the exact
repository-ID-qualified expression; it does not add repositories, widen
permissions, grant S3 state access, or grant Twilio API access. After a
confirmed merge and successful environment-gated apply, rerun the
no-resource Twilio-root plan. Its merge remains separately
confirmation-gated.

Rollback is a reviewed revert of this one subject expression. Do not use
an organization wildcard.

## Safety and secrets

- [x] Contains no plaintext secrets, decrypted SOPS values, state files,
kubeconfigs, tokens, or private endpoints.
- [x] No local OpenTofu init/plan/apply/destroy/import/state operations
were run or claimed — plans come from pull-request checks.
- [x] Breaking or irreversible effects are described above with rollback
notes.

AI agent materially produced this change; reviewers should confirm the
exact claim evidence, no added repository scope, and retained KMS-only
permission boundary.
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

OpenTofu Plan

OpenTofu plan passed.

View the workflow run.

View run output
No changes. Your infrastructure matches the configuration.

OpenTofu has compared your real infrastructure against your configuration and

@xnoto
xnoto merged commit 315acbf into main Sep 3, 2026
3 checks passed
@xnoto
xnoto deleted the bootstrap/opentofu-root branch September 3, 2026 23:50
xnoto added a commit to makeitworkcloud/tfroot-github that referenced this pull request Sep 4, 2026
## Summary

Import the two Dependabot files that [`tfroot-twilio` PR
#1](makeitworkcloud/tfroot-twilio#1) seeded
through the required pull-request path. This lets their canonical
`tfroot-github` resources adopt existing files instead of attempting
protected direct creation.

The import reports inherited commit metadata and a create-only setting
that would otherwise cause a protected-branch file update. The two
resource definitions therefore ignore only `commit_message` and
`overwrite_on_create`; their centrally managed file content remains
enforced.

Fixes # N/A — repair the failed central Dependabot adoption path.

## Type of change

- [x] Bug fix
- [ ] Feature / enhancement
- [ ] Documentation
- [x] Infrastructure (OpenTofu root or module)
- [ ] GitOps desired state (manifests, kustomize, charts, SOPS/KSOPS
secrets)
- [ ] Container image
- [ ] CI / reusable workflow
- [ ] Refactor / cleanup
- [ ] Breaking change

## Validation

- [x] Required pull-request checks pass — OpenTofu test and plan
succeeded in [run
33819976668](https://github.com/makeitworkcloud/tfroot-github/actions/runs/33819976668).
- [x] Plan is exactly `2 to import, 0 to add, 0 to change, 0 to
destroy`.
- [x] Generated or centrally distributed files were regenerated by their
owning automation, not hand-edited — the files were exact PR seeds and
retain `tfroot-github` as their canonical owner.

The provider's documented import IDs use `repository:file-path:branch`,
with an empty branch for the default branch. No local OpenTofu, SOPS,
state, import, plan, or apply operations were run.

## Impact and rollout

Producer: `tfroot-github` owns both generated files and their resource
state. Consumer: `tfroot-twilio` now contains the exact seeded files on
`main` at
[`315acbf8`](makeitworkcloud/tfroot-twilio@315acbf).

The previous main apply attempted direct creation before the files
existed and failed on repository protection. This PR imports only
`.github/dependabot.yml` and `.github/workflows/dependabot-notify.yml`
into their existing central resources. Its validated plan neither writes
a file nor changes repository protection, Actions secrets, Twilio
configuration, or any GitOps/runtime system. After a confirmed merge,
verify the environment-gated apply succeeds and records the two imports.

Rollback is a reviewed revert of these import declarations. Do not
manually edit the managed target files.

## Safety and secrets

- [x] Contains no plaintext secrets, decrypted SOPS values, state files,
kubeconfigs, tokens, or private endpoints.
- [x] No local OpenTofu init/plan/apply/destroy/import/state operations
were run or claimed — plans come from pull-request checks.
- [x] Breaking or irreversible effects are described above with rollback
notes.

Repository-side secret scanning is unavailable because GitHub Advanced
Security is not enabled; the diff was manually inspected before
publication.

AI agent materially produced this change; reviewers should confirm the
documented import IDs, exact resource addresses, metadata-only lifecycle
exclusions, and retained central ownership.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant