Registry /
aws / pepperize-cdk-organizations
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Organization
✓ from pepperize_cdk_organizations import Organization
✗ from cdk_organizations import Organization
The package uses underscores not hyphens, and must be imported from the pepperize namespace.
OrganizationalUnit
✓ from pepperize_cdk_organizations import OrganizationalUnit
✗ from pepperize_cdk_organizations.organizational_unit import OrganizationalUnit
All constructs are re-exported from the top-level __init__.py.
Creates an AWS Organization with a Service Control Policy attached.
from aws_cdk import App, Stack
from pepperize_cdk_organizations import Organization
from pepperize_cdk_organizations.scp import ServiceControlPolicy
app = App()
stack = Stack(app, 'MyStack')
org = Organization(stack, 'MyOrg')
policy = ServiceControlPolicy(stack, 'DenyEC2',
content={
'Version': '2012-10-17',
'Statement': [
{
'Effect': 'Deny',
'Action': 'ec2:*',
'Resource': '*'
}
]
},
description='Deny all EC2 actions'
)
org.policy_attachments.add(policy)
app.synth()
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pepperize_cdk_organizations'
Installed the wrong package name (e.g., `cdk-organizations`) or using a Python version <3.8.
fixRun `pip install pepperize-cdk-organizations` and ensure Python >=3.8.
jsii.errors.JSIIError: Expected object, got list
Passing a list of statements directly to `ServiceControlPolicy(content=...)` instead of a dict with 'Version' and 'Statement'.
fixUse `content={'Version': '2012-10-17', 'Statement': [...]}`. Upgrade
Version history
0.7.987latest on PyPI · released Jan 28, 2025
Audit
Dependencies
No dependency data recorded yet.