Skip to content

Commit

Permalink
fix createInstancePolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
Tenyo Grozev committed Mar 31, 2022
1 parent 2733e51 commit c36c41a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions api/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,31 @@ func instanceCreatePolicy() (string, error) {
Effect: "Allow",
Action: []string{
"ec2:RunInstances",
"iam:PassRole",
},
Resource: []string{"*"},
},
},
}

j, err := json.Marshal(policy)
if err != nil {
return "", err
}

return string(j), nil
}

func instanceDeletePolicy(id string) (string, error) {
log.Debugf("generating instance delete policy document")

policy := iam.PolicyDocument{
Version: "2012-10-17",
Statement: []iam.StatementEntry{
{
Effect: "Allow",
Action: []string{
"ec2:TerminateInstances",
},
Resource: []string{"*"},
},
Expand Down

0 comments on commit c36c41a

Please sign in to comment.