cloud_metadata

package
v0.0.0-...-44558b4 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AWS     Cloud = "aws"
	GCE           = "gce"
	Unknown       = "unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSInstanceInfo

type AWSInstanceInfo struct {
	IdentityDocument ec2metadata.EC2InstanceIdentityDocument `json:"identity_document"`
	IAMInfo          ec2metadata.EC2IAMInfo                  `json:"iam_info"`
	SecurityGroups   []string                                `json:"security_groups"`
	PublicIPv4       string                                  `json:"public_ipv4"`
	PublicHostname   string                                  `json:"public_hostname"`
	MAC              string                                  `json:"mac"`
	VPCId            string                                  `json:"vpc_id"`
	SubnetId         string                                  `json:"subnet_id"`
	SSHKey           string                                  `json:"ssh_key"`
}

some additional data along with the Instance Document from the Metadata

func GetAWSInstanceInfo

func GetAWSInstanceInfo() (instanceInfo *AWSInstanceInfo, err error)

TODO: possibly

type Cloud

type Cloud string

func CloudService

func CloudService() (Cloud, error)

Do some checks to return the name of cloud env or error This isn't the most secure way to do it. In theory you should check the Document with the signature against the AWS's public certificate this is okay for short term deployments

Jump to

Keyboard shortcuts

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