Documentation ¶
Index ¶
- Variables
- func GetClusterName(ctx context.Context) (string, error)
- func GetHostname(ctx context.Context) (string, error)
- func GetInstanceID(ctx context.Context) (string, error)
- func GetLocalIPv4() ([]string, error)
- func GetNTPHosts(ctx context.Context) []string
- func GetNetworkID(ctx context.Context) (string, error)
- func GetPublicIPv4(ctx context.Context) (string, error)
- func GetTags(ctx context.Context) ([]string, error)
- func HostnameProvider(ctx context.Context, options map[string]interface{}) (string, error)
- func IsDefaultHostname(hostname string) bool
- func IsDefaultHostnameForIntake(hostname string) bool
- func IsRunningOn(ctx context.Context) bool
- func IsWindowsDefaultHostname(hostname string) bool
- type Subnet
Constants ¶
This section is empty.
Variables ¶
var (
// CloudProviderName contains the inventory name of for EC2
CloudProviderName = "AWS"
)
declare these as vars not const to ease testing
Functions ¶
func GetClusterName ¶
GetClusterName returns the name of the cluster containing the current EC2 instance
func GetHostname ¶
GetHostname fetches the hostname for current host from the EC2 metadata API
func GetInstanceID ¶
GetInstanceID fetches the instance id for current host from the EC2 metadata API
func GetLocalIPv4 ¶
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 GetNTPHosts ¶ added in v0.9.0
GetNTPHosts returns the NTP hosts for EC2 if it is detected as the cloud provider, otherwise an empty array. Docs: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html#configure_ntp
func GetNetworkID ¶
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 GetPublicIPv4 ¶ added in v0.9.0
GetPublicIPv4 gets the public IPv4 for the currently running host using the EC2 metadata API.
func HostnameProvider ¶
HostnameProvider gets the hostname
func IsDefaultHostname ¶
IsDefaultHostname returns whether the given hostname is a default one for EC2
func IsDefaultHostnameForIntake ¶
IsDefaultHostnameForIntake returns whether the given hostname is a default one for EC2 for the intake
func IsRunningOn ¶
IsRunningOn returns true if the agent is running on AWS
func IsWindowsDefaultHostname ¶
IsWindowsDefaultHostname returns whether the given hostname is a Windows default one for EC2 (starts with 'ec2amaz-')
Types ¶
type Subnet ¶ added in v0.9.0
Subnet stores information about an AWS subnet
func GetSubnetForHardwareAddr ¶ added in v0.9.0
func GetSubnetForHardwareAddr(ctx context.Context, hwAddr net.HardwareAddr) (subnet Subnet, err error)
GetSubnetForHardwareAddr returns info about the subnet associated with a hardware address (mac address) on the current host