GithubHelp home page GithubHelp logo

jepsenwan / cf2tf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dontshavetheyak/cf2tf

0.0 1.0 0.0 385 KB

Convert Cloudformation templates to Terraform.

License: GNU General Public License v3.0

Python 98.00% Dockerfile 2.00%

cf2tf's Introduction

Python Latest Tests Coverage License


Cloudformation 2 Terraform

Convert your Cloudformation templates to Terraform.
Report Bug · Request Feature ·

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. Contact
  7. Acknowledgements

About The Project

cf2tf is a CLI tool that attempts to convert Cloudformation to Terraform. We say attempt because it's not really possible to make the conversion with 100% accuracy (currently) because of several reasons mostly around converting a Map value in Cloudformation to the correct value in HCL.

Getting Started

Prerequisites

Cloudformation 2 Terraform requires python >= 3.7

Installation

cf2tf is available as an easy to install pip package.

pip install cf2tf

Usage

To convert a template to terraform.

cf2tf my_template.yaml

This above command will dump all the terraform resources to stdout. You might want to save the results:

cf2tf my_template.yaml > main.tf

If you prefer to have each resource in its own file then:

cf2tf my_template.yaml -o some_dir

If some_dir doesn't exist, then it will be created for you. Then each resource type will be saved to a specific file (variables.tf, outputs.tf etc.).

Roadmap

  • Better conversion of Cloudformation Maps to Terraform (Maps, Block and json)
  • Allow overides for specific resources
  • Handle more advanced Cloudformation parameter types like SSM/Secrets manager
  • Better handling of Recources/Properties that failed conversion
  • Only download files needed, not entire terraform source code (200MB)

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

This project uses poetry to manage dependencies and pre-commit to run formatting, linting and tests. You will need to have both installed to your system as well as python 3.9.

  1. Fork the Project

  2. Setup the environment.
    This project uses vscode devcontainer to provide a completly configured development environment. If you are using vscode and have the remote container extension installed, you should be asked to use the devcontainer when you open this project inside of vscode.

    If you are not using devcontainers then you will need to have python installed. Install the poetry, nox, nox_poetry and pre-commit packages. Then run poetry install and pre-commit install commands.

    Most of the steps can be found in the Dockerfile.

  3. Create your Feature Branch (git checkout -b feature/AmazingFeature)

  4. Commit your Changes (git commit -m 'Add some AmazingFeature')

  5. Push to the Branch (git push origin feature/AmazingFeature)

  6. Open a Pull Request

Contact

Levi - @shady_cuz

Acknowledgements

cf2tf's People

Contributors

shadycuz avatar renovate[bot] avatar dependabot[bot] avatar brad-alexander avatar evanniedojadlo avatar pogzyb avatar thaiphv avatar tommywo avatar

Watchers

 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.