Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ARNRegexp = regexp.MustCompile(`^arn:(\w|-)*:iam::\d+:role\/?(\w+|-|\/|\.)*$`)
ARNRegexp is the regex to check that the base ARN is valid, see http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns.
Functions ¶
func GetBaseArn ¶
GetBaseArn get the base ARN from metadata service.
func GetEndpointFromRegion ¶
GetEndpointFromRegion formas a standard sts endpoint url given a region
func GetInstanceIAMRole ¶
GetInstanceIAMRole get instance IAM role from metadata service.
func IsValidBaseARN ¶
IsValidBaseARN validates that the base ARN is valid.
func IsValidRegion ¶
IsValidRegion tests for a vaild region name
Types ¶
type Client ¶
Client represents an IAM client.
func (*Client) AssumeRole ¶
func (iam *Client) AssumeRole(roleARN, remoteIP string, sessionTTL time.Duration) (*Credentials, error)
AssumeRole returns an IAM role Credentials using AWS STS.
func (*Client) EndpointFor ¶
func (iam *Client) EndpointFor(service, region string, optFns ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error)
EndpointFor implements the endpoints.Resolver interface for use with sts
Click to show internal directories.
Click to hide internal directories.