iamfast-go

command module
v0.0.0-...-fa5ce14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 10 Imported by: 0

README

JavaScriptPythonGoJavaVS Code

iamfast (Go)

🚧 EXPERIMENTAL - WORK IN PROGRESS 🚧

IAM policy generation from application code

Installation

go install

Usage

iamfast-go yourfile.go

Example

> cat go/tests/test1.go
package main

import (
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/s3"
)

func main() {
	sess, err := session.NewSession(&aws.Config{
		Region: aws.String("us-west-2")},
	)

	// Create S3 service client
	svc := s3.New(sess)

	// Create the S3 Bucket
	_, err = svc.CreateBucket(&s3.CreateBucketInput{
		Bucket: aws.String("abucket"),
	})
	if err != nil {
		panic(err)
	}
}
> iamfast-go tests/test1.go
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "s3:CreateBucket",
            "Resource": [
                "*"
            ]
        }
    ]
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL