Skip to main content

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

Release files for tfdevops 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tfdevops 0.1.1
File Size Uploaded
tfdevops-0.1.1.tar.gz 12.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tfdevops 0.1.1
File Interpreter ABI Platform
tfdevops-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 25.7 kB

Release files / tfdevops-0.1.1.tar.gz

Download URL tfdevops-0.1.1.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
620a50e6b22c7f3be9548edce41053778a1ceffb120b4e4d8a5d4ac2e53fe013
BLAKE2b-256 checksum
How to use checksums
c059b7b9082b9e170eef8e1a1822bb83abf14c7b58c53af39b182d22f2ecce4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.9.4 Linux/5.11.0-40-generic

Release files / tfdevops-0.1.1-py3-none-any.whl

Download URL tfdevops-0.1.1-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
318599563d13c6ff1108aa5883c1643750c5657a29049734af3e89561f188c56
BLAKE2b-256 checksum
How to use checksums
2a506f173ce8df0e97be58d452f9c6ee696857b6a027ffa58663104c7b9dfddb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.9.4 Linux/5.11.0-40-generic

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page