skillfed

awacs

AWS Access Policy Language creation library

awacs v2.6.0 808.6K downloads/30d#5,013 on PyPI393
Permissive license New BSD license Active released

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 awacs

uv

uv add awacs

poetry

poetry add awacs

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9

Tags

AWS IAM policy generatorAWS access control policy PythonAWS policy JSON builderIAM policy as codeAWS policy validation
aws-iampolicy-as-codeinfrastructure

More Software Development packages