{"id":35828846,"url":"https://github.com/hops-ops/aws-account","last_synced_at":"2026-04-28T07:01:24.413Z","repository":{"id":326004288,"uuid":"1101741136","full_name":"hops-ops/aws-account","owner":"hops-ops","description":"AWS Account XRD","archived":false,"fork":false,"pushed_at":"2026-03-24T05:36:14.000Z","size":132,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-25T06:49:39.695Z","etag":null,"topics":["aws","aws-account","aws-account-management","aws-or","crossplane","crossplane-configuration","crossplane-configurations","crossplane-xrd","xrd"],"latest_commit_sha":null,"homepage":"","language":"KCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hops-ops.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-22T06:31:01.000Z","updated_at":"2026-03-24T05:33:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hops-ops/aws-account","commit_stats":null,"previous_names":["hops-ops/configuration-aws-account","hops-ops/aws-account"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/hops-ops/aws-account","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hops-ops%2Faws-account","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hops-ops%2Faws-account/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hops-ops%2Faws-account/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hops-ops%2Faws-account/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hops-ops","download_url":"https://codeload.github.com/hops-ops/aws-account/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hops-ops%2Faws-account/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32370030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-account","aws-account-management","aws-or","crossplane","crossplane-configuration","crossplane-configurations","crossplane-xrd","xrd"],"created_at":"2026-01-07T21:16:49.087Z","updated_at":"2026-04-28T07:01:24.374Z","avatar_url":"https://github.com/hops-ops.png","language":"KCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aws-account\n\nCreate and manage individual AWS Organizations member accounts. This is a low-level building block - most users should use the Organization XRD with inline accounts instead.\n\n## When to Use This Directly\n\n**Use Organization XRD (recommended):**\n- Creating accounts as part of your org hierarchy\n- Want accounts placed in specific OUs automatically\n- Managing multiple accounts together\n\n**Use Account XRD directly:**\n- Creating accounts outside the Organization XRD\n- Advanced scenarios requiring per-account control\n- Programmatic account vending (account factory)\n\n## How It Works\n\nWhen you create an account via AWS Organizations:\n1. AWS creates the account with the specified email\n2. AWS automatically creates `OrganizationAccountAccessRole` in the new account\n3. This role trusts the management account, enabling cross-account access\n4. You can assume this role to manage resources in the new account\n\n## Basic Usage\n\n```yaml\napiVersion: aws.hops.ops.com.ai/v1alpha1\nkind: Account\nmetadata:\n  name: team-platform-dev\n  namespace: default\nspec:\n  email: platform-dev@acme.example.com  # Must be unique across all AWS\n  parentId: ou-abc1-workloads           # OU ID or root ID (r-xxxx)\n  providerConfigRef:\n    name: management                    # Management account ProviderConfig\n    kind: ProviderConfig\n  managementPolicies: [\"*\"]\n\n  tags:\n    team: platform\n    environment: dev\n```\n\n## Import Existing Account\n\nAlready have an account? Import it with `externalName`:\n\n```yaml\napiVersion: aws.hops.ops.com.ai/v1alpha1\nkind: Account\nmetadata:\n  name: legacy-prod\n  namespace: default\nspec:\n  externalName: \"123456789012\"  # Existing account ID\n  email: legacy-prod@acme.example.com\n  parentId: ou-abc1-prod\n  providerConfigRef:\n    name: management\n    kind: ProviderConfig\n  # Don't delete if removed from Crossplane\n  managementPolicies: [\"Create\", \"Observe\", \"Update\", \"LateInitialize\"]\n```\n\n## Attach Service Control Policies\n\nSCPs restrict what actions accounts can perform - use them for guardrails:\n\n```yaml\napiVersion: aws.hops.ops.com.ai/v1alpha1\nkind: Account\nmetadata:\n  name: team-sandbox\n  namespace: default\nspec:\n  email: sandbox@acme.example.com\n  parentId: ou-abc1-sandbox\n  providerConfigRef:\n    name: management\n    kind: ProviderConfig\n\n  # Attach SCPs for guardrails\n  policyAttachments:\n    - arn:aws:organizations::111111111111:policy/o-abc123/service_control_policy/p-deny-root\n    - arn:aws:organizations::111111111111:policy/o-abc123/service_control_policy/p-region-restrict\n\n  tags:\n    environment: sandbox\n    cost-center: engineering\n```\n\n## Status\n\nThe Account exposes the information needed for cross-account access:\n\n```yaml\nstatus:\n  accountId: \"123456789012\"\n  organizationAccountAccessRoleArn: arn:aws:iam::123456789012:role/OrganizationAccountAccessRole\n  ready: true\n```\n\n## Cross-Account Access\n\nCreate a ProviderConfig that assumes the `OrganizationAccountAccessRole`:\n\n```yaml\napiVersion: aws.m.upbound.io/v1beta1\nkind: ProviderConfig\nmetadata:\n  name: team-platform-dev\nspec:\n  assumeRoleChain:\n    - roleARN: arn:aws:iam::123456789012:role/OrganizationAccountAccessRole\n  credentials:\n    source: PodIdentity  # Or Secret, IRSA\n```\n\nThen reference it in resources:\n\n```yaml\napiVersion: s3.aws.m.upbound.io/v1beta1\nkind: Bucket\nspec:\n  providerConfigRef:\n    name: team-platform-dev  # Creates bucket in the team's account\n  forProvider:\n    region: us-east-1\n```\n\n## Account Factory Pattern\n\nFor programmatic account creation, you can template Account resources:\n\n```yaml\n# Create accounts from a list\n{{ range $team := .teams }}\n---\napiVersion: aws.hops.ops.com.ai/v1alpha1\nkind: Account\nmetadata:\n  name: {{ $team.name }}-{{ $team.environment }}\n  namespace: default\nspec:\n  email: {{ $team.name }}-{{ $team.environment }}@acme.example.com\n  parentId: {{ if eq $team.environment \"prod\" }}ou-abc1-prod{{ else }}ou-abc1-nonprod{{ end }}\n  providerConfigRef:\n    name: management\n    kind: ProviderConfig\n  tags:\n    team: {{ $team.name }}\n    environment: {{ $team.environment }}\n{{ end }}\n```\n\n## Recommendations\n\n1. **Use Organization XRD for most cases** - It handles OU placement and keeps your hierarchy visible\n2. **Always set tags** - Include team, environment, and cost-center for billing\n3. **Use unique emails** - AWS requires globally unique emails; use `+` addressing if needed (aws+prod@acme.com)\n4. **Don't delete production accounts** - Use `managementPolicies` without Delete to orphan on removal\n5. **Account deletion takes 90 days** - AWS Organizations account closure is not immediate\n\n## Development\n\n```bash\nmake render              # Render example\nmake test                # Run tests\nmake validate            # Validate compositions\n```\n\n## License\n\nApache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhops-ops%2Faws-account","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhops-ops%2Faws-account","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhops-ops%2Faws-account/lists"}