{"id":28037,"library":"pepperize-cdk-organizations","title":"CDK Organizations","description":"Manage AWS organizations, organizational units (OU), accounts and service control policies (SCP) using AWS CDK. Current version: 0.7.987. Maintained as part of the pepperize CDK constructs, with releases tied to AWS CDK updates.","status":"active","version":"0.7.987","language":"python","source_language":"en","source_url":"https://github.com/pepperize/cdk-organizations","tags":["aws","cdk","organizations","scp","infrastructure-as-code"],"install":[{"cmd":"pip install pepperize-cdk-organizations","lang":"bash","label":"Latest version"}],"dependencies":[],"imports":[{"note":"The package uses underscores not hyphens, and must be imported from the pepperize namespace.","wrong":"from cdk_organizations import Organization","symbol":"Organization","correct":"from pepperize_cdk_organizations import Organization"},{"note":"All constructs are re-exported from the top-level __init__.py.","wrong":"from pepperize_cdk_organizations.organizational_unit import OrganizationalUnit","symbol":"OrganizationalUnit","correct":"from pepperize_cdk_organizations import OrganizationalUnit"}],"quickstart":{"code":"from aws_cdk import App, Stack\nfrom pepperize_cdk_organizations import Organization\nfrom pepperize_cdk_organizations.scp import ServiceControlPolicy\n\napp = App()\nstack = Stack(app, 'MyStack')\norg = Organization(stack, 'MyOrg')\npolicy = ServiceControlPolicy(stack, 'DenyEC2',\n    content={\n        'Version': '2012-10-17',\n        'Statement': [\n            {\n                'Effect': 'Deny',\n                'Action': 'ec2:*',\n                'Resource': '*'\n            }\n        ]\n    },\n    description='Deny all EC2 actions'\n)\norg.policy_attachments.add(policy)\napp.synth()","lang":"python","description":"Creates an AWS Organization with a Service Control Policy attached."},"warnings":[{"fix":"Replace `OrganizationRoot` with `Organization` in imports and usage.","message":"Version 0.7.x renamed `OrganizationRoot` to `Organization`. All existing code using `OrganizationRoot` will break.","severity":"breaking","affected_versions":"<0.7.0"},{"fix":"Use Python >= 3.8.","message":"The package requires Python 3.8 or later. Using an older Python version will fail to install.","severity":"gotcha","affected_versions":">=0.7.0"},{"fix":"Pass a plain dict with 'Version' and 'Statement' keys.","message":"Service Control Policies are defined as JSON-like dicts, not as CDK `PolicyDocument` objects. Using `PolicyDocument` will cause a type error at synthesis.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run `pip install pepperize-cdk-organizations` and ensure Python >=3.8.","cause":"Installed the wrong package name (e.g., `cdk-organizations`) or using a Python version <3.8.","error":"ModuleNotFoundError: No module named 'pepperize_cdk_organizations'"},{"fix":"Use `content={'Version': '2012-10-17', 'Statement': [...]}`.","cause":"Passing a list of statements directly to `ServiceControlPolicy(content=...)` instead of a dict with 'Version' and 'Statement'.","error":"jsii.errors.JSIIError: Expected object, got list"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}