RAM Resource Share Deployer
An AWS CloudOps agent skill that provisions AWS RAM (Resource
Access Manager) resource shares with correct production
defaults. The skill walks the operator through a 9-step
provisioning procedure covering resource types, principal
associations, permission associations, and organization-level
sharing — explaining why each default matters and emitting a
READY_TO_DEPLOY checklist verifying every configuration item.
Quick navigation
| Need |
Section |
| What MUST be in the response |
"STRICT output contract" |
| Why the sharing topology matters |
"Reasoning framework" |
| What to verify before provisioning |
"Prerequisites" |
| The ordered provisioning steps |
"Deployment procedure" |
| Common silent-failure pitfalls |
"NEVER" |
| Choosing resource type, principals |
"Expert heuristic" |
| Sharing pattern matrix |
"Pattern matrix" |
| 2024-2026 feature changes |
"Recent AWS features" |
| Deep CLI sequences |
references/deployment-cli-commands.md |
| Permissions, resource types, vs peering |
references/permissions-and-resource-types.md |
Activation keywords
create RAM resource share, share subnet across accounts,
share Transit Gateway, RAM principal association,
RAM permission association, share Route53 Resolver rules,
RAM organization share, customer-managed permissions RAM,
RAM OU principal, License Manager sharing, Dedicated Host
sharing, Capacity Reservation sharing, Image Builder sharing,
RAM vs VPC peering, allow external principals RAM,
resource share promotion, AWS RAM resource type,
RAM resource association.
STRICT output contract
When this skill is invoked with a RAM resource share
provisioning request (resource share name, resource type,
principals, or a partial existing configuration), the agent
MUST respond with the READY_TO_DEPLOY checklist defined in
"Output format" using the literal all-caps labels
RESOURCE_SHARE:, VERDICT:, CHECKLIST:, and
VERIFICATION_COMMANDS:. Do NOT preface the checklist with
prose, headings, or disclaimers — emit the block as the first
lines of the response.
Required output structure
RESOURCE_SHARE: <resource-share-name> — the RAM resource
share being provisioned.
VERDICT: READY_TO_DEPLOY OR VERDICT: PREREQUISITES_MISSING
— nothing else.
CHECKLIST: followed by indented lines, each prefixed with a
status marker ([✓], [✗], [OPTIONAL], [INPUT NEEDED]).
VERIFICATION_COMMANDS: followed by indented aws ram ...
commands the operator can run.
6 FORBIDDEN output patterns (each silently breaks automation)
- FORBIDDEN — prose preamble before
RESOURCE_SHARE:. The
first non-empty line MUST be RESOURCE_SHARE:. No "Here is
your checklist…".
- FORBIDDEN — markdown variants of the labels. Write
VERDICT:, not **VERDICT:**, ### Verdict, Verdict =, or
\VERDICT``. The labels are case-sensitive all-caps keywords.
- FORBIDDEN — swapping verdict tokens. The verdict is exactly
READY_TO_DEPLOY or PREREQUISITES_MISSING — not "ready",
"missing", "BLOCKED", "OK", or "needs review".
- FORBIDDEN — omitting
VERIFICATION_COMMANDS:. Even when
the verdict is PREREQUISITES_MISSING, include the commands
the operator needs to verify the gaps.
- FORBIDDEN — extra sections after
VERIFICATION_COMMANDS:.
The checklist block is the entire response. Put deeper
explanation in references/ files, not after the block.
- FORBIDDEN — status marker drift. Use only
[✓], [✗],
[OPTIONAL], [INPUT NEEDED]. Do not invent [?], [!],
[WARN], or emoji markers.
Perfect example (copy the shape exactly)
RESOURCE_SHARE: shared-subnets-prod
VERDICT: READY_TO_DEPLOY
CHECKLIST:
[✓] Resource share name — shared-subnets-prod
[✓] Resource type — ec2:Subnet (subnet-abc123, subnet-def456)
[✓] Principals — 111111111111, 222222222222 (account IDs)
[✓] Permission association — AWSRAMDefaultPermissionSubnet (managed)
[✓] Allow external principals — false (internal accounts only)
[✓] Sharing visibility — INTERNAL (principals in same Organization)
[✓] Feature set — ALL (Organization all features enabled)
[✓] Resource share status — ACTIVE
[✓] Tags — Environment=production, Application=networking
[OPTIONAL] Customer-managed permissions — none (using AWS managed default)
VERIFICATION_COMMANDS:
aws ram get-resource-shares --resource-share-arns arn:aws:ram:us-east-1:123456789012:resource-share/shared-subnets-prod
aws ram list-principals --resource-owner SELF --resource-share-arn arn:aws:ram:us-east-1:123456789012:resource-share/shared-subnets-prod
aws ram list-resources --resource-owner SELF --resource-share-arn arn:aws:ram:us-east-1:123456789012:resource-share/shared-subnets-prod
aws ram list-permissions --resource-owner SELF
Reasoning framework (why the sharing topology matters)
AWS RAM resource sharing has resource type, principal, and
permission constraints that make the procedure non-trivial:
Resource type FIRST — determines available permissions.
Each resource type has a specific set of managed permissions.
Subnets use AWSRAMDefaultPermissionSubnet. Transit Gateways
use AWSRAMDefaultPermissionTransitGateway. The permission
defines what the principal can do with the shared resource.
Principal type — account IDs vs OU vs Organization.
RAM supports three principal types:
- Account IDs (12-digit) — share with specific accounts.
Each account must accept the invitation unless in the same
Organization with all features.
- OU ARNs (
arn:aws:organizations::master-account-id:ou/o-xxx/ou-yyy)
— share with all accounts in an OU. Auto-applies to accounts
moved into the OU later.
- Organization ARN (
arn:aws:organizations::master-account-id:organization/o-xxx)
— share with ALL accounts in the Organization. Auto-applies
to new accounts.
Resource share vs VPC peering — they serve different
purposes. VPC peering creates a point-to-point network
connection between two VPCs. Resource sharing via RAM shares
the resource itself (e.g., a subnet) so other accounts can
create resources IN it. Subnet sharing via RAM is the
foundation for AWS Network Firewall, centralized VPC
architectures, and Transit Gateway attachments.
Same-Organization auto-accept — the right pattern. When
the resource share is within an Organization with all features
enabled, principals auto-accept the share — no invitation
needed. External accounts (outside the Organization) receive
an invitation that must be accepted via AcceptResourceShare.
Permission association — managed vs customer-managed.
Each resource type has an AWS-managed default permission.
Customer-managed permissions allow fine-grained control (e.g.,
allow Create but not Delete on shared subnets). Customer-managed
permissions must be created and associated per resource type.
Allow external principals — security-sensitive flag.
By default, RAM shares within an Organization are internal.
Sharing with accounts outside the Organization requires
allowExternalPrincipals: true. This flag should be set
deliberately and audited — it widens the blast radius.
Resource share status — PENDING vs ACTIVE. When a resource
share is created with external principals, it starts as PENDING
until the principal accepts. Within an Organization, it is
immediately ACTIVE. The PromoteResourceShareCreatedFromPolicy
API converts a resource share created from a resource-based
policy to a standard RAM resource share.
Prerequisites (verify before deployment)
| Prerequisite |
Why it matters |
How to verify |
| Resource type and ARN |
The resource being shared must exist (subnet, transit gateway, resolver rule, etc.) and its ARN must be specified. |
aws ram list-resource-types |
| Principal IDs or ARNs |
Account IDs (12-digit), OU ARNs, or Organization ARN. Must be valid and accessible. |
aws organizations describe-organization, aws organizations list-organizational-units-for-parent |
| Organization all features (for org/OU sharing) |
Sharing with an Organization or OU ARN requires Organizations with all features enabled. |
aws organizations describe-organization --query 'Organization.FeatureSet' |
| Permission association |
Each resource type has a managed default permission. Customer-managed permissions must be created first. |
aws ram list-permissions --resource-owner SELF |
| Allow external principals |
Default is false. Set to true only when sharing with accounts outside the Organization. |
Check sharing visibility |
| IAM permissions |
Caller needs ram:CreateResourceShare, ram:AssociateResourceShare, ram:AssociateResourceSharePermission, plus resource-specific permissions. |
aws sts get-caller-identity |
Deployment procedure (apply in order)
Step 1: Resource type selection
RAM supports sharing the following resource types:
| Resource type |
Managed permission |
Typical use case |
ec2:Subnet |
AWSRAMDefaultPermissionSubnet |
Centralized VPC, shared networking, AWS Network Firewall |
ec2:TransitGateway |
AWSRAMDefaultPermissionTransitGateway |
Hub-and-spoke network topology |
ec2:PrefixList |
AWSRAMDefaultPermissionPrefixList |
Shared CIDR prefix lists |
route53resolver:ResolverRule |
AWSRAMDefaultPermissionRoute53ResolverRule |
Centralized DNS resolution |
route53resolver:FirewallRuleGroup |
AWSRAMDefaultPermissionRoute53ResolverFirewallRuleGroup |
DNS Firewall |
license-manager:LicenseConfiguration |
AWSRAMDefaultPermissionLicenseConfiguration |
License management across accounts |
ec2:DedicatedHost |
AWSRAMDefaultPermissionDedicatedHost |
Dedicated Host sharing for EC2 |
ec2:CapacityReservation |
AWSRAMDefaultPermissionCapacityReservation |
Capacity Reservation sharing |
imagebuilder:Component |
AWSRAMDefaultPermissionImageBuilderComponent |
EC2 Image Builder components |
imagebuilder:ImageRecipe |
AWSRAMDefaultPermissionImageBuilderImageRecipe |
Image Builder recipes |
imagebuilder:Image |
AWSRAMDefaultPermissionImageBuilderImage |
Built images |
glue:Catalog |
AWSRAMDefaultPermissionGlueDatabase |
Lake Formation / Glue catalog |
codebuild:Project |
AWSRAMDefaultPermissionCodeBuildProject |
CodeBuild project sharing |
Step 2: Principal selection
| Principal type |
Format |
Auto-accept? |
Applies to new accounts? |
| Account IDs |
111111111111, 222222222222 |
No (if external), Yes (if same Org) |
No — must add new accounts manually |
| OU ARN |
arn:aws:organizations::master-account-id:ou/o-xxx/ou-yyy |
Yes (if same Org) |
Yes — new accounts in OU auto-included |
| Organization ARN |
arn:aws:organizations::master-account-id:organization/o-xxx |
Yes (if same Org) |
Yes — all current and future accounts |
Decision rule: use Organization or OU ARNs when sharing
within an Organization with all features. Use account IDs for
cross-Organization sharing or selective account sharing.
Step 3: Create the resource share
cat > /tmp/resource-share.json <<'EOF'
{
"name": "shared-subnets-prod",
"allowExternalPrincipals": false,
"principals": [
"111111111111",
"222222222222"
],
"resources": [
{
"arn": "arn:aws:ec2:us-east-1:123456789012:subnet/subnet-abc123",
"type": "ec2:Subnet"
},
{
"arn": "arn:aws:ec2:us-east-1:123456789012:subnet/subnet-def456",
"type": "ec2:Subnet"
}
],
"tags": [
{ "Key": "Environment", "Value": "production" },
{ "Key": "Application", "Value": "networking" }
]
}
EOF
aws ram create-resource-share \
--cli-input-json file:///tmp/resource-share.json \
--region us-east-1
Step 4: Share with Organization or OU
# Share with the entire Organization
aws ram create-resource-share \
--name shared-tgw-org \
--allow-external-principals false \
--principals arn:aws:organizations::123456789012:organization/o-abc123def \
--resources arn=arn:aws:ec2:us-east-1:123456789012:transit-gateway/tgw-123,type=ec2:TransitGateway \
--region us-east-1
# Share with a specific OU
aws ram create-resource-share \
--name shared-resolver-rules-ou \
--allow-external-principals false \
--principals arn:aws:organizations::123456789012:ou/o-abc123def/ou-xyz456 \
--resources arn=arn:aws:route53resolver:us-east-1:123456789012:resolver-rule/rslvr-rr-abc123,type=route53resolver:ResolverRule \
--region us-east-1
Step 5: Permission association
Each resource type has a default AWS-managed permission. For
fine-grained control, create and associate a customer-managed
permission:
# List available permissions for a resource type
aws ram list-permissions \
--resource-type ec2:Subnet \
--resource-owner SELF \
--region us-east-1
# Create a customer-managed permission
cat > /tmp/permission.json <<'EOF'
{
"name": "custom-subnet-permission",
"resourceType": "ec2:Subnet",
"policyTemplate": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"ec2:CreateNetworkInterface\",\"ec2:DescribeSubnets\"],\"Resource\":\"*\"}]}",
"policyType": "MANAGED"
}
EOF
aws ram create-permission \
--cli-input-json file:///tmp/permission.json \
--region us-east-1
# Associate the permission with a resource share
PERMISSION_ARN=$(aws ram list-permissions \
--resource-type ec2:Subnet \
--resource-owner SELF \
--query 'permissions[?name==`custom-subnet-permission`].arn' \
--output text \
--region us-east-1)
aws ram associate-resource-share-permission \
--resource-share-arn arn:aws:ram:us-east-1:123456789012:resource-share/shared-subnets-prod \
--permission-arn ${PERMISSION_ARN} \
--region us-east-1
Step 6: Associate additional resources
Step 6 CLI sequence (associate additional resources) moved verbatim to
references/deployment-cli-commands.md.
Step 7: Associate additional principals
Step 7 CLI sequence (associate additional principals) moved verbatim to
references/deployment-cli-commands.md.
Step 8: Accept resource share invitations (external only)
Step 8 invitation-acceptance flow and CLI moved verbatim to
references/deployment-cli-commands.md.
Step 9: Verification and post-deployment checks
Step 9 verification and post-deployment check commands moved verbatim to
references/diagnostic-commands.md.
Pattern matrix
| Pattern |
Resource type |
Principals |
Permission |
When to use |
| Shared subnets (centralized VPC) |
ec2:Subnet |
Account IDs or OU ARN |
Default or custom |
Centralized networking, Network Firewall |
| Transit Gateway sharing |
ec2:TransitGateway |
Organization ARN |
Default |
Hub-and-spoke across all accounts |
| DNS resolution sharing |
route53resolver:ResolverRule |
OU ARN |
Default |
Centralized DNS forwarding |
| DNS Firewall sharing |
route53resolver:FirewallRuleGroup |
Account IDs |
Default |
Shared DNS Firewall rules |
| Dedicated Host sharing |
ec2:DedicatedHost |
Account IDs |
Default |
Host allocation across accounts |
| Capacity Reservation |
ec2:CapacityReservation |
OU ARN |
Default |
Shared capacity pools |
| License Manager |
license-manager:LicenseConfiguration |
Organization ARN |
Default |
Org-wide license tracking |
| Image Builder |
imagebuilder:Component |
OU ARN |
Default or custom |
Shared build components |
| Prefix List sharing |
ec2:PrefixList |
Account IDs |
Default |
Shared CIDR lists |
Resource share vs VPC peering
The RAM-share-vs-peering comparison table and decision rule moved verbatim to
references/permissions-and-resource-types.md.
Recent AWS features (2024-2026)
Recent AWS feature notes (2024-2026) moved verbatim to
references/advanced-patterns.md.
NEVER (anti-patterns)
NEVER create a resource share with allowExternalPrincipals: true
when sharing within the same Organization. External principal
sharing bypasses auto-accept and requires manual invitation
acceptance. Use false for intra-Org shares.
NEVER share a resource without first verifying the principal
account IDs or ARNs are valid. An invalid principal silently
creates a resource share association that never activates —
the principal status stays PENDING indefinitely.
NEVER assume external principals will auto-accept resource
share invitations. Only principals within an Organization with
all features auto-accept. External accounts must explicitly
call AcceptResourceShare.
NEVER create a VPC peering connection when the intent is to
share subnets for centralized networking. VPC peering creates
point-to-point routes; RAM subnet sharing lets other accounts
create resources directly in the shared subnet. Use RAM for
centralized architectures.
NEVER associate a customer-managed permission without testing
it first. A mis-scoped permission (e.g., denying
CreateNetworkInterface on a shared subnet) silently breaks
consumers that need to create ENIs (Lambda, RDS, NAT Gateway).
NEVER omit the permission association for resource types that
require it. Each resource type has a default managed permission
— without it, the principal can see the shared resource but
cannot interact with it.
NEVER share a Transit Gateway without verifying that the
consumer accounts have the correct RAM accept status. A TGW
share that is not accepted results in failed TGW attachment
creation on the consumer side.
NEVER deviate from the checklist output format. Substituting
Verdict / **VERDICT** / ### Verdict: for the literal
VERDICT: label silently breaks downstream deployment pipelines
and assertion-based evals.
Expert heuristic — choosing resource type and principals
The expert heuristic for choosing resource type and principals moved verbatim to
references/advanced-patterns.md.
Pre-flight safety checks (run before any provisioning CLI)
Pre-flight safety check commands moved verbatim to
references/diagnostic-commands.md.
Output format — MANDATORY literal labels
When invoked with a RAM resource share provisioning request,
your ENTIRE response MUST be the checklist block below. The
labels are case-sensitive all-caps keywords — write them
EXACTLY as shown. Do NOT write a preamble. Start with
RESOURCE_SHARE: and stop after the VERIFICATION_COMMANDS:
block.
RESOURCE_SHARE: <resource-share-name>
VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING
CHECKLIST:
[✓] Resource share name — <name>
[✓] Resource type — <type> (<resource-arns>)
[✓] Principals — <account IDs | OU ARN | Organization ARN>
[✓] Permission association — <managed permission name | customer-managed>
[✓] Allow external principals — <true | false>
[✓] Sharing visibility — <INTERNAL | EXTERNAL>
[✓] Feature set — <ALL (Organization) | N/A>
[✓] Resource share status — <ACTIVE | PENDING>
[✓] Tags — <key=value pairs>
[OPTIONAL] Customer-managed permissions — <name | none>
VERIFICATION_COMMANDS:
aws ram get-resource-shares --resource-share-arns <resource-share-arn>
aws ram list-principals --resource-owner SELF --resource-share-arn <resource-share-arn>
aws ram list-resources --resource-owner SELF --resource-share-arn <resource-share-arn>
aws ram list-resource-share-permissions --resource-share-arn <resource-share-arn>
Status marker semantics:
[✓] — configuration is applied and verified.
[✗] — configuration is NOT applied or is misconfigured. Cite
the gap.
[OPTIONAL] — recommended but not required for the sharing
pattern.
[INPUT NEEDED] — a prerequisite value is missing (resource
ARN, principal IDs, permission ARN) and the operator must
provide it before provisioning can proceed.
PREREQUISITES_MISSING verdict: if any REQUIRED prerequisite
is missing (resource ARN, principal IDs or ARNs, Organization
not enabled with all features for org/OU sharing), the verdict
is PREREQUISITES_MISSING with each gap listed.
Edge-case handling
The edge-case handling catalog moved verbatim to
references/advanced-patterns.md.
References (load on demand)
- references/advanced-patterns.md — recent AWS features (2024-2026), expert heuristic for resource type and principal selection, edge-case handling catalog (moved from this file)
- references/diagnostic-commands.md — pre-flight safety checks and Step 9 post-deployment verification commands (moved from this file)
- references/deployment-cli-commands.md — full copy-pasteable CLI sequence for all 9 steps; extended with the Step 6-8 associate and invitation-acceptance commands
- references/permissions-and-resource-types.md — shareable resource types, managed and customer-managed permissions, vs-VPC-peering decision matrix; extended with the comparison table and decision rule
Domain
AWS CloudOps / AWS RAM Resource Access Manager Provisioning.
AWS documentation
References
references/deployment-cli-commands.md — full copy-pasteable CLI
command sequence for all 9 provisioning steps, including resource
share creation, principal association (account IDs, OU ARNs,
Organization ARN), permission association (managed and
customer-managed), resource association, invitation acceptance,
and Terraform aws_ram_resource_share /
aws_ram_principal_association /
aws_ram_resource_association /
aws_ram_permission resource equivalents.
references/permissions-and-resource-types.md — deep reference
on all shareable resource types and their managed permissions,
customer-managed permission creation patterns, resource share vs
VPC peering decision matrix, allow-external-principals security
model, and multi-account sharing verification patterns.
1---2name: ram-resource-share-deployer3description: 'Provisions AWS RAM (Resource Access Manager) resource shares with correct production defaults: resource type selection (Subnet, Transit Gateway, License Manager, Dedicated Host, Capacity Reservation, Route53 Resolver rules, Image Builder components/images), principal association (account IDs, OU ARNs, organization ARN), permission association (AWS managed and customer-managed permissions), resource share vs VPC peering decision, allow-external-principals control, resource share status and promotion. Emits a READY_TO_DEPLOY checklist. Use when creating a RAM resource share, sharing subnets across accounts, sharing a Transit Gateway, sharing Route53 Resolver rules, sharing Dedicated Hosts or Capacity Reservations, sharing with an entire Organization or OU, or associating managed permissions. Triggers: create RAM resource share, share subnet, share transit gateway, RAM principals, RAM permission association, share Route53 Resolver rules, RAM organization share, customer-managed permissions.'4license: Apache-2.05compatibility: 'Requires an LLM agent runtime (Claude Code, Cursor, Windsurf, Codex, Gemini). For live deployment: AWS CLI v2 with ram, ec2, route53resolver, license-manager, imagebuilder, organizations, and sts access. Works with Terraform aws_ram_resource_share / aws_ram_principal_association / aws_ram_resource_association / aws_ram_permission resources, CloudFormation AWS::RAM::ResourceShare, and SAM templates.'6metadata:7 source: https://skillmd.com/skills/jhkchan/ram-resource-share-deployer8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '1'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: Governance15 task_type: deploy16 skill_class: capability17 lifecycle_status: active18 verdict_shape: READY_TO_DEPLOY | PREREQUISITES_MISSING19 version: 0.1.020 author: Jacky Chan — AWS Community Builder21 tags: aws, ram, resource-share, governance, cloudops, deploy, transit-gateway, subnet-sharing22 dependencies: aws-orchestrator23 keywords: aws, ram, resource-access-manager, resource-share, governance, cloudops, deploy, provisioning, organizations, transit-gateway, subnet-sharing, route53-resolver, license-manager, dedicated-host24 when_to_use: Invoke when the user wants to create a new RAM resource share, share subnets across accounts, share a Transit Gateway, share Route53 Resolver rules, share Dedicated Hosts or Capacity Reservations, share with an entire Organization or OU, associate managed or customer-managed permissions, or compare resource sharing vs VPC peering. Do NOT invoke for VPC peering connections (use vpc-network-deployer) or IAM cross-account roles (use iam-role-deployer).25---2627# RAM Resource Share Deployer2829An AWS CloudOps agent skill that provisions AWS RAM (Resource30Access Manager) resource shares with correct production31defaults. The skill walks the operator through a 9-step32provisioning procedure covering resource types, principal33associations, permission associations, and organization-level34sharing — explaining why each default matters and emitting a35READY_TO_DEPLOY checklist verifying every configuration item.3637## Quick navigation3839| Need | Section |40|---|---|41| What MUST be in the response | "STRICT output contract" |42| Why the sharing topology matters | "Reasoning framework" |43| What to verify before provisioning | "Prerequisites" |44| The ordered provisioning steps | "Deployment procedure" |45| Common silent-failure pitfalls | "NEVER" |46| Choosing resource type, principals | "Expert heuristic" |47| Sharing pattern matrix | "Pattern matrix" |48| 2024-2026 feature changes | "Recent AWS features" |49| Deep CLI sequences | `references/deployment-cli-commands.md` |50| Permissions, resource types, vs peering | `references/permissions-and-resource-types.md` |5152## Activation keywords5354create RAM resource share, share subnet across accounts,55share Transit Gateway, RAM principal association,56RAM permission association, share Route53 Resolver rules,57RAM organization share, customer-managed permissions RAM,58RAM OU principal, License Manager sharing, Dedicated Host59sharing, Capacity Reservation sharing, Image Builder sharing,60RAM vs VPC peering, allow external principals RAM,61resource share promotion, AWS RAM resource type,62RAM resource association.6364## STRICT output contract6566When this skill is invoked with a RAM resource share67provisioning request (resource share name, resource type,68principals, or a partial existing configuration), the agent69MUST respond with the READY_TO_DEPLOY checklist defined in70"Output format" using the literal all-caps labels71`RESOURCE_SHARE:`, `VERDICT:`, `CHECKLIST:`, and72`VERIFICATION_COMMANDS:`. Do NOT preface the checklist with73prose, headings, or disclaimers — emit the block as the first74lines of the response.7576### Required output structure77781. `RESOURCE_SHARE: <resource-share-name>` — the RAM resource79 share being provisioned.802. `VERDICT: READY_TO_DEPLOY` OR `VERDICT: PREREQUISITES_MISSING`81 — nothing else.823. `CHECKLIST:` followed by indented lines, each prefixed with a83 status marker (`[✓]`, `[✗]`, `[OPTIONAL]`, `[INPUT NEEDED]`).844. `VERIFICATION_COMMANDS:` followed by indented `aws ram ...`85 commands the operator can run.8687### 6 FORBIDDEN output patterns (each silently breaks automation)88891. **FORBIDDEN — prose preamble before `RESOURCE_SHARE:`.** The90 first non-empty line MUST be `RESOURCE_SHARE:`. No "Here is91 your checklist…".922. **FORBIDDEN — markdown variants of the labels.** Write93 `VERDICT:`, not `**VERDICT:**`, `### Verdict`, `Verdict =`, or94 `\`VERDICT\``. The labels are case-sensitive all-caps keywords.953. **FORBIDDEN — swapping verdict tokens.** The verdict is exactly96 `READY_TO_DEPLOY` or `PREREQUISITES_MISSING` — not "ready",97 "missing", "BLOCKED", "OK", or "needs review".984. **FORBIDDEN — omitting `VERIFICATION_COMMANDS:`.** Even when99 the verdict is `PREREQUISITES_MISSING`, include the commands100 the operator needs to verify the gaps.1015. **FORBIDDEN — extra sections after `VERIFICATION_COMMANDS:`.**102 The checklist block is the entire response. Put deeper103 explanation in `references/` files, not after the block.1046. **FORBIDDEN — status marker drift.** Use only `[✓]`, `[✗]`,105 `[OPTIONAL]`, `[INPUT NEEDED]`. Do not invent `[?]`, `[!]`,106 `[WARN]`, or emoji markers.107108### Perfect example (copy the shape exactly)109110```text111RESOURCE_SHARE: shared-subnets-prod112VERDICT: READY_TO_DEPLOY113CHECKLIST:114 [✓] Resource share name — shared-subnets-prod115 [✓] Resource type — ec2:Subnet (subnet-abc123, subnet-def456)116 [✓] Principals — 111111111111, 222222222222 (account IDs)117 [✓] Permission association — AWSRAMDefaultPermissionSubnet (managed)118 [✓] Allow external principals — false (internal accounts only)119 [✓] Sharing visibility — INTERNAL (principals in same Organization)120 [✓] Feature set — ALL (Organization all features enabled)121 [✓] Resource share status — ACTIVE122 [✓] Tags — Environment=production, Application=networking123 [OPTIONAL] Customer-managed permissions — none (using AWS managed default)124VERIFICATION_COMMANDS:125 aws ram get-resource-shares --resource-share-arns arn:aws:ram:us-east-1:123456789012:resource-share/shared-subnets-prod126 aws ram list-principals --resource-owner SELF --resource-share-arn arn:aws:ram:us-east-1:123456789012:resource-share/shared-subnets-prod127 aws ram list-resources --resource-owner SELF --resource-share-arn arn:aws:ram:us-east-1:123456789012:resource-share/shared-subnets-prod128 aws ram list-permissions --resource-owner SELF129```130131## Reasoning framework (why the sharing topology matters)132133AWS RAM resource sharing has **resource type, principal, and134permission constraints** that make the procedure non-trivial:1351361. **Resource type FIRST — determines available permissions.**137 Each resource type has a specific set of managed permissions.138 Subnets use `AWSRAMDefaultPermissionSubnet`. Transit Gateways139 use `AWSRAMDefaultPermissionTransitGateway`. The permission140 defines what the principal can do with the shared resource.1411422. **Principal type — account IDs vs OU vs Organization.**143 RAM supports three principal types:144 - **Account IDs** (12-digit) — share with specific accounts.145 Each account must accept the invitation unless in the same146 Organization with all features.147 - **OU ARNs** (`arn:aws:organizations::master-account-id:ou/o-xxx/ou-yyy`)148 — share with all accounts in an OU. Auto-applies to accounts149 moved into the OU later.150 - **Organization ARN** (`arn:aws:organizations::master-account-id:organization/o-xxx`)151 — share with ALL accounts in the Organization. Auto-applies152 to new accounts.1531543. **Resource share vs VPC peering — they serve different155 purposes.** VPC peering creates a point-to-point network156 connection between two VPCs. Resource sharing via RAM shares157 the resource itself (e.g., a subnet) so other accounts can158 create resources IN it. Subnet sharing via RAM is the159 foundation for AWS Network Firewall, centralized VPC160 architectures, and Transit Gateway attachments.1611624. **Same-Organization auto-accept — the right pattern.** When163 the resource share is within an Organization with all features164 enabled, principals auto-accept the share — no invitation165 needed. External accounts (outside the Organization) receive166 an invitation that must be accepted via `AcceptResourceShare`.1671685. **Permission association — managed vs customer-managed.**169 Each resource type has an AWS-managed default permission.170 Customer-managed permissions allow fine-grained control (e.g.,171 allow Create but not Delete on shared subnets). Customer-managed172 permissions must be created and associated per resource type.1731746. **Allow external principals — security-sensitive flag.**175 By default, RAM shares within an Organization are internal.176 Sharing with accounts outside the Organization requires177 `allowExternalPrincipals: true`. This flag should be set178 deliberately and audited — it widens the blast radius.1791807. **Resource share status — PENDING vs ACTIVE.** When a resource181 share is created with external principals, it starts as PENDING182 until the principal accepts. Within an Organization, it is183 immediately ACTIVE. The `PromoteResourceShareCreatedFromPolicy`184 API converts a resource share created from a resource-based185 policy to a standard RAM resource share.186187## Prerequisites (verify before deployment)188189| Prerequisite | Why it matters | How to verify |190|---|---|---|191| **Resource type and ARN** | The resource being shared must exist (subnet, transit gateway, resolver rule, etc.) and its ARN must be specified. | `aws ram list-resource-types` |192| **Principal IDs or ARNs** | Account IDs (12-digit), OU ARNs, or Organization ARN. Must be valid and accessible. | `aws organizations describe-organization`, `aws organizations list-organizational-units-for-parent` |193| **Organization all features (for org/OU sharing)** | Sharing with an Organization or OU ARN requires Organizations with all features enabled. | `aws organizations describe-organization --query 'Organization.FeatureSet'` |194| **Permission association** | Each resource type has a managed default permission. Customer-managed permissions must be created first. | `aws ram list-permissions --resource-owner SELF` |195| **Allow external principals** | Default is false. Set to true only when sharing with accounts outside the Organization. | Check sharing visibility |196| **IAM permissions** | Caller needs `ram:CreateResourceShare`, `ram:AssociateResourceShare`, `ram:AssociateResourceSharePermission`, plus resource-specific permissions. | `aws sts get-caller-identity` |197198## Deployment procedure (apply in order)199200### Step 1: Resource type selection201202RAM supports sharing the following resource types:203204| Resource type | Managed permission | Typical use case |205|---|---|---|206| `ec2:Subnet` | `AWSRAMDefaultPermissionSubnet` | Centralized VPC, shared networking, AWS Network Firewall |207| `ec2:TransitGateway` | `AWSRAMDefaultPermissionTransitGateway` | Hub-and-spoke network topology |208| `ec2:PrefixList` | `AWSRAMDefaultPermissionPrefixList` | Shared CIDR prefix lists |209| `route53resolver:ResolverRule` | `AWSRAMDefaultPermissionRoute53ResolverRule` | Centralized DNS resolution |210| `route53resolver:FirewallRuleGroup` | `AWSRAMDefaultPermissionRoute53ResolverFirewallRuleGroup` | DNS Firewall |211| `license-manager:LicenseConfiguration` | `AWSRAMDefaultPermissionLicenseConfiguration` | License management across accounts |212| `ec2:DedicatedHost` | `AWSRAMDefaultPermissionDedicatedHost` | Dedicated Host sharing for EC2 |213| `ec2:CapacityReservation` | `AWSRAMDefaultPermissionCapacityReservation` | Capacity Reservation sharing |214| `imagebuilder:Component` | `AWSRAMDefaultPermissionImageBuilderComponent` | EC2 Image Builder components |215| `imagebuilder:ImageRecipe` | `AWSRAMDefaultPermissionImageBuilderImageRecipe` | Image Builder recipes |216| `imagebuilder:Image` | `AWSRAMDefaultPermissionImageBuilderImage` | Built images |217| `glue:Catalog` | `AWSRAMDefaultPermissionGlueDatabase` | Lake Formation / Glue catalog |218| `codebuild:Project` | `AWSRAMDefaultPermissionCodeBuildProject` | CodeBuild project sharing |219220### Step 2: Principal selection221222| Principal type | Format | Auto-accept? | Applies to new accounts? |223|---|---|---|---|224| Account IDs | `111111111111`, `222222222222` | No (if external), Yes (if same Org) | No — must add new accounts manually |225| OU ARN | `arn:aws:organizations::master-account-id:ou/o-xxx/ou-yyy` | Yes (if same Org) | Yes — new accounts in OU auto-included |226| Organization ARN | `arn:aws:organizations::master-account-id:organization/o-xxx` | Yes (if same Org) | Yes — all current and future accounts |227228**Decision rule:** use Organization or OU ARNs when sharing229within an Organization with all features. Use account IDs for230cross-Organization sharing or selective account sharing.231232### Step 3: Create the resource share233234```bash235cat > /tmp/resource-share.json <<'EOF'236{237 "name": "shared-subnets-prod",238 "allowExternalPrincipals": false,239 "principals": [240 "111111111111",241 "222222222222"242 ],243 "resources": [244 {245 "arn": "arn:aws:ec2:us-east-1:123456789012:subnet/subnet-abc123",246 "type": "ec2:Subnet"247 },248 {249 "arn": "arn:aws:ec2:us-east-1:123456789012:subnet/subnet-def456",250 "type": "ec2:Subnet"251 }252 ],253 "tags": [254 { "Key": "Environment", "Value": "production" },255 { "Key": "Application", "Value": "networking" }256 ]257}258EOF259260aws ram create-resource-share \261 --cli-input-json file:///tmp/resource-share.json \262 --region us-east-1263```264265### Step 4: Share with Organization or OU266267```bash268# Share with the entire Organization269aws ram create-resource-share \270 --name shared-tgw-org \271 --allow-external-principals false \272 --principals arn:aws:organizations::123456789012:organization/o-abc123def \273 --resources arn=arn:aws:ec2:us-east-1:123456789012:transit-gateway/tgw-123,type=ec2:TransitGateway \274 --region us-east-1275276# Share with a specific OU277aws ram create-resource-share \278 --name shared-resolver-rules-ou \279 --allow-external-principals false \280 --principals arn:aws:organizations::123456789012:ou/o-abc123def/ou-xyz456 \281 --resources arn=arn:aws:route53resolver:us-east-1:123456789012:resolver-rule/rslvr-rr-abc123,type=route53resolver:ResolverRule \282 --region us-east-1283```284285### Step 5: Permission association286287Each resource type has a default AWS-managed permission. For288fine-grained control, create and associate a customer-managed289permission:290291```bash292# List available permissions for a resource type293aws ram list-permissions \294 --resource-type ec2:Subnet \295 --resource-owner SELF \296 --region us-east-1297298# Create a customer-managed permission299cat > /tmp/permission.json <<'EOF'300{301 "name": "custom-subnet-permission",302 "resourceType": "ec2:Subnet",303 "policyTemplate": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"ec2:CreateNetworkInterface\",\"ec2:DescribeSubnets\"],\"Resource\":\"*\"}]}",304 "policyType": "MANAGED"305}306EOF307308aws ram create-permission \309 --cli-input-json file:///tmp/permission.json \310 --region us-east-1311312# Associate the permission with a resource share313PERMISSION_ARN=$(aws ram list-permissions \314 --resource-type ec2:Subnet \315 --resource-owner SELF \316 --query 'permissions[?name==`custom-subnet-permission`].arn' \317 --output text \318 --region us-east-1)319320aws ram associate-resource-share-permission \321 --resource-share-arn arn:aws:ram:us-east-1:123456789012:resource-share/shared-subnets-prod \322 --permission-arn ${PERMISSION_ARN} \323 --region us-east-1324```325326### Step 6: Associate additional resources327328Step 6 CLI sequence (associate additional resources) moved verbatim to329[references/deployment-cli-commands.md](references/deployment-cli-commands.md).330331### Step 7: Associate additional principals332333Step 7 CLI sequence (associate additional principals) moved verbatim to334[references/deployment-cli-commands.md](references/deployment-cli-commands.md).335336### Step 8: Accept resource share invitations (external only)337338Step 8 invitation-acceptance flow and CLI moved verbatim to339[references/deployment-cli-commands.md](references/deployment-cli-commands.md).340341### Step 9: Verification and post-deployment checks342343Step 9 verification and post-deployment check commands moved verbatim to344[references/diagnostic-commands.md](references/diagnostic-commands.md).345346## Pattern matrix347348| Pattern | Resource type | Principals | Permission | When to use |349|---|---|---|---|---|350| Shared subnets (centralized VPC) | `ec2:Subnet` | Account IDs or OU ARN | Default or custom | Centralized networking, Network Firewall |351| Transit Gateway sharing | `ec2:TransitGateway` | Organization ARN | Default | Hub-and-spoke across all accounts |352| DNS resolution sharing | `route53resolver:ResolverRule` | OU ARN | Default | Centralized DNS forwarding |353| DNS Firewall sharing | `route53resolver:FirewallRuleGroup` | Account IDs | Default | Shared DNS Firewall rules |354| Dedicated Host sharing | `ec2:DedicatedHost` | Account IDs | Default | Host allocation across accounts |355| Capacity Reservation | `ec2:CapacityReservation` | OU ARN | Default | Shared capacity pools |356| License Manager | `license-manager:LicenseConfiguration` | Organization ARN | Default | Org-wide license tracking |357| Image Builder | `imagebuilder:Component` | OU ARN | Default or custom | Shared build components |358| Prefix List sharing | `ec2:PrefixList` | Account IDs | Default | Shared CIDR lists |359360## Resource share vs VPC peering361362The RAM-share-vs-peering comparison table and decision rule moved verbatim to363[references/permissions-and-resource-types.md](references/permissions-and-resource-types.md).364365## Recent AWS features (2024-2026)366367Recent AWS feature notes (2024-2026) moved verbatim to368[references/advanced-patterns.md](references/advanced-patterns.md).369370## NEVER (anti-patterns)371372- NEVER create a resource share with `allowExternalPrincipals: true`373 when sharing within the same Organization. External principal374 sharing bypasses auto-accept and requires manual invitation375 acceptance. Use `false` for intra-Org shares.376377- NEVER share a resource without first verifying the principal378 account IDs or ARNs are valid. An invalid principal silently379 creates a resource share association that never activates —380 the principal status stays PENDING indefinitely.381382- NEVER assume external principals will auto-accept resource383 share invitations. Only principals within an Organization with384 all features auto-accept. External accounts must explicitly385 call `AcceptResourceShare`.386387- NEVER create a VPC peering connection when the intent is to388 share subnets for centralized networking. VPC peering creates389 point-to-point routes; RAM subnet sharing lets other accounts390 create resources directly in the shared subnet. Use RAM for391 centralized architectures.392393- NEVER associate a customer-managed permission without testing394 it first. A mis-scoped permission (e.g., denying395 `CreateNetworkInterface` on a shared subnet) silently breaks396 consumers that need to create ENIs (Lambda, RDS, NAT Gateway).397398- NEVER omit the permission association for resource types that399 require it. Each resource type has a default managed permission400 — without it, the principal can see the shared resource but401 cannot interact with it.402403- NEVER share a Transit Gateway without verifying that the404 consumer accounts have the correct RAM accept status. A TGW405 share that is not accepted results in failed TGW attachment406 creation on the consumer side.407408- NEVER deviate from the checklist output format. Substituting409 `Verdict` / `**VERDICT**` / `### Verdict:` for the literal410 `VERDICT:` label silently breaks downstream deployment pipelines411 and assertion-based evals.412413## Expert heuristic — choosing resource type and principals414415The expert heuristic for choosing resource type and principals moved verbatim to416[references/advanced-patterns.md](references/advanced-patterns.md).417418## Pre-flight safety checks (run before any provisioning CLI)419420Pre-flight safety check commands moved verbatim to421[references/diagnostic-commands.md](references/diagnostic-commands.md).422423## Output format — MANDATORY literal labels424425When invoked with a RAM resource share provisioning request,426your ENTIRE response MUST be the checklist block below. The427labels are **case-sensitive all-caps keywords** — write them428EXACTLY as shown. Do NOT write a preamble. Start with429`RESOURCE_SHARE:` and stop after the `VERIFICATION_COMMANDS:`430block.431432```text433RESOURCE_SHARE: <resource-share-name>434VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING435CHECKLIST:436 [✓] Resource share name — <name>437 [✓] Resource type — <type> (<resource-arns>)438 [✓] Principals — <account IDs | OU ARN | Organization ARN>439 [✓] Permission association — <managed permission name | customer-managed>440 [✓] Allow external principals — <true | false>441 [✓] Sharing visibility — <INTERNAL | EXTERNAL>442 [✓] Feature set — <ALL (Organization) | N/A>443 [✓] Resource share status — <ACTIVE | PENDING>444 [✓] Tags — <key=value pairs>445 [OPTIONAL] Customer-managed permissions — <name | none>446VERIFICATION_COMMANDS:447 aws ram get-resource-shares --resource-share-arns <resource-share-arn>448 aws ram list-principals --resource-owner SELF --resource-share-arn <resource-share-arn>449 aws ram list-resources --resource-owner SELF --resource-share-arn <resource-share-arn>450 aws ram list-resource-share-permissions --resource-share-arn <resource-share-arn>451```452453**Status marker semantics:**454- `[✓]` — configuration is applied and verified.455- `[✗]` — configuration is NOT applied or is misconfigured. Cite456 the gap.457- `[OPTIONAL]` — recommended but not required for the sharing458 pattern.459- `[INPUT NEEDED]` — a prerequisite value is missing (resource460 ARN, principal IDs, permission ARN) and the operator must461 provide it before provisioning can proceed.462463**PREREQUISITES_MISSING verdict:** if any REQUIRED prerequisite464is missing (resource ARN, principal IDs or ARNs, Organization465not enabled with all features for org/OU sharing), the verdict466is `PREREQUISITES_MISSING` with each gap listed.467468## Edge-case handling469470The edge-case handling catalog moved verbatim to471[references/advanced-patterns.md](references/advanced-patterns.md).472473## References (load on demand)474475- [references/advanced-patterns.md](references/advanced-patterns.md) — recent AWS features (2024-2026), expert heuristic for resource type and principal selection, edge-case handling catalog (moved from this file)476- [references/diagnostic-commands.md](references/diagnostic-commands.md) — pre-flight safety checks and Step 9 post-deployment verification commands (moved from this file)477- [references/deployment-cli-commands.md](references/deployment-cli-commands.md) — full copy-pasteable CLI sequence for all 9 steps; extended with the Step 6-8 associate and invitation-acceptance commands478- [references/permissions-and-resource-types.md](references/permissions-and-resource-types.md) — shareable resource types, managed and customer-managed permissions, vs-VPC-peering decision matrix; extended with the comparison table and decision rule479480## Domain481482AWS CloudOps / AWS RAM Resource Access Manager Provisioning.483484## AWS documentation485486- **AWS RAM User Guide** — https://docs.aws.amazon.com/ram/latest/userguide/487- **RAM Resource Shares** — https://docs.aws.amazon.com/ram/latest/userguide/what-is.html488- **RAM Resource Types** — https://docs.aws.amazon.com/ram/latest/userguide/shareable.html489- **RAM Permissions** — https://docs.aws.amazon.com/ram/latest/userguide/permissions.html490- **RAM Customer-Managed Permissions** — https://docs.aws.amazon.com/ram/latest/userguide/working-with-customer-managed-permissions.html491- **RAM with Organizations** — https://docs.aws.amazon.com/ram/latest/userguide/working-with-organizations.html492- **RAM CLI Reference** — https://docs.aws.amazon.com/cli/latest/reference/ram/493494## References495496- `references/deployment-cli-commands.md` — full copy-pasteable CLI497 command sequence for all 9 provisioning steps, including resource498 share creation, principal association (account IDs, OU ARNs,499 Organization ARN), permission association (managed and500 customer-managed), resource association, invitation acceptance,501 and Terraform `aws_ram_resource_share` /502 `aws_ram_principal_association` /503 `aws_ram_resource_association` /504 `aws_ram_permission` resource equivalents.505506- `references/permissions-and-resource-types.md` — deep reference507 on all shareable resource types and their managed permissions,508 customer-managed permission creation patterns, resource share vs509 VPC peering decision matrix, allow-external-principals security510 model, and multi-account sharing verification patterns.