Documentation ¶
Index ¶
Constants ¶
View Source
const ( SecurityCrednetialsResource = "iam/security-credentials/" InstanceIdentityDocumentResource = "instance-identity/document" InstanceIdentityDocumentSignatureResource = "instance-identity/signature" MacResource = "mac" VPCIDResourceFormat = "network/interfaces/macs/%s/vpc-id" SubnetIDResourceFormat = "network/interfaces/macs/%s/subnet-id" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EC2MetadataClient ¶
type EC2MetadataClient interface { DefaultCredentials() (*RoleCredentials, error) GetMetadata(string) (string, error) GetDynamicData(string) (string, error) InstanceIdentityDocument() (ec2metadata.EC2InstanceIdentityDocument, error) VPCID(mac string) (string, error) SubnetID(mac string) (string, error) PrimaryENIMAC() (string, error) GetUserData() (string, error) }
EC2MetadataClient is the client used to get metadata from instance metadata service
func NewBlackholeEC2MetadataClient ¶ added in v1.5.0
func NewBlackholeEC2MetadataClient() EC2MetadataClient
func NewEC2MetadataClient ¶
func NewEC2MetadataClient(client HttpClient) EC2MetadataClient
NewEC2MetadataClient creates an ec2metadata client to retrieve metadata
type HttpClient ¶
type MetadataError ¶ added in v1.14.5
type MetadataError struct {
// contains filtered or unexported fields
}
MetadataError is used to encapsulate the error returned because of non OK HTTP status codes in the response when querying the Instance Metadata Service
func NewMetadataError ¶ added in v1.14.5
func NewMetadataError(statusCode int) *MetadataError
NewMetadataError returns a new MetadataError object
func (*MetadataError) Error ¶ added in v1.14.5
func (err *MetadataError) Error() string
Error returns the error string
func (*MetadataError) GetStatusCode ¶ added in v1.14.5
func (err *MetadataError) GetStatusCode() int
GetStatusCode returns the http status code for the error from metadata
type RoleCredentials ¶
type RoleCredentials struct { Code string `json:"Code"` LastUpdated time.Time `json:"LastUpdated"` Type string `json:"Type"` AccessKeyId string `json:"AccessKeyId"` SecretAccessKey string `json:"SecretAccessKey"` Token string `json:"Token"` Expiration time.Time `json:"Expiration"` }
RoleCredentials contains the information associated with an IAM role
Source Files ¶
Click to show internal directories.
Click to hide internal directories.