ec2

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// CloudProviderName contains the inventory name of for EC2
	CloudProviderName = "AWS"
)

declare these as vars not const to ease testing

Functions

func GetClusterName

func GetClusterName() (string, error)

GetClusterName returns the name of the cluster containing the current EC2 instance

func GetHostname

func GetHostname() (string, error)

GetHostname fetches the hostname for current host from the EC2 metadata API

func GetInstanceID

func GetInstanceID() (string, error)

GetInstanceID fetches the instance id for current host from the EC2 metadata API

func GetLocalIPv4

func GetLocalIPv4() ([]string, error)

GetLocalIPv4 gets the local IPv4 for the currently running host using the EC2 metadata API. Returns a []string to implement the HostIPProvider interface expected in pkg/process/util

func GetNetworkID

func GetNetworkID() (string, error)

GetNetworkID retrieves the network ID using the EC2 metadata endpoint. For EC2 instances, the the network ID is the VPC ID, if the instance is found to be a part of exactly one VPC.

func GetTags

func GetTags() ([]string, error)

GetTags grabs the host tags from the EC2 api

func HostnameProvider

func HostnameProvider() (string, error)

HostnameProvider gets the hostname

func IsDefaultHostname

func IsDefaultHostname(hostname string) bool

IsDefaultHostname returns whether the given hostname is a default one for EC2

func IsDefaultHostnameForIntake

func IsDefaultHostnameForIntake(hostname string) bool

IsDefaultHostnameForIntake returns whether the given hostname is a default one for EC2 for the intake

func IsRunningOn

func IsRunningOn() bool

IsRunningOn returns true if the agent is running on AWS

func IsWindowsDefaultHostname

func IsWindowsDefaultHostname(hostname string) bool

IsWindowsDefaultHostname returns whether the given hostname is a Windows default one for EC2 (starts with 'ec2amaz-')

Types

This section is empty.

Jump to

Keyboard shortcuts

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