> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trulyagentic.io/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS & GCP Terraform Starters

> Customer-owned VPC, KMS key custody, write-only WORM audit buckets, and least-privilege IAM modules.

[`deploy/terraform/aws/`](https://github.com/trulyagentic/truly-agentic-governance-kit/tree/main/deploy/terraform/aws) and [`deploy/terraform/gcp/`](https://github.com/trulyagentic/truly-agentic-governance-kit/tree/main/deploy/terraform/gcp) provide transparent starting modules designed for CloudSec and IAM architecture review.

> [!NOTE]
>
> Review and adapt CIDR blocks, VPC IDs, retention periods, and organization policies with your internal CloudSec team before running `terraform apply`.

## CloudSec IAM Least-Privilege Checklist

When auditing `aws/main.tf` and `gcp/main.tf`, reviewers verify four non-negotiable guarantees:

1. **Zero wildcard admin grants:** Neither starter includes `AdministratorAccess`, `iam:*`, `*:*`, or broad `s3:*` / `storage.*` permissions.
2. **Write-only WORM audit storage:**
   * **AWS (`aws/main.tf`):** `aws_s3_bucket.audit_worm` enables `object_lock_enabled = true` (`GOVERNANCE` default retention) with public access fully blocked and KMS SSE. `aws_iam_role.agent_runtime` receives strictly `s3:PutObject` (`AuditWormPutOnly`) — **no** `s3:DeleteObject` or retention override permissions.
   * **GCP (`gcp/main.tf`):** `google_storage_bucket.audit_worm` sets `uniform_bucket_level_access = true` and a `retention_policy`. `google_service_account.agent_runtime` receives strictly `roles/storage.objectCreator`.
3. **Scoped KMS & secret access:** AWS ECS execution role (`ecs-tasks.amazonaws.com`) and GCP service account access only the single project KMS key (90-day / annual auto-rotation) and specific gateway secret resource (`aws_secretsmanager_secret.gateway_env` / `google_secret_manager_secret.gateway_env`).
4. **Private network isolation:** `aws_security_group.private_gateway` permits outbound HTTPS (`443`) to VPC endpoints and approved gateways with zero inbound rules declared.

## AWS vs. GCP Terraform Resource Mapping

| Capability | AWS (`deploy/terraform/aws/main.tf`) | GCP (`deploy/terraform/gcp/main.tf`) |
| - | - | - |
| **Customer-Managed KMS** | `aws_kms_key.byoc_cmk` (`enable_key_rotation = true`) | `google_kms_crypto_key.byoc_cmk` (`7776000s` 90-day rotation) |
| **Secrets Vault** | `aws_secretsmanager_secret.gateway_env` | `google_secret_manager_secret.gateway_env` |
| **WORM Audit Sink** | `aws_s3_bucket.audit_worm` + `aws_s3_bucket_object_lock_configuration` | `google_storage_bucket.audit_worm` (`retention_policy`) |
| **Compute Identity** | `aws_iam_role.agent_runtime` + `aws_ecs_cluster.byoc` | `google_service_account.agent_runtime` |
| **Private Model Access** | `bedrock:InvokeModel` / `InvokeModelWithResponseStream` | `roles/aiplatform.user` (Vertex AI) |

## Supply Chain & CI Hygiene

* Public Governance Kit GitHub Actions pin exact commit SHAs (`ci.yml`) with minimal `contents: read` permissions and frozen `pnpm-lock.yaml`.
* Customer CI/CD pipelines can layer container digest pinning (`image@sha256:...`) and CycloneDX SBOM generation before promotion.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.