--- id: troposphere version: "4.10.2" license: BSD-2-Clause license_treatment: permissive maintenance: active --- # troposphere — AWS CloudFormation creation library License: permissive · Maintenance: active · Downloads: 1.3M/mo ## What it is and what it does Troposphere lets you write AWS CloudFormation templates as Python code instead of JSON or YAML. You define AWS resources using Python classes, set their properties, and the library generates valid CloudFormation JSON or YAML output. The library validates resource properties and types as you build the template, catching configuration errors before deployment rather than during stack creation. It's designed for teams that prefer programmatic infrastructure definition and want type safety and early error detection. The library includes support for AWS resources and basic OpenStack Heat resources. A single optional dependency (cfn_flip) handles output format conversion. Use it for: - Generate CloudFormation templates programmatically for repeatable infrastructure deployments across environments - Catch CloudFormation configuration errors at development time through property and type validation - Build infrastructure templates using Python control flow, functions, and version control-friendly code - Convert between CloudFormation JSON and YAML formats during template generation and deployment - Define reusable infrastructure components as Python classes and functions for consistent resource patterns ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Troposphere is a Python library that generates AWS CloudFormation templates by writing Python code instead of hand-crafting JSON or YAML, with built-in property and type validation to catch errors early. Yes. Troposphere is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a real problem for teams managing AWS infrastructure as code. The permissive license and broad Python version support (3.8+) make it low-risk to adopt. Install it if you prefer writing infrastructure in Python over hand-editing CloudFormation templates. ## Install pip install troposphere uv add troposphere poetry add troposphere ## Installing troposphere Before you install: Low friction installation as a pure Python wheel with a single runtime dependency (cfn_flip). The package is actively maintained with a recent release and has been stable since its early releases. License in practice: BSD-2-Clause is a permissive license that allows commercial use, modification, and distribution with minimal restrictions—suitable for most projects. Quickstart: pip install troposphere from troposphere import Template, Ref import troposphere.ec2 as ec2 t = Template() instance = ec2.Instance("myinstance", ImageId="ami-951945d0", InstanceType="t1.micro") t.add_resource(instance) print(t.to_json()) Verify before relying: - Whether cfn_flip is required at runtime or only for optional output format conversion - Scope and completeness of AWS resource type coverage relative to current CloudFormation service offerings ## Package facts - License: BSD-2-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags cloudformation template generation python, aws infrastructure as code, cloudformation json builder, python cloudformation library, infrastructure automation aws, cloudformation type checking, aws resource definition python, infrastructure-as-code, aws-cloudformation, template-generation [View on SkillFed](https://skillfed.io/packages/troposphere) · [View on PyPI](https://pypi.org/project/troposphere/)