NewSTSAssumeRole returns a pointer to a new Credentials object wrapping the STSAssumeRole.
(stsEndpoint string, opts STSAssumeRoleOptions)
| 111 | // NewSTSAssumeRole returns a pointer to a new |
| 112 | // Credentials object wrapping the STSAssumeRole. |
| 113 | func NewSTSAssumeRole(stsEndpoint string, opts STSAssumeRoleOptions) (*Credentials, error) { |
| 114 | if opts.AccessKey == "" || opts.SecretKey == "" { |
| 115 | return nil, errors.New("AssumeRole credentials access/secretkey is mandatory") |
| 116 | } |
| 117 | return New(&STSAssumeRole{ |
| 118 | STSEndpoint: stsEndpoint, |
| 119 | Options: opts, |
| 120 | }), nil |
| 121 | } |
| 122 | |
| 123 | const defaultDurationSeconds = 3600 |
| 124 |