tflocal - Terraform with LocalStack
This package provides tflocal - a small wrapper script to run Terraform against LocalStack.
Prerequisites
- Python 3.x
pipterraform
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 instanceEDGE_PORT: port number of the target LocalStack instanceS3_HOSTNAME: special hostname to be used to connect to LocalStack S3 (default:s3.localhost.localstack.cloud)USE_EXEC: whether to useos.execinstead ofsubprocess.Popen(try using this in case of I/O issues)<SERVICE>_ENDPOINT: setting a custom service endpoint, e.g.,COGNITO_IDP_ENDPOINT=http://example.comAWS_DEFAULT_REGION: the AWS region to use (default:us-east-1, or determined from local credentials ifboto3is installed)
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.10: Add support for storing state files in local S3 backends
- v0.9: Fix unsupported provider override for emrserverless
- v0.8: Configure the endpoint for opensearch service
- v0.7: Add initial support for provider aliases
- v0.6: Fix selection of default region
- v0.5: Make AWS region configurable, add
regionto provider config - v0.4: Fix using use_s3_path_style for S3_HOSTNAME=localhost; exclude
meteringmarketplaceservice endpoint - 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.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| terraform-local-0.11.tar.gz | 12.0 kB | Details |
Release files / terraform-local-0.11.tar.gz
| Download URL | terraform-local-0.11.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54c09ded713a1ff1d53909442b87b9a3006e52ca88b8897864483facd3eb3fb5
|
|
BLAKE2b-256 checksum How to use checksums |
e09f741b4d50462da1018f4d73a68851433e3d88e6df344708a2af3f035968cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.4
|