Skip to content

Commit abd99fb

Browse files
authored
Merge pull request aws-samples#47 from jplock/jp-add-s3
[feat] Add S3 policy
2 parents 3c568be + 12a5ad0 commit abd99fb

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

template.yml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,13 +440,41 @@ Resources:
440440
Value: !Ref "AWS::StackId"
441441
- Key: "aws-cloudformation:logical-id"
442442
Value: rRootAIOptOutPolicy
443-
#TargetIds:
444-
# - !If
445-
# - cHasOrganizationRootId
446-
# - !Ref pOrganizationRootId
447-
# - !GetAtt rOrganization.RootId
443+
TargetIds:
444+
- !If
445+
- cHasOrganizationRootId
446+
- !Ref pOrganizationRootId
447+
- !GetAtt rOrganization.RootId
448448
Type: AISERVICES_OPT_OUT_POLICY
449449

450+
rRootS3Policy:
451+
Type: "AWS::Organizations::Policy"
452+
DependsOn: rActivateCustomResource
453+
Properties:
454+
Content: |-
455+
{
456+
"s3_attributes": {
457+
"public_access_block_configuration": {
458+
"@@assign": "all"
459+
}
460+
}
461+
}
462+
Description: Enables all four Amazon S3 Block Public Access settings at the organization level
463+
Name: RootPolicy
464+
Tags:
465+
- Key: "aws-cloudformation:stack-name"
466+
Value: !Ref "AWS::StackName"
467+
- Key: "aws-cloudformation:stack-id"
468+
Value: !Ref "AWS::StackId"
469+
- Key: "aws-cloudformation:logical-id"
470+
Value: rRootS3Policy
471+
TargetIds:
472+
- !If
473+
- cHasOrganizationRootId
474+
- !Ref pOrganizationRootId
475+
- !GetAtt rOrganization.RootId
476+
Type: S3_POLICY
477+
450478
rExceptionsOu:
451479
Type: "AWS::Organizations::OrganizationalUnit"
452480
DependsOn: rOrgWaiter

0 commit comments

Comments
 (0)