This document describes the AWS Organizations structure used by GistPin to isolate workloads, enforce security guardrails, and consolidate billing.
gistpin-org (Management Account)
├── security/ — Security tooling, GuardDuty, SecurityHub, audit
├── logging/ — Centralized CloudTrail, Config, log archival
├── shared-services/ — Shared tooling, Cost Explorer, image registry
└── workloads/
├── dev/ — Development and feature branches
├── staging/ — Pre-production validation
└── prod/ — Production traffic
| Account | Purpose | Key Services |
|---|---|---|
| Management | Billing, IAM, org admin | Organizations, Billing |
| Security | Centralized security | GuardDuty, SecurityHub, IAM Access Analyzer |
| Logging | Audit trail retention | CloudTrail, Config, S3 log archival |
| Shared Services | Common tooling | ECR, Cost Explorer, SSO |
| Dev | Active development | Full dev stack per workspace |
| Staging | Pre-production | Mirror of prod, scaled down |
| Prod | Live traffic | Full production stack |
The following SCPs are attached to enforce organization-wide guardrails:
| Policy | Description | Attached To |
|---|---|---|
GistPinDenyRootUser |
Block root user access in member accounts | Root |
GistPinDenyLeaveOrg |
Prevent accounts from leaving the organization | Root |
GistPinEnforceIMDSv2 |
Require IMDSv2 on all EC2 instances | Root |
GistPinEnforceEncryption |
Require KMS encryption for S3/EBS | Root |
GistPinRestrictRegions |
Limit workloads to approved regions | Workloads OU |
| Region | Purpose |
|---|---|
us-east-1 |
Primary — global services, CloudFront |
us-west-2 |
DR / West Coast latency |
eu-west-1 |
EU data residency |
Cross-account access uses IAM roles with the following pattern:
- Organization Access Role — Assumed by the management account for administrative tasks
- Security Audit Role — Assumed by the security account with
SecurityAuditpolicy - External ID — Required for cross-account AssumeRole to prevent confused-deputy attacks
New accounts are provisioned via Terraform (aws-org.tf). To add a new environment:
- Add the account email to
var.environment_accountsinterraform.tfvars - Map it to the correct OU in the
lookup()block inaws_organizations_account.environment - Run
terraform planandterraform apply
terraform plan -var-file="env/prod.tfvars"
- Consolidated billing is enabled at the organization level
- Cost allocation tags (
Project: gistpin,ManagedBy: terraform) are applied to all resources - The shared-services account has Cost Explorer admin access
- Budget alerts are routed to the
#gistpin-costsSlack channel viabudget-alerts.yml
When a security finding is detected:
- GuardDuty events flow from all accounts to the security account
- SecurityHub aggregates findings centrally
- Alerts route through
audit-alerts.ymlandguardduty-alerts.yml - The security team assumes the
OrganizationAccessRoleinto affected accounts - Findings are logged to the logging account's CloudTrail
- Create a new account entry in
var.environment_accounts - Select the parent OU (
dev,staging, orprod) - The cross-account role is automatically created
- SCPs are inherited from the OU and root targets
- Run
terraform applyto provision
| File | Contents |
|---|---|
aws-org.tf |
Organization, OUs, member accounts, cross-account roles |
org-policies.tf |
SCPs for security guardrails and region restrictions |