- Newest
- Most votes
- Most comments
To meet your requirements for controlling the AcceptDataGrant action within your AWS Organization, you'll need to create a Service Control Policy (SCP) that combines both allow and deny statements. Here's a policy that should achieve your goals:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowAcceptDataGrantWithinOrg", "Effect": "Allow", "Action": "dataexchange:AcceptDataGrant", "Resource": "", "Condition": { "StringEquals": { "aws:PrincipalOrgID": "${aws:PrincipalOrgID}" } } }, { "Sid": "DenyAcceptDataGrantOutsideOrg", "Effect": "Deny", "Action": "dataexchange:AcceptDataGrant", "Resource": "", "Condition": { "StringNotEquals": { "aws:PrincipalOrgID": "${aws:PrincipalOrgID}" } } }, { "Sid": "AllowPayerAccountUnrestrictedAccess", "Effect": "Allow", "Action": "dataexchange:AcceptDataGrant", "Resource": "*", "Condition": { "StringEquals": { "aws:PrincipalAccount": "PAYER_ACCOUNT_ID" } } } ] }
This policy does the following:
-
The first statement allows the AcceptDataGrant action only among accounts within the same organization.
-
The second statement denies the AcceptDataGrant action for any account not part of the organization.
-
The third statement allows unrestricted AcceptDataGrant action for the payer account.
Replace "PAYER_ACCOUNT_ID" with your actual AWS Organization payer account ID.
This SCP should be applied to the root of your organization or to the Organizational Units (OUs) containing the member accounts you want to restrict. The payer account, being the management account of the organization, is not affected by SCPs, so it will retain its ability to send/receive DataGrants to/from any AWS account.
Remember that SCPs don't grant permissions themselves; they set the maximum permissions for accounts in your organization. You'll still need to grant the necessary permissions to IAM users or roles within each account using identity-based policies.
Sources
Examples of Amazon S3 bucket policies - Amazon Simple Storage Service
SCP evaluation - AWS Organizations
Enforcing enterprise-wide preventive controls with AWS Organizations | AWS Cloud Operations Blog
Relevant content
asked 3 years ago
asked a year ago
- AWS OFFICIALUpdated 7 months ago
