awacs
AWS Access Policy Language creation library
What it is and what it does
awacs is a Python library for programmatically building AWS IAM access policies as JSON. Instead of hand-writing policy JSON, you write Python code using awacs classes like PolicyDocument, Statement, Principal, and Action, then serialize to JSON. The library validates policy structure and types as you build, catching common errors before the policy reaches AWS.
It's designed to work with AWS IAM, S3, and other AWS services that accept policy documents. The library has no runtime dependencies, making it lightweight to add to infrastructure-as-code projects. It's actively maintained and supports Python 3.9 and later.
Use it for:
- Generate S3 bucket policies programmatically with validated principals, actions, and resources
- Build IAM role trust policies in code rather than JSON templates
- Create reusable policy templates by parameterizing awacs objects with account IDs and resource ARNs
- Catch policy syntax errors during development instead of at AWS deployment time
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
awacs generates AWS IAM policy JSON from Python code, with built-in validation to catch policy format and type errors early.
Yes. awacs is actively maintained, has no dependencies, supports current Python versions, carries no known vulnerabilities, and solves a real problem—writing AWS policies in code with validation. Use it if you're building infrastructure-as-code that needs to generate IAM policies programmatically.
Install
awacs on PyPI
pip
pip install awacsuv
uv add awacspoetry
poetry add awacsInstalling awacs
Before you install
Low friction installation with no runtime dependencies. Active maintenance—last commit 2026-08-10, release 68 days ago—and supports current Python versions (3.9 through 3.14).
License in practice
Licensed under New BSD (permissive), so you can use and modify freely in commercial or private projects with minimal restrictions.
Quickstart
pip install awacs
from awacs.aws import PolicyDocument, Statement, Allow, Action, Principal
from awacs.iam import ARN as IAM_ARN
from awacs.s3 import ARN as S3_ARN
pd = PolicyDocument(
Version="2012-10-17",
Statement=[
Statement(
Effect=Allow,
Principal=Principal("AWS", [IAM_ARN("user/Bob", "", "123456789012")]),
Action=[Action("s3", "*")],
Resource=[S3_ARN("my_corporate_bucket/*")],
),
],
)
print(pd.to_json())
Verify before relying
- Whether the deprecated awacs.aws.Policy object is still functional or already removed in version 2.6.0
- Scope of built-in property and type checking—which validation errors are caught at definition time vs. serialization time
Package facts
| License | New BSD license (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 68 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 808,633/month — #5,013 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: awacs-2.6.0-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
policy-sentryPolicy Sentry generates least-privilege AWS IAM…
permissive · top 5,000 on PyPI
policyuniverseParses and analyzes AWS IAM and Resource…
permissive · top 15,000 on PyPI
troposphereTroposphere is a Python library that generates…
permissive · top 5,000 on PyPI
aws-cdk.aws-iamProvides Python constructs for defining AWS IAM…
permissive · top 15,000 on PyPI
arnParses AWS ARN strings into typed objects with…
unclear · top 15,000 on PyPI
aws-msk-iam-sasl-signer-pythonGenerates IAM-signed SASL/OAUTHBEARER…
permissive · top 5,000 on PyPI
py-iam-expandExpands and deobfuscates AWS IAM action…
permissive · top 15,000 on PyPI
cdk-iam-floydGenerates AWS IAM policy statements with a…
permissive · top 15,000 on PyPI
cloudsplainingCloudsplaining scans AWS IAM policies to…
permissive · top 5,000 on PyPI
iamdataProvides programmatic access to AWS IAM service…
permissive · top 15,000 on PyPI