-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
41 lines (36 loc) · 1.04 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package main
import (
"flag"
"fmt"
"github.com/preset-io/mpc-init/generator"
"github.com/preset-io/mpc-init/generator/cloudformation"
"github.com/preset-io/mpc-init/generator/terraform"
)
const policiesPath = "./generator/iam/policies"
func main() {
var PolicyRoleMap = []*generator.PolicyRoleMapping{
{
ResourceName: "clientAccessPolicy",
PolicyName: "client-access-management",
RoleRef: "clientAccessRole",
}, {
ResourceName: "infraPolicy",
PolicyName: "infra",
RoleRef: "workspaceProvisionerRole",
}, {
ResourceName: "provisionerPolicy",
PolicyName: "preset-provision-workspaces",
RoleRef: "workspaceProvisionerRole",
},
}
tf := flag.Bool("tf", false, "Generate Terraform")
cfn := flag.Bool("cfn", false, "Generate CloudFormation")
flag.Parse()
if *tf {
terraform.GenTf(PolicyRoleMap, policiesPath)
} else if *cfn {
cloudformation.GenCfn(PolicyRoleMap, policiesPath)
} else {
fmt.Println("Please specify either -tf or -cfn")
}
}