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 forms 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 ¶
func IsValidRegion(promisedLand string, regions *ec2.DescribeRegionsOutput) bool
IsValidRegion tests for a vaild region name
Types ¶
type Client ¶
Client represents an IAM client.
func (*Client) AssumeRole ¶
func (iam *Client) AssumeRole(roleARN, externalID string, remoteIP string, sessionTTL time.Duration) (*Credentials, error)
AssumeRole returns an IAM role Credentials using AWS STS.
func (*Client) GetInstanceId ¶
Get InstanceId for healthcheck
Click to show internal directories.
Click to hide internal directories.