ec2

package
v1.63.0-cluster Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SDCheckInterval = flag.Duration("promscrape.ec2SDCheckInterval", time.Minute, "Interval for checking for changes in ec2. "+
	"This works only if ec2_sd_configs is configured in '-promscrape.config' file. "+
	"See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#ec2_sd_config for details")

SDCheckInterval defines interval for targets refresh.

Functions

This section is empty.

Types

type AssumeRoleResponse added in v1.41.1

type AssumeRoleResponse struct {
	AssumeRoleResult struct {
		Credentials assumeCredentials
	}
	AssumeRoleWithWebIdentityResult struct {
		Credentials assumeCredentials
	}
}

AssumeRoleResponse represents AssumeRole response

See https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html

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"`
	ImageID             string              `xml:"imageId"`
	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 Ipv6AddressesSet added in v1.48.0

type Ipv6AddressesSet struct {
	Items []string `xml:"item"`
}

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

type MetadataSecurityCredentials added in v1.41.1

type MetadataSecurityCredentials struct {
	AccessKeyID     string    `json:"AccessKeyId"`
	SecretAccessKey string    `json:"SecretAccessKey"`
	Token           string    `json:"Token"`
	Expiration      time.Time `json:"Expiration"`
}

MetadataSecurityCredentials represents credentials obtained from http://169.254.169.254/latest/meta-data/iam/security-credentials/*

See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html

type NetworkInterface

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

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,omitempty"`
	Endpoint  string `yaml:"endpoint,omitempty"`
	AccessKey string `yaml:"access_key,omitempty"`
	SecretKey string `yaml:"secret_key,omitempty"`
	// TODO add support for Profile, not working atm
	Profile string `yaml:"profile,omitempty"`
	RoleARN string `yaml:"role_arn,omitempty"`
	// RefreshInterval time.Duration `yaml:"refresh_interval"`
	// refresh_interval is obtained from `-promscrape.ec2SDCheckInterval` command-line option.
	Port    *int     `yaml:"port,omitempty"`
	Filters []Filter `yaml:"filters,omitempty"`
}

SDConfig represents service discovery config for ec2.

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

func (*SDConfig) GetLabels added in v1.55.0

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

GetLabels returns ec2 labels according to sdc.

func (*SDConfig) MustStop added in v1.55.0

func (sdc *SDConfig) MustStop()

MustStop stops further usage for sdc.

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