MCPcopy Create free account
hub / github.com/coldbrewcloud/coldbrew-cli / RetrieveRole

Method RetrieveRole

aws/iam/client.go:24–44  ·  view source on GitHub ↗
(roleName string)

Source from the content-addressed store, hash-verified

22}
23
24func (c *Client) RetrieveRole(roleName string) (*_iam.Role, error) {
25 if roleName == "" {
26 return nil, errors.New("roleName is empty")
27 }
28
29 params := &_iam.GetRoleInput{
30 RoleName: _aws.String(roleName),
31 }
32
33 res, err := c.svc.GetRole(params)
34 if err != nil {
35 if reqFail, ok := err.(awserr.RequestFailure); ok {
36 if reqFail.StatusCode() == http.StatusNotFound {
37 return nil, nil
38 }
39 }
40 return nil, err
41 }
42
43 return res.Role, nil
44}
45
46func (c *Client) CreateRole(assumeRolePolicyDocument, roleName string) (*_iam.Role, error) {
47 if assumeRolePolicyDocument == "" {

Callers 4

RunMethod · 0.80
isClusterAvailableMethod · 0.80
RunMethod · 0.80
RunMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected