Skip to main content

tflocal - Terraform with LocalStack

This package provides tflocal - a small wrapper script to run Terraform against LocalStack.

Prerequisites

  • Python 3.x
  • pip
  • terraform

How it works

The script uses the Terraform Override mechanism and creates a temporary file localstack_providers_override.tf to configure the endpoints for the AWS provider section. The endpoints for all services are configured to point to the LocalStack API (http://localhost:4566 by default).

Installation

The tflocal command line interface can be installed via pip:

pip install terraform-local

Configurations

The following environment variables can be configured:

  • TF_CMD: Terraform command to call (default: terraform)
  • LOCALSTACK_HOSTNAME: host name of the target LocalStack instance
  • EDGE_PORT: port number of the target LocalStack instance
  • S3_HOSTNAME: special hostname to be used to connect to LocalStack S3 (default: s3.localhost.localstack.cloud)
  • USE_EXEC: whether to use os.exec instead of subprocess.Popen (try using this in case of I/O issues)
  • <SERVICE>_ENDPOINT: setting a custom service endpoint, e.g., COGNITO_IDP_ENDPOINT=http://example.com

Usage

The tflocal command has the same usage as the terraform command. For detailed usage, please refer to the man pages of terraform --help.

Change Log

  • v0.3: Fix support for -chdir=... to create providers file in target directory
  • v0.2: Add ability to specify custom endpoints; pass INT signals to subprocess
  • v0.1: Initial release

License

This software library is released under the Apache License, Version 2.0 (see LICENSE).

Metadata

Release files for terraform-local 0.3.1

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

Source distribution (sdist)

Source distribution for terraform-local 0.3.1
File Size Uploaded
terraform-local-0.3.1.tar.gz 8.0 kB Details

Release files / terraform-local-0.3.1.tar.gz

Download URL terraform-local-0.3.1.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e81162e8842ba1a7a8efbdd8e065f5d5c2c898665a1dbf46a5432a3ad2c0584e
BLAKE2b-256 checksum
How to use checksums
c41e27b74870be4d0220ca9d8222c677f20906b82ac730fb933bbecbfee4aecb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

0.26.0

2 release files

0.24.1

2 release files

0.24.0

1 release file

0.23.1

1 release file

0.23.0

1 release file

0.22.0

1 release file

0.21.0

1 release file

0.20.1

1 release file

0.20.0

1 release file

0.19.0

1 release file

0.18.2

1 release file

0.18.1

1 release file

0.18.0

1 release file

0.17.1

1 release file

0.17.0

1 release file

0.16.1

1 release file

0.16.0

1 release file

0.15

1 release file

0.14

1 release file

0.13

1 release file

0.12

1 release file

0.11

1 release file

0.10

1 release file

0.9

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

This release

0.3.1 This release

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

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