ec2

package
v1.14.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2017 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 4 more Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecurityCrednetialsResource               = "iam/security-credentials/"
	InstanceIdentityDocumentResource          = "instance-identity/document"
	InstanceIdentityDocumentSignatureResource = "instance-identity/signature"
)

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)
}

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 HttpClient interface {
	GetMetadata(string) (string, error)
	GetDynamicData(string) (string, error)
	GetInstanceIdentityDocument() (ec2metadata.EC2InstanceIdentityDocument, error)
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL