Skip to main content

Terrastack

This simple project provides a way to define terrastack specifications through the Python language, which in turn can be used to output Terraform json specifications.

The library itself does not try to create abstractions for every type of resource and attribute that can be defined in Terraform. The goal for the API is to be as thin as possible - with the help of using standard python objects and kwarg handling. Sacrificing type safety in order to be feature compatible with Terraform.

Example use:

import terrastack as ts

stack = ts.Stack()
stack.extend(ts.Provider("aws",
    region  = "eu-west-1",
    version = "1.30.0",
))

# extend supports variable number of components
stack.extend(
    ts.Resource("aws_instance", "my-instance-1",
        ami="some-ami",
    ),
    ts.Resource("aws_instance", "my-instance-2",
        ami="some-ami",
    ),
    ts.Output("my_output", "some_value"),
)

print(stack.render_json())

# output:
        {
            "output": {
                "my_output": {
                    "value": "some_value"
                }
            },
            "provider": [
                {
                    "aws": {
                        "region": "eu-west-1",
                        "version": "1.30.0"
                    }
                }
            ],
            "resource": {
                "aws_instance": {
                    "my-instance-1": {
                        "ami": "some-ami"
                    },
                    "my-instance-2": {
                        "ami": "some-ami"
                    }
                }
            }
        }

Metadata

Release files for terrastack 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for terrastack 1.0.0
File Size Uploaded
terrastack-1.0.0.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for terrastack 1.0.0
File Interpreter ABI Platform
terrastack-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.6 kB

Release files / terrastack-1.0.0.tar.gz

Download URL terrastack-1.0.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
24b608f9f4de8773496057c421a028ddf0efe44b8379392fafa7adefad51f489
BLAKE2b-256 checksum
How to use checksums
80312f1742943b9d061f902d3d127b0707e6c73b168f24562862a9b873ad3b44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release files / terrastack-1.0.0-py3-none-any.whl

Download URL terrastack-1.0.0-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5fb38d4184414b4751aa1b03a82a2c5ab479b8f5c096456f654cf89adb53dbb2
BLAKE2b-256 checksum
How to use checksums
f0de2031a06173a41d3e8c64d511b9a342b15f68d7866cf516e87eb02bfdbf4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page