Skip to content

Commit 854bc2a

Browse files
DOC-315: Document RAM ram:RequestedAllowsExternalPrincipals condition key (#812)
1 parent 5aa740b commit 854bc2a

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

src/content/docs/aws/developer-tools/security-testing/iam-coverage.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ It only includes operations performed with a principal, not as root, so test set
152152
| | - StringEqualsIgnoreCase |
153153
| | - StringLike |
154154
| | - ArnLike/ArnEquals |
155-
| | Supported condition keys: |
155+
| | Supported [global condition keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html): |
156156
| | - aws:RequestedRegion |
157157
| | - aws:PrincipalArn |
158158
| | - aws:SourceArn |
@@ -161,6 +161,12 @@ It only includes operations performed with a principal, not as root, so test set
161161
| | - aws:RequestTag |
162162
| | - aws:PrincipalTag |
163163

164+
## Service-Specific Condition Keys
165+
166+
In addition to the global condition keys above, some services support their own condition keys, matching AWS's [per-service condition key reference](https://docs.aws.amazon.com/service-authorization/latest/reference/reference_policies_actions-resources-contextkeys.html):
167+
168+
- [EC2](/aws/services/ec2/#iam-condition-keys): `ec2:MetadataHttpTokens`, `ec2:Attribute/<AttributeName>`
169+
- [RAM](/aws/services/ram/#iam-condition-keys): `ram:RequestedAllowsExternalPrincipals`
164170

165171
## Current Limitations
166172

src/content/docs/aws/services/ram.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,25 @@ No IAM policies are created or attached, and no permission enforcement takes pla
4444

4545
For all other resource types, the functionality is limited to mocking.
4646

47+
## IAM Condition Keys
48+
49+
When [IAM Policy Enforcement](/aws/developer-tools/security-testing/iam-policy-enforcement/) is enabled, LocalStack supports the following RAM-specific condition key, matching the behavior described in the [AWS condition keys reference](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsresourceaccessmanager.html#awsresourceaccessmanager-policy-keys):
50+
51+
- `ram:RequestedAllowsExternalPrincipals` &mdash; the `allowExternalPrincipals` value of a `CreateResourceShare` or `UpdateResourceShare` request, useful for restricting resource shares to principals within your organization.
52+
53+
For example, the following policy statement only allows creating or updating a resource share when it does not allow external principals:
54+
55+
```json
56+
{
57+
"Effect": "Allow",
58+
"Action": ["ram:CreateResourceShare", "ram:UpdateResourceShare"],
59+
"Resource": "*",
60+
"Condition": {
61+
"Bool": { "ram:RequestedAllowsExternalPrincipals": "false" }
62+
}
63+
}
64+
```
65+
4766
## API Coverage
4867

4968
<FeatureCoverage service="ram" client:load />

0 commit comments

Comments
 (0)