Skip to main content

Terraform Support for AWS DevOps Guru

Project description

tfdevops

Terraform support for Amazon DevOps Guru. The service natively only supports AWS CloudFormation stacks. https://aws.amazon.com/devops-guru/features/

This project provides support for terraform users by automatically converting terraform state to an imported CloudFormation stack and optionally enabling it with DevOps guru.

Note Amazon DevOps Guru only supports roughly 25 resources. https://aws.amazon.com/devops-guru/pricing/

How it works

  • Translates terraform state into a CloudFormation template with a retain deletion policy
  • Creates a CloudFormation stack with imported resources
  • Enrolls the stack into Amazon DevOps Guru

Usage

Install it.

pip install tfdevops

You've got a deployed terraform root module extant, let's generate a CloudFormation template and a set of importable resources for it

tfdevops cfn -d ~/path/to/terraform/module --template mycfn.json --resources importable-ids.json

And now we can go ahead and create a CloudFormation stack, import resources, and activate DevOps Guru on our stack.

tfdevops deploy --template mycfn.json --resources importable-ids.json
...
INFO:tfdevops:Found existing stack, state:IMPORT_COMPLETE
INFO:tfdevops:Creating import change set, 8 resources to import
INFO:tfdevops:Executing change set to import resources
INFO:tfdevops:Waiting for import to complete
INFO:tfdevops:Cloudformation Stack Deployed - Terraform resources imported

You can now visit the stack in the DevOps Guru dashboard.

Depending on the level activity of the resources it can take DevOps Guru a few hours to generate any actionable insight.

As a bonus, we can validate the generated template (or any other pure CloudFormation template, aka sans intrinsics funcs or vars ), with the following command, which will download the jsonschema for the various resource types and validate each template resource against its schema.

tfdevops validate --template mycfn.json

Large Resource/Templates

AWS CloudFormation has various size limitations (50k api upload, 500k s3 upload) on the resource size it supports, both the gen and deploy subcommands support passing in an s3 path for the template and some resources which have larger configuration (step function workflows, etc). Note the s3 path for deploy is the actual template path.

FAQ

  1. Is this a generic terraform to CloudFormation converter?

No, while it has some facilities that resemble that, its very targeted at simply producing enough cfn to make Amazon DevOps Guru work.

Supported resources

At the moment tfdevops supports the following resources

  • AWS::StepFunctions::StateMachine
  • AWS::ECS::Service
  • AWS::SQS::Queue
  • AWS::SNS::Topic
  • AWS::RDS::DBInstance
  • AWS::Lambda::Function
  • AWS::Events::Rule
  • AWS::DynamoDB::Table

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

tfdevops-0.1.1.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

tfdevops-0.1.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file tfdevops-0.1.1.tar.gz.

File metadata

  • Download URL: tfdevops-0.1.1.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.4 Linux/5.11.0-40-generic

File hashes

Hashes for tfdevops-0.1.1.tar.gz
Algorithm Hash digest
SHA256 620a50e6b22c7f3be9548edce41053778a1ceffb120b4e4d8a5d4ac2e53fe013
MD5 282c417fd71254a79fff348557fcefd2
BLAKE2b-256 c059b7b9082b9e170eef8e1a1822bb83abf14c7b58c53af39b182d22f2ecce4b

See more details on using hashes here.

File details

Details for the file tfdevops-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tfdevops-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.4 Linux/5.11.0-40-generic

File hashes

Hashes for tfdevops-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 318599563d13c6ff1108aa5883c1643750c5657a29049734af3e89561f188c56
MD5 21a58dfcd30506a6d08531f6378376fe
BLAKE2b-256 2a506f173ce8df0e97be58d452f9c6ee696857b6a027ffa58663104c7b9dfddb

See more details on using hashes here.

Supported by

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