Skip to main content

A CLI tool to analyze Terraform plan files, and prevent unallowed resources deletions and drop/create actions.

Project description

Terrasafe

https://github.com/PrismeaOpsTeam/Terrasafe

Terrasafe provide a way to secure your automated terraform pipeline and fail if an unauthorized deletion is planned.

Usage

terraform plan -out=tfplan
terraform show -json tfplan | terrasafe --config terrasafe.json
terraform apply --auto-approve tfplan

Configuration

The --config option allows to specify the path of the JSON configuration file.

{
  "ignore_deletion": [ "aws_ecs_task_definition*" ], // Resource can be deleted
  "ignore_deletion_if_recreation": [ "aws_ecs_task_definition*"], // Resource can be replaced
  "unauthorized_deletion": [ "aws_ecs_task_definition*" ] // Resource can't be deleted by any way
}

How to delete a resource ?

  • Comment it
  • Or rename the file with the extension .tf.disabled
  • Or define the Env var TERRASAFE_ALLOW_DELETION to the addresses of resources to delete, separated by ;. Example: export TERRASAFE_ALLOW_DELETION=aws_ecs_task_definition.a;aws_lambda.b

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terrasafe-0.5.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terrasafe-0.5.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file terrasafe-0.5.1.tar.gz.

File metadata

  • Download URL: terrasafe-0.5.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for terrasafe-0.5.1.tar.gz
Algorithm Hash digest
SHA256 4d1a2a9899a6dfaed6d1b909af4e3ae82f943e1b96f55211c7c6ee81721e2fd7
MD5 1aecab95ffea1a4f49a2f24b67fe7d28
BLAKE2b-256 372d232bf08f23785b7c2fb6bdba67c0707b5fee1231fd3c6563397a97818ab1

See more details on using hashes here.

File details

Details for the file terrasafe-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: terrasafe-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for terrasafe-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1fa5eeb53d6019183f95251f73cde68161aadcf69204138a047615690453419f
MD5 70d4b07a7a96fb0f9195960d3aa78b33
BLAKE2b-256 6ed80f8e8925238059727dda1d105bbf3419a4fee299a1d765e897eb19fada22

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page