Skip to content

Commit

Permalink
Update SCPs method for initial deployment (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
san99tiago authored Sep 22, 2023
1 parent ee2a5cf commit fed7cf7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cdk/stacks/cdk_organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(
# Organization creation, services configuration and SCPs
self.create_root_organization()
self.configure_organization_services()
self.configure_service_control_policies()
# self.configure_service_control_policies()

# Create "sandbox" OU with inner OUs and accounts inside
self.create_ou_sandbox()
Expand Down Expand Up @@ -114,6 +114,7 @@ def configure_service_control_policies(self):
description="SCP to prevent accounts from leaving the organization",
)
self.organization.attach_policy(self.policy_deny_leave_org)
self.policy_deny_leave_org.node.add_dependency(self.organization)

# SCP for only allow access to specific regions in AWS (deny others)
self.policy_allow_specific_regions = Policy(
Expand All @@ -125,6 +126,7 @@ def configure_service_control_policies(self):
description="SCP to only allow access to specific AWS Regions",
)
self.organization.attach_policy(self.policy_allow_specific_regions)
self.policy_allow_specific_regions.node.add_dependency(self.organization)

def create_ou_sandbox(self):
"""
Expand Down

0 comments on commit fed7cf7

Please sign in to comment.