Skip to content

Commit

Permalink
spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWoolfenden committed Sep 2, 2022
1 parent d3fd14b commit 6ab09c2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/gcp_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var policyGCPTemplate []byte

// GCPPolicy create an IAM policy
func GCPPolicy(permissions []string) (string, error) {
test := strings.Join(permissions, "\", \n\t \"")
test := strings.Join(permissions, "\",\n \"")

type GCPPolicyDetails struct {
Name string
Expand Down
8 changes: 7 additions & 1 deletion src/readme.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ func Readme(dirName string, output string, init bool) error {
if err2 != nil {
return err2
}
markdown := "\nThe Policy required is:\n\n```json\n" + Policy + "\n```\n"

var markdown string
if init {
markdown = "\nThe Terraform resource required is:\n\n```golang\n" + Policy + "\n```\n"
} else {
markdown = "\nThe Policy required is:\n\n```json\n" + Policy + "\n```\n"
}
err := ReplaceSection(file, markdown)

return err
Expand Down
6 changes: 3 additions & 3 deletions src/terraform.gcppolicy.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resource "google_project_iam_custom_role" "{{.Name}}" {
role_id = "{{.RoleID}}"
title = "{{.Name}}"
description = "A user with least privileges"
permissions= [
"{{ .Permissions }}"
]
permissions = [
"{{ .Permissions }}"
]
}

0 comments on commit 6ab09c2

Please sign in to comment.