Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SCPs method for initial deployment #4

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading