instance

package
v0.0.0-...-a355528 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VolumeTag is the AWS tag name used to associate unique identifiers (instance.VolumeID) with volumes.
	VolumeTag = "docker-infrakit-volume"

	// AttachmentEBSVolume is the type name used in instance.Attachment
	AttachmentEBSVolume = "ebs"
)
View Source
const (
	// MetadataAmiID - AMI ID
	MetadataAmiID = MetadataKey("http://169.254.169.254/latest/meta-data/ami-id")

	// MetadataInstanceID - Instance ID
	MetadataInstanceID = MetadataKey("http://169.254.169.254/latest/meta-data/instance-id")

	// MetadataInstanceType - Instance type
	MetadataInstanceType = MetadataKey("http://169.254.169.254/latest/meta-data/instance-type")

	// MetadataHostname - Host name
	MetadataHostname = MetadataKey("http://169.254.169.254/latest/meta-data/hostname")

	// MetadataLocalIPv4 - Local IPv4 address
	MetadataLocalIPv4 = MetadataKey("http://169.254.169.254/latest/meta-data/local-ipv4")

	// MetadataPublicIPv4 - Public IPv4 address
	MetadataPublicIPv4 = MetadataKey("http://169.254.169.254/latest/meta-data/public-ipv4")

	// MetadataAvailabilityZone - Availability zone
	MetadataAvailabilityZone = MetadataKey("http://169.254.169.254/latest/meta-data/placement/availability-zone")
)

Variables

This section is empty.

Functions

func GetLogger

func GetLogger() aws.Logger

GetLogger gets a logger that can be used with the AWS SDK.

func GetMetadata

func GetMetadata(key MetadataKey) (string, error)

GetMetadata returns the value of the metadata by key

func GetRegion

func GetRegion() (string, error)

GetRegion returns the AWS region this instance is in.

func NewAutoScalingGroupPlugin

func NewAutoScalingGroupPlugin(client autoscalingiface.AutoScalingAPI, namespaceTags map[string]string) instance.Plugin

NewAutoScalingGroupPlugin returns a plugin.

func NewInstancePlugin

func NewInstancePlugin(client ec2iface.EC2API, namespaceTags map[string]string) instance.Plugin

NewInstancePlugin creates a new plugin that creates instances in AWS EC2.

func NewInstanceProfilePlugin

func NewInstanceProfilePlugin(client iamiface.IAMAPI, namespaceTags map[string]string) instance.Plugin

NewInstanceProfilePlugin returns a plugin.

func NewInternetGatewayPlugin

func NewInternetGatewayPlugin(client ec2iface.EC2API, namespaceTags map[string]string) instance.Plugin

NewInternetGatewayPlugin returns a plugin.

func NewLaunchConfigurationPlugin

func NewLaunchConfigurationPlugin(client autoscalingiface.AutoScalingAPI, namespaceTags map[string]string) instance.Plugin

NewLaunchConfigurationPlugin returns a plugin.

func NewLoadBalancerPlugin

func NewLoadBalancerPlugin(client elbiface.ELBAPI, namespaceTags map[string]string) instance.Plugin

NewLoadBalancerPlugin returns a plugin.

func NewLogGroupPlugin

func NewLogGroupPlugin(client cloudwatchlogsiface.CloudWatchLogsAPI, namespaceTags map[string]string) instance.Plugin

NewLogGroupPlugin returns a plugin.

func NewQueuePlugin

func NewQueuePlugin(client sqsiface.SQSAPI, namespaceTags map[string]string) instance.Plugin

NewQueuePlugin returns a plugin.

func NewRolePlugin

func NewRolePlugin(client iamiface.IAMAPI, namespaceTags map[string]string) instance.Plugin

NewRolePlugin returns a plugin.

func NewRouteTablePlugin

func NewRouteTablePlugin(client ec2iface.EC2API, namespaceTags map[string]string) instance.Plugin

NewRouteTablePlugin returns a plugin.

func NewSecurityGroupPlugin

func NewSecurityGroupPlugin(client ec2iface.EC2API, namespaceTags map[string]string) instance.Plugin

NewSecurityGroupPlugin returns a plugin.

func NewSpotInstancePlugin

func NewSpotInstancePlugin(client ec2iface.EC2API, namespaceTags map[string]string) instance.Plugin

NewSpotInstancePlugin creates a new plugin that creates spot instances in AWS EC2.

func NewSubnetPlugin

func NewSubnetPlugin(client ec2iface.EC2API, namespaceTags map[string]string) instance.Plugin

NewSubnetPlugin returns a plugin.

func NewTablePlugin

func NewTablePlugin(client dynamodbiface.DynamoDBAPI, namespaceTags map[string]string) instance.Plugin

NewTablePlugin returns a plugin.

func NewVolumePlugin

func NewVolumePlugin(client ec2iface.EC2API, namespaceTags map[string]string) instance.Plugin

NewVolumePlugin returns a plugin.

func NewVpcPlugin

func NewVpcPlugin(client ec2iface.EC2API, namespaceTags map[string]string) instance.Plugin

NewVpcPlugin returns a plugin.

Types

type Builder

type Builder struct {
	Config  client.ConfigProvider
	Options Options
}

Builder is a ProvisionerBuilder that creates an AWS instance provisioner.

func (*Builder) BuildInstancePlugin

func (b *Builder) BuildInstancePlugin(namespaceTags map[string]string) (instance.Plugin, error)

BuildInstancePlugin creates an instance Provisioner configured with the Flags.

func (*Builder) Flags

func (b *Builder) Flags() *pflag.FlagSet

Flags returns the flags required.

type CreateInstanceRequest

type CreateInstanceRequest struct {
	Tags               map[string]string
	RunInstancesInput  ec2.RunInstancesInput
	AttachVolumeInputs []ec2.AttachVolumeInput
}

CreateInstanceRequest is the concrete provision request type.

type CreateSpotInstanceRequest

type CreateSpotInstanceRequest struct {
	Tags                      map[string]string
	RequestSpotInstancesInput ec2.RequestSpotInstancesInput
	AttachVolumeInputs        []ec2.AttachVolumeInput
}

CreateSpotInstanceRequest is the concrete provision request type.

type ErrExceededAttempts

type ErrExceededAttempts struct {
	// contains filtered or unexported fields
}

ErrExceededAttempts is error when attempts have exceeded given threshold.

func (*ErrExceededAttempts) Error

func (e *ErrExceededAttempts) Error() string

type ErrInvalidRequest

type ErrInvalidRequest struct{}

ErrInvalidRequest is error for invalid request from the client.

func (*ErrInvalidRequest) Error

func (e *ErrInvalidRequest) Error() string

type ErrUnexpectedResponse

type ErrUnexpectedResponse struct{}

ErrUnexpectedResponse is error when the API call violates contract and has unexpected results.

func (*ErrUnexpectedResponse) Error

func (e *ErrUnexpectedResponse) Error() string

type MetadataKey

type MetadataKey string

MetadataKey is the identifier for a metadata entry.

func MetadataKeyFromSlice

func MetadataKeyFromSlice(p []string) MetadataKey

MetadataKeyFromSlice returns a new metadata key with the given path, prefixed by the http://hostport/prefix

type Monitor

type Monitor struct {

	// Plugin is the instance plugin to use
	Plugin instance.Plugin
	// contains filtered or unexported fields
}

Monitor implements the event spi -- just just calls the Describe to get a list of known instances, and report anything it hasn't seen before, or if anything that disappeared.

func (*Monitor) Init

func (m *Monitor) Init() event.Plugin

Init initializes the event plugin and starts working

func (*Monitor) List

func (m *Monitor) List(topic types.Path) ([]string, error)

List returns the nodes under the given topic

func (*Monitor) PublishOn

func (m *Monitor) PublishOn(c chan<- *event.Event)

PublishOn sets the channel to publish on

func (*Monitor) Stop

func (m *Monitor) Stop()

Stop stops the monitor

type Options

type Options struct {
	Region          string
	AccessKeyID     string
	SecretAccessKey string
	SessionToken    string
	Retries         int
}

Options contain the options for aws plugin

Jump to

Keyboard shortcuts

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