ec2

package
v1.35.6-cluster Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLabels

func GetLabels(sdc *SDConfig) ([]map[string]string, error)

GetLabels returns ec2 labels according to sdc.

Types

type IdentityDocument

type IdentityDocument struct {
	Region string
}

IdentityDocument is identity document returned from AWS metadata server.

See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html

type Instance

type Instance struct {
	PrivateIPAddress    string              `xml:"privateIpAddress"`
	Architecture        string              `xml:"architecture"`
	Placement           Placement           `xml:"placement"`
	ID                  string              `xml:"instanceId"`
	Lifecycle           string              `xml:"instanceLifecycle"`
	State               InstanceState       `xml:"instanceState"`
	Type                string              `xml:"instanceType"`
	Platform            string              `xml:"platform"`
	SubnetID            string              `xml:"subnetId"`
	PrivateDNSName      string              `xml:"privateDnsName"`
	PublicDNSName       string              `xml:"dnsName"`
	PublicIPAddress     string              `xml:"ipAddress"`
	VPCID               string              `xml:"vpcId"`
	NetworkInterfaceSet NetworkInterfaceSet `xml:"networkInterfaceSet"`
	TagSet              TagSet              `xml:"tagSet"`
}

Instance represents Instance from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Instance.html

type InstanceSet

type InstanceSet struct {
	Items []Instance `xml:"item"`
}

InstanceSet represents InstanceSet from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Reservation.html

type InstanceState

type InstanceState struct {
	Name string `xml:"name"`
}

InstanceState represents InstanceState from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_InstanceState.html

type InstancesResponse

type InstancesResponse struct {
	ReservationSet ReservationSet `xml:"reservationSet"`
	NextPageToken  string         `xml:"nextToken"`
}

InstancesResponse represents response to https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html

type NetworkInterface

type NetworkInterface struct {
	SubnetID string `xml:"subnetId"`
}

NetworkInterface represents NetworkInterface from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_InstanceNetworkInterface.html

type NetworkInterfaceSet

type NetworkInterfaceSet struct {
	Items []NetworkInterface `xml:"item"`
}

NetworkInterfaceSet represents NetworkInterfaceSet from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Instance.html

type Placement

type Placement struct {
	AvailabilityZone string `xml:"availabilityZone"`
}

Placement represents Placement from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Placement.html

type Reservation

type Reservation struct {
	OwnerID     string      `xml:"ownerId"`
	InstanceSet InstanceSet `xml:"instancesSet"`
}

Reservation represents Reservation from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Reservation.html

type ReservationSet

type ReservationSet struct {
	Items []Reservation `xml:"item"`
}

ReservationSet represetns ReservationSet from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html

type SDConfig

type SDConfig struct {
	Region    string `yaml:"region"`
	Endpoint  string `yaml:"endpoint"`
	AccessKey string `yaml:"access_key"`
	SecretKey string `yaml:"secret_key"`
	Profile   string `yaml:"profile"`
	// TODO: add support for RoleARN
	// RoleARN   string `yaml:"role_arn"`
	// RefreshInterval time.Duration `yaml:"refresh_interval"`
	// refresh_interval is obtained from `-promscrape.ec2SDCheckInterval` command-line option.
	Port    *int     `yaml:"port"`
	Filters []Filter `yaml:"filters"`
}

SDConfig represents service discovery config for ec2.

See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#ec2_sd_config

type Tag

type Tag struct {
	Key   string `xml:"key"`
	Value string `xml:"value"`
}

Tag represents Tag from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Tag.html

type TagSet

type TagSet struct {
	Items []Tag `xml:"item"`
}

TagSet represents TagSet from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Instance.html

Jump to

Keyboard shortcuts

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