Giter Site home page Giter Site logo

mbrookson / terraform-local Goto Github PK

View Code? Open in Web Editor NEW

This project forked from localstack/terraform-local

0.0 0.0 0.0 33 KB

Terraform CLI wrapper to deploy your Terraform applications directly to LocalStack

License: Apache License 2.0

Python 95.84% Makefile 4.01% Batchfile 0.15%

terraform-local's Introduction

Build status

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)
  • AWS_ENDPOINT_URL: hostname and port of the target LocalStack instance
  • LOCALSTACK_HOSTNAME: (Deprecated) host name of the target LocalStack instance
  • EDGE_PORT: (Deprecated) 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
  • AWS_DEFAULT_REGION: the AWS region to use (default: us-east-1, or determined from local credentials if boto3 is installed)
  • CUSTOMIZE_ACCESS_KEY: enables to override the static AWS Access Key ID. The following cases are taking precedence over each other from top to bottom:
    • AWS_ACCESS_KEY_ID environment variable is set
    • access_key is set in the Terraform AWS provider
    • AWS_PROFILE environment variable is set and configured
    • AWS_DEFAULT_PROFILE environment variable is set and configured
    • default profile's credentials are configured
    • falls back to the default AWS_ACCESS_KEY_ID mock value
  • AWS_ACCESS_KEY_ID: AWS Access Key ID to use for multi account setups (default: test -> account ID: 000000000000)

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.17.0: Add option to use new endpoints S3 backend options
  • v0.16.1: Update Setuptools to exclude tests during packaging
  • v0.16.0: Introducing semantic versioning and AWS_ENDPOINT_URL variable
  • v0.15: Update endpoint overrides for Terraform AWS provider 5.22.0
  • v0.14: Add support to multi-account environments
  • v0.13: Fix S3 automatic use_s3_path_style detection when setting S3_HOSTNAME or LOCALSTACK_HOSTNAME
  • v0.12: Fix local endpoint overrides for Terraform AWS provider 5.9.0; fix parsing of alias and region defined as value lists
  • v0.11: Minor fix to handle boolean values in S3 backend configs
  • 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 region to provider config
  • v0.4: Fix using use_s3_path_style for S3_HOSTNAME=localhost; exclude meteringmarketplace service 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).

terraform-local's People

Contributors

whummer avatar lakkeger avatar bentsku avatar charleswong28 avatar dv297 avatar sannya-singal avatar viren-nadkarni avatar rmvangun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.