Registry / aws / pepperize-cdk-organizations

pepperize-cdk-organizations

JSON →
library0.7.987pypypi✓ verified 83d ago

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.

pip install pepperize-cdk-organizations
INSTALL
IMPORT
SIG · PEPPERIZE-CDK-ORGA
P
pepperize-cdk-organizations
awspythonv0.7.987
harness data pending
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()
Debug
Known issues
breakingVersion 0.7.x renamed `OrganizationRoot` to `Organization`. All existing code using `OrganizationRoot` will break.
fix
Replace `OrganizationRoot` with `Organization` in imports and usage.
affects: <0.7.0
gotchaThe package requires Python 3.8 or later. Using an older Python version will fail to install.
fix
Use Python >= 3.8.
affects: >=0.7.0
gotchaService Control Policies are defined as JSON-like dicts, not as CDK `PolicyDocument` objects. Using `PolicyDocument` will cause a type error at synthesis.
fix
Pass a plain dict with 'Version' and 'Statement' keys.
affects: all
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.
fix
Run `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'.
fix
Use `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.

Agent activity
19 hits · last 30 days
node
18
Amazon
1
Resources