Version: v0.2.15 Latest Latest

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

Go to latest
Published: Oct 5, 2021 License: Apache-2.0 Imports: 18 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type AWS

type AWS struct {
	// contains filtered or unexported fields

func New

func New() AWS

New awsIMDS client

func (*AWS) AccountID

func (aws *AWS) AccountID() (string, error)

AccountID - get the account ID of the running instance

func (*AWS) CreateEndpoint

func (aws *AWS) CreateEndpoint(request *types.CreateEndpointRequest) (*types.Endpoint, error)

func (*AWS) DeleteEndpoint

func (awsInstance *AWS) DeleteEndpoint(ctx context.Context, endpointID string) error

1. Delete Endpoint if exists 2. Delete security group If we fail we fail

func (*AWS) DeleteSecurityGroup added in v0.2.1

func (awsInstance *AWS) DeleteSecurityGroup(ctx context.Context, securityGroupID string) error

func (*AWS) GetEndpoint

func (aws *AWS) GetEndpoint(request *types.CreateEndpointRequest) (*types.Endpoint, error)

func (*AWS) GetMetadata

func (aws *AWS) GetMetadata() (types.Metadata, error)

func (*AWS) GetProvider added in v0.1.1

func (c *AWS) GetProvider() types.Vendor

func (*AWS) InstanceDynamicData

func (aws *AWS) InstanceDynamicData() (*DynamicData, error)

InstanceDynamicData - convenient instance dynamic data accessor

func (*AWS) LoadDynamicData

func (aws *AWS) LoadDynamicData() (*DynamicData, error)

LoadDynamicData - load typed dynamic data

func (*AWS) LoadInstanceMetadata

func (aws *AWS) LoadInstanceMetadata() (*Instance, error)

LoadInstanceMetadata - load typed instance metadata

func (*AWS) RecursiveLoad

func (aws *AWS) RecursiveLoad() map[string]interface{}

RecursiveLoad - load recursively all the metadata

func (*AWS) Subnets

func (client *AWS) Subnets() []string

Subnets - get subnet ids

type BlockDeviceMapping

type BlockDeviceMapping struct {
	Ami        string `json:"ami"`
	Ebs1       string `json:"ebs1"`
	Ebs2       string `json:"ebs2"`
	Ebs3       string `json:"ebs3"`
	Ebs4       string `json:"ebs4"`
	Ebs5       string `json:"ebs5"`
	Ebs6       string `json:"ebs6"`
	Ebs7       string `json:"ebs7"`
	Ephemeral0 string `json:"ephemeral0"`
	Ephemeral1 string `json:"ephemeral1"`
	Ephemeral2 string `json:"ephemeral2"`
	Ephemeral3 string `json:"ephemeral3"`
	Root       string `json:"root"`
	Swap       string `json:"swap"`

BlockDeviceMapping - Block device mapping

type Document

type Document struct {
	DevpayProductCodes      string   `json:"devpayProductCodes"`
	MarketplaceProductCodes []string `json:"marketplaceProductCodes"`
	AvailabilityZone        string   `json:"availabilityZone"`
	PrivateIP               string   `json:"privateIp"`
	Version                 string   `json:"version"`
	InstanceID              string   `json:"instanceId"`
	BillingProducts         string   `json:"billingProducts"`
	InstanceType            string   `json:"instanceType"`
	AccountID               string   `json:"accountId"`
	ImageID                 string   `json:"imageId"`
	PendingTime             string   `json:"pendingTime"`
	Architecture            string   `json:"architecture"`
	KernelID                string   `json:"kernelId"`
	RamdiskID               string   `json:"ramdiskId"`
	Region                  string   `json:"region"`

Document holds more verbose information about the instance like accountID.

type DynamicData

type DynamicData struct {
	InstanceIdentity InstanceIdentity `json:"instance-identity"`

DynamicData info

type Events

type Events struct {
	Maintenance Maintenance `json:"maintenance"`

Events events

type IAM

type IAM struct {
	Info string `json:"info"`

IAM role

type Instance

type Instance struct {
	AmiID              string             `json:"ami-id"`
	AmiLaunchIndex     string             `json:"ami-launch-index"`
	AmiManifestPath    string             `json:"ami-manifest-path"`
	BlockDeviceMapping BlockDeviceMapping `json:"block-device-mapping"`
	Events             Events             `json:"events"`
	Hostname           string             `json:"hostname"`
	IAM                IAM                `json:"iam"`
	InstanceAction     string             `json:"instance-action"`
	InstanceID         string             `json:"instance-id"`
	InstanceLifeCycle  string             `json:"instance-life-cycle"`
	InstanceType       string             `json:"instance-type"`
	KernelID           string             `json:"kernel-id"`
	LocalHostname      string             `json:"local-hostname"`
	LocalIPv4          string             `json:"local-ipv4"`
	Mac                string             `json:"mac"`
	Network            Network            `json:"network"`
	Placement          Placement          `json:"placement"`
	ProductCodes       string             `json:"product-codes"`
	PublicHostname     string             `json:"public-hostname"`
	PublicIPv4         string             `json:"public-ipv4"`
	RamdiskID          string             `json:"ramdisk-id"`
	ReservationID      string             `json:"reservation-id"`
	SecurityGroups     string             `json:"security-groups"`
	Services           Services           `json:"services"`
	Spot               Spot               `json:"spot"`

Instance - Azure instance metadata

func (*Instance) Subnets

func (i *Instance) Subnets() []string

Subnets - get subnets

func (*Instance) VPCs

func (i *Instance) VPCs() []string

type InstanceIdentity

type InstanceIdentity struct {
	Document  Document `json:"document"`
	Dsa2048   string   `json:"dsa2048"`
	Pkcs7     string   `json:"pkcs7"`
	Rsa2048   string   `json:"rsa2048"`
	Signature string   `json:"signature"`

InstanceIdentity path

type Interfaces

type Interfaces struct {
	Macs map[string]Mac `json:"macs"`

Interfaces description

type Mac

type Mac struct {
	DeviceNumber     string `json:"device-number"`
	InterfaceID      string `json:"interface-id"`
	LocalHostname    string `json:"local-hostname"`
	Mac              string `json:"mac"`
	NetworkCardIndex string `json:"network-card-index"`
	OwnerID          string `json:"owner-id"`
	PublicHostname   string `json:"public-hostname"`
	SecurityGroups   string `json:"security-groups"`
	SubnetID         string `json:"subnet-id"`
	VPCID            string `json:"vpc-id"`

Mac - Mac interface description

type Maintenance

type Maintenance struct {
	History   string `json:"history"`
	Scheduled string `json:"scheduled"`

Maintenance description

type Network

type Network struct {
	Interfaces Interfaces `json:"interfaces"`

Network description

type Placement

type Placement struct {
	AvailabilityZone   string `json:"availability-zone"`
	AvailabilityZoneID string `json:"availability-zone-id"`
	GroupName          string `json:"group-name"`
	HostID             string `json:"host-id"`
	PartitionNumber    int    `json:"partition-number"`
	Region             string `json:"region"`

Placement info

type Services

type Services struct {
	Domain    string `json:"domain"`
	Partition string `json:"partition"`

Services info

type Spot

type Spot struct {
	InstanceAction  string `json:"instance-action"`
	TerminationTime string `json:"termination-time"`

Spot info

Jump to

Keyboard shortcuts

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