aws-cdk.aws-iam
CDK routines for easily assigning correct and minimal IAM permissions
What it is and what it does
This package is the IAM construct library for AWS CDK v1, a framework for defining cloud infrastructure using Python code. It lets you declare IAM roles, policies, users, and groups as reusable constructs and automatically generates least-privilege permission policies when you wire those constructs together with other AWS resources. For example, if you attach a Lambda function to a DynamoDB table, CDK will automatically grant the Lambda's execution role the minimum permissions needed to read or write to that table.
The package includes helpers for common patterns: attaching managed policies, importing existing IAM roles by ARN, configuring external IDs for cross-account access, and defining principals (service accounts, AWS accounts, federated identities) for assume-role policies. However, CDK v1 reached end-of-support on 2023-06-01 and is no longer receiving updates; AWS recommends migrating to CDK v2 for new projects and ongoing support.
Use it for:
- Define and attach IAM roles to Lambda functions, EC2 instances, and other AWS services in CDK v1 stacks.
- Automatically grant minimal permissions between resources (e.g., allow a Lambda to write to a DynamoDB table).
- Create inline and managed policies for users and groups in infrastructure-as-code form.
- Import and reuse existing IAM roles from your AWS account without recreating them.
- Configure cross-account role assumption with external IDs for third-party integrations.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python constructs for defining AWS IAM roles, policies, users, and groups within AWS CDK v1 infrastructure-as-code projects, with automatic least-privilege permission management.
No—do not install for new projects. This package is end-of-support as of 2023-06-01 and will not receive security updates or bug fixes. AWS CDK v2 is the actively maintained replacement. Install only if you are maintaining an existing CDK v1 codebase that cannot yet migrate, and plan a migration timeline.
Install
aws-cdk-aws-iam on PyPI
pip
pip install aws-cdk-aws-iamuv
uv add aws-cdk-aws-iampoetry
poetry add aws-cdk-aws-iamInstalling aws-cdk.aws-iam
Before you install
Low install friction with pure Python wheel distribution. However, the package is no longer being updated—AWS CDK v1 reached end-of-support on 2023-06-01. Users should plan migration to AWS CDK v2 for ongoing support and security updates.
License in practice
Licensed under Apache-2.0 (permissive), allowing use in commercial and open-source projects with minimal restrictions.
Quickstart
pip install aws-cdk.aws-iam
from aws_cdk.aws_iam import Role, ServicePrincipal, PolicyStatement
role = Role(self, "MyRole",
assumed_by=ServicePrincipal("sns.amazonaws.com")
)
role.add_to_policy(PolicyStatement(
resources=["*"],
actions=["lambda:InvokeFunction"]
))
Requires AWS CDK v1 core library (aws-cdk.core) and Python 3.7 or later; CDK v1 is end-of-support as of 2023-06-01.
Verify before relying
- Whether existing CDK v1 deployments remain stable in production without active maintenance.
- Compatibility of this package with newer AWS service IAM features added after 2023-06-01.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (~=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — aws-cdk.core, aws-cdk.cx-api, aws-cdk.region-info, constructs, jsii, publication, typeguard |
| Maintenance | actively maintained — 1,152 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 197,666/month — #9,752 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aws_cdk.aws_iam-1.204.0-py3-none-any.whl
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
aws-cdk.aws-kmsProvides AWS CDK constructs for defining and…
permissive · top 15,000 on PyPI
cdk-iam-floydGenerates AWS IAM policy statements with a…
permissive · top 15,000 on PyPI
cloudsec-auditAudits AWS cloud security posture by checking…
permissive · top 15,000 on PyPI
awacsawacs generates AWS IAM policy JSON from Python…
permissive · top 15,000 on PyPI
policy-sentryPolicy Sentry generates least-privilege AWS IAM…
permissive · top 5,000 on PyPI
aws-cdk.aws-secretsmanagerAWS CDK construct library for provisioning and…
permissive · top 15,000 on PyPI
iamdataProvides programmatic access to AWS IAM service…
permissive · top 15,000 on PyPI
policyuniverseParses and analyzes AWS IAM and Resource…
permissive · top 15,000 on PyPI
aws-cdk.region-infoProvides a queryable database of AWS…
permissive · top 15,000 on PyPI
cloudsplainingCloudsplaining scans AWS IAM policies to…
permissive · top 5,000 on PyPI