Code Monkey home page Code Monkey logo

iam-policy-json-to-terraform's Introduction

iam-policy-json-to-terraform

Build StatusRelease

Small tool to convert an IAM Policy in JSON format into a Terraform aws_iam_policy_document

Installation

OSX

$ brew install iam-policy-json-to-terraform

Other

Download the latest binary from the releases page and put it into your PATH under the name iam-policy-json-to-terraform

Developer

If you're a go developer and have your GOPATH defined and have added your $GOPATH/bin directory to your path, you can simply run this command.

$ go get github.com/flosell/iam-policy-json-to-terraform

Usage

From raw JSON

$ echo '{"Statement":[{"Effect":"Allow","Action":["ec2:Describe*"],"Resource":"*"}]}' | iam-policy-json-to-terraform
data "aws_iam_policy_document" "policy" {
  statement {
    sid       = ""
    effect    = "Allow"
    resources = ["*"]
    actions   = ["ec2:Describe*"]
  }
}

From a JSON policy file

$ iam-policy-json-to-terraform < some-policy.json

Local development

Prerequisites

  • Clone the repository to a location of your choosing:

    $ git clone [email protected]:flosell/iam-policy-json-to-terraform.git
  • Install dependencies and tools:

    $ cd iam-policy-json-to-terraform
    $ make tools

Development

make is your primary point of entry for any development activity. Call it without arguments to learn more:

$ make
build                          Test and build the whole application
clean                          Remove build artifacts
fmt                            Format code
fmtcheck                       Run linter
test-readme                    Run the commands mentioned in the README for sanity-checking
test                           Run all tests
tools                          Install additional required tooling

iam-policy-json-to-terraform's People

Contributors

flosell avatar nitrocode avatar felixb avatar gliptak avatar stephengroat avatar stephengroat-dd avatar

Watchers

James Cloos 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.