Skip to content

Terraform private module manager that uses S3 as a backend. Includes simple versioning of modules to make forward migration easier. Mirrored from https://gitlab.com/rocket-boosters/terrable

License

Notifications You must be signed in to change notification settings

rocketboosters/terrable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terrable

PyPI version build status coverage report Code style: black Code style: flake8 Code style: mypy PyPI - License

Terraform private module manager that uses S3 as a backend. Includes simple versioning of modules to make forward migration easier. Terraform supports referencing modules stored in S3 as compressed files (see S3 Bucket for more details). However, managing those packages is not part of Terraform itself. That's where terr•able comes in. The terrable CLI allows for bundling terraform module directories into compressed files and deploying them to S3 with simple incremental versioning. That way modules changes can be gradually introduced in dependent projects as needed without causing conflicts.

Installation

Terrable is available via pip:

$ pip install terrable

or via poetry:

# poetry install terrable --dev

Once installed, the terrable CLI command will be available in your terminal.

Usage

Terrable operates primarily on a directory that contains within it one or more module directories. For example:

+---modules
|   \---aws-lambda-function
|           main.tf
|           output.tf
|           variables.tf
|           policy.json
|
|   \---aws-dynamo-db-table
|           main.tf
|           output.tf
|           variables.tf

Here the root "modules" folder contains two modules "aws-lambda-function" and "aws-dynamo-db-table". To deploy these as modules via terrable to an S3 bucket execute the command from the parent directory of the modules folder:

$ terrable publish ./modules/ --bucket=<BUCKET_NAME> --profile=<AWS_PROFILE_NAME>

This command will iterate through each folder inside the modules directory and publish any that have changed since their previous publish. Any modules found not to have changed will be skipped. This can be overridden with the --force flag. It's also possible to publish only specific modules within that folder by including the --target=aws-lambda-function flag. This flag can be specified multiple times to publish a select number of specific modules for a given command.

To inspect modules, there is a list command:

$ terrable list <MODULE_NAME> --bucket=<BUCKET_NAME> --profile=<AWS_PROFILE_NAME>

This command will print all of the versions and associated metadata for the specified module.

About

Terraform private module manager that uses S3 as a backend. Includes simple versioning of modules to make forward migration easier. Mirrored from https://gitlab.com/rocket-boosters/terrable

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages