Documentation ¶
Overview ¶
Package ec2 provides an interface to EC2 instances, that are polled from the API. It manages a local cache, which is updated periodically.
Index ¶
Constants ¶
View Source
const ( InstanceStatePending = "pending" InstanceStateRunning = "running" InstanceStateTerminated = "terminated" InstanceStateShuttingDown = "shutting-down" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Run executes the EC2 API poller. It will update the instance cache // periodically. Run(context.Context) error // List returns all EC2 Instances that are currently in the cache. Those // instance cache will be updated in the background. List() []Instance // SignalEmitter gets triggered every time the cache changes. See syncutil // package for more information. SignalEmitter() *syncutil.SignalEmitter // Healthy indicates whether the background job is running correctly. Healthy() bool }
Client is an interface to EC2 data.
type Instance ¶
type Instance struct { InstanceID string `logfield:"instance-id,omitempty"` InstanceName string `logfield:"instance-name"` NodeName string `logfield:"node-name,omitempty"` InstanceType string `logfield:"instance-type"` AvailabilityZone string `logfield:"availability-zone"` InstanceLifecycle string `logfield:"ec2-instance-lifecycle"` State string `logfield:"ec2-instance-state"` LaunchTime time.Time `logfield:"ec2-launch-time"` TerminationTime *time.Time `logfield:"ec2-termination-time,omitempty"` }
Instance is the instance-related data that is retrieved via API.
Click to show internal directories.
Click to hide internal directories.