common

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2013 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SSHAddress

func SSHAddress(e *ec2.EC2, port int) func(map[string]interface{}) (string, error)

SSHAddress returns a function that can be given to the SSH communicator for determining the SSH address based on the instance DNS name.

func SSHConfig

func SSHConfig(username string) func(map[string]interface{}) (*gossh.ClientConfig, error)

SSHConfig returns a function that can be used for the SSH communicator config for connecting to the instance created over SSH using the generated private key.

func WaitForAMI

func WaitForAMI(c *ec2.EC2, imageId string) error

WaitForAMI waits for the given AMI ID to become ready.

func WaitForState

func WaitForState(conf *StateChangeConf) (i interface{}, err error)

WaitForState watches an object and waits for it to achieve a certain state.

Types

type AMIConfig added in v0.3.0

type AMIConfig struct {
	AMIName         string   `mapstructure:"ami_name"`
	AMIDescription  string   `mapstructure:"ami_description"`
	AMIUsers        []string `mapstructure:"ami_users"`
	AMIGroups       []string `mapstructure:"ami_groups"`
	AMIProductCodes []string `mapstructure:"ami_product_codes"`
}

AMIConfig is for common configuration related to creating AMIs.

func (*AMIConfig) Prepare added in v0.3.0

func (c *AMIConfig) Prepare(t *packer.ConfigTemplate) []error

type AccessConfig

type AccessConfig struct {
	AccessKey string `mapstructure:"access_key"`
	SecretKey string `mapstructure:"secret_key"`
	RawRegion string `mapstructure:"region"`
}

AccessConfig is for common configuration related to AWS access

func (*AccessConfig) Auth

func (c *AccessConfig) Auth() (aws.Auth, error)

Auth returns a valid aws.Auth object for access to AWS services, or an error if the authentication couldn't be resolved.

func (*AccessConfig) Prepare

func (c *AccessConfig) Prepare(t *packer.ConfigTemplate) []error

func (*AccessConfig) Region added in v0.2.2

func (c *AccessConfig) Region() (aws.Region, error)

Region returns the aws.Region object for access to AWS services, requesting the region from the instance metadata if possible.

type Artifact

type Artifact struct {
	// A map of regions to AMI IDs.
	Amis map[string]string

	// BuilderId is the unique ID for the builder that created this AMI
	BuilderIdValue string

	// EC2 connection for performing API stuff.
	Conn *ec2.EC2
}

Artifact is an artifact implementation that contains built AMIs.

func (*Artifact) BuilderId

func (a *Artifact) BuilderId() string

func (*Artifact) Destroy

func (a *Artifact) Destroy() error

func (*Artifact) Files

func (*Artifact) Files() []string

func (*Artifact) Id

func (a *Artifact) Id() string

func (*Artifact) String

func (a *Artifact) String() string

type BlockDevice added in v0.3.2

type BlockDevice struct {
	DeviceName          string `mapstructure:"device_name"`
	VirtualName         string `mapstructure:"virtual_name"`
	SnapshotId          string `mapstructure:"snapshot_id"`
	VolumeType          string `mapstructure:"volume_type"`
	VolumeSize          int64  `mapstructure:"volume_size"`
	DeleteOnTermination bool   `mapstructure:"delete_on_termination"`
	IOPS                int64  `mapstructure:"iops"`
}

BlockDevice

type BlockDevices added in v0.3.2

type BlockDevices struct {
	AMIMappings    []BlockDevice `mapstructure:"ami_block_device_mappings,squash"`
	LaunchMappings []BlockDevice `mapstructure:"launch_block_device_mappings,squash"`
}

func (*BlockDevices) BuildAMIDevices added in v0.3.2

func (b *BlockDevices) BuildAMIDevices() []ec2.BlockDeviceMapping

func (*BlockDevices) BuildLaunchDevices added in v0.3.2

func (b *BlockDevices) BuildLaunchDevices() []ec2.BlockDeviceMapping

type RunConfig

type RunConfig struct {
	SourceAmi          string `mapstructure:"source_ami"`
	IamInstanceProfile string `mapstructure:"iam_instance_profile"`
	InstanceType       string `mapstructure:"instance_type"`
	UserData           string `mapstructure:"user_data"`
	UserDataFile       string `mapstructure:"user_data_file"`
	RawSSHTimeout      string `mapstructure:"ssh_timeout"`
	SSHUsername        string `mapstructure:"ssh_username"`
	SSHPort            int    `mapstructure:"ssh_port"`
	SecurityGroupId    string `mapstructure:"security_group_id"`
	SubnetId           string `mapstructure:"subnet_id"`
	VpcId              string `mapstructure:"vpc_id"`
	// contains filtered or unexported fields
}

RunConfig contains configuration for running an instance from a source AMI and details on how to access that launched image.

func (*RunConfig) Prepare

func (c *RunConfig) Prepare(t *packer.ConfigTemplate) []error

func (*RunConfig) SSHTimeout

func (c *RunConfig) SSHTimeout() time.Duration

type StateChangeConf

type StateChangeConf struct {
	Conn      *ec2.EC2
	Pending   []string
	Refresh   StateRefreshFunc
	StepState map[string]interface{}
	Target    string
}

StateChangeConf is the configuration struct used for `WaitForState`.

type StateRefreshFunc added in v0.2.3

type StateRefreshFunc func() (result interface{}, state string, err error)

StateRefreshFunc is a function type used for StateChangeConf that is responsible for refreshing the item being watched for a state change.

It returns three results. `result` is any object that will be returned as the final object after waiting for state change. This allows you to return the final updated object, for example an EC2 instance after refreshing it.

`state` is the latest state of that object. And `err` is any error that may have happened while refreshing the state.

func InstanceStateRefreshFunc added in v0.2.2

func InstanceStateRefreshFunc(conn *ec2.EC2, i *ec2.Instance) StateRefreshFunc

InstanceStateRefreshFunc returns a StateRefreshFunc that is used to watch an EC2 instance.

type StepCreateTags added in v0.2.3

type StepCreateTags struct {
	Tags map[string]string
}

func (*StepCreateTags) Cleanup added in v0.2.3

func (s *StepCreateTags) Cleanup(state map[string]interface{})

func (*StepCreateTags) Run added in v0.2.3

func (s *StepCreateTags) Run(state map[string]interface{}) multistep.StepAction

type StepKeyPair

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

func (*StepKeyPair) Cleanup

func (s *StepKeyPair) Cleanup(state map[string]interface{})

func (*StepKeyPair) Run

func (s *StepKeyPair) Run(state map[string]interface{}) multistep.StepAction

type StepModifyAMIAttributes added in v0.3.0

type StepModifyAMIAttributes struct {
	Users        []string
	Groups       []string
	ProductCodes []string
	Description  string
}

func (*StepModifyAMIAttributes) Cleanup added in v0.3.0

func (s *StepModifyAMIAttributes) Cleanup(state map[string]interface{})

func (*StepModifyAMIAttributes) Run added in v0.3.0

func (s *StepModifyAMIAttributes) Run(state map[string]interface{}) multistep.StepAction

type StepRunSourceInstance

type StepRunSourceInstance struct {
	ExpectedRootDevice string
	InstanceType       string
	UserData           string
	UserDataFile       string
	SourceAMI          string
	IamInstanceProfile string
	SubnetId           string
	BlockDevices       BlockDevices
	// contains filtered or unexported fields
}

func (*StepRunSourceInstance) Cleanup

func (s *StepRunSourceInstance) Cleanup(state map[string]interface{})

func (*StepRunSourceInstance) Run

func (s *StepRunSourceInstance) Run(state map[string]interface{}) multistep.StepAction

type StepSecurityGroup

type StepSecurityGroup struct {
	SecurityGroupId string
	SSHPort         int
	VpcId           string
	// contains filtered or unexported fields
}

func (*StepSecurityGroup) Cleanup

func (s *StepSecurityGroup) Cleanup(state map[string]interface{})

func (*StepSecurityGroup) Run

func (s *StepSecurityGroup) Run(state map[string]interface{}) multistep.StepAction

Jump to

Keyboard shortcuts

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