Documentation ¶
Index ¶
- Variables
- func SSHAddress(e *ec2.EC2, port int, private bool) func(multistep.StateBag) (string, error)
- func SSHConfig(username string) func(multistep.StateBag) (*ssh.ClientConfig, error)
- func WaitForState(conf *StateChangeConf) (i interface{}, err error)
- type AMIConfig
- type AccessConfig
- type Artifact
- type BlockDevice
- type BlockDevices
- type RunConfig
- type StateChangeConf
- type StateRefreshFunc
- type StepAMIRegionCopy
- type StepCreateTags
- type StepKeyPair
- type StepModifyAMIAttributes
- type StepRunSourceInstance
- type StepSecurityGroup
- type StepSourceAMIInfo
Constants ¶
This section is empty.
Variables ¶
var TemplateFuncs = template.FuncMap{
"clean_ami_name": templateCleanAMIName,
}
Functions ¶
func SSHAddress ¶
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 ¶
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 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 ¶
type AMIConfig struct { AMIName string `mapstructure:"ami_name"` AMIDescription string `mapstructure:"ami_description"` AMIVirtType string `mapstructure:"ami_virtualization_type"` AMIUsers []string `mapstructure:"ami_users"` AMIGroups []string `mapstructure:"ami_groups"` AMIProductCodes []string `mapstructure:"ami_product_codes"` AMIRegions []string `mapstructure:"ami_regions"` AMITags map[string]string `mapstructure:"tags"` AMIEnhancedNetworking bool `mapstructure:"enhanced_networking"` }
AMIConfig is for common configuration related to creating AMIs.
type AccessConfig ¶
type AccessConfig struct { AccessKey string `mapstructure:"access_key"` SecretKey string `mapstructure:"secret_key"` RawRegion string `mapstructure:"region"` Token string `mapstructure:"token"` }
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
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.
type BlockDevice ¶
type BlockDevice struct { DeleteOnTermination bool `mapstructure:"delete_on_termination"` DeviceName string `mapstructure:"device_name"` Encrypted bool `mapstructure:"encrypted"` IOPS int64 `mapstructure:"iops"` NoDevice bool `mapstructure:"no_device"` SnapshotId string `mapstructure:"snapshot_id"` VirtualName string `mapstructure:"virtual_name"` VolumeType string `mapstructure:"volume_type"` VolumeSize int64 `mapstructure:"volume_size"` }
BlockDevice
type BlockDevices ¶
type BlockDevices struct { AMIMappings []BlockDevice `mapstructure:"ami_block_device_mappings"` LaunchMappings []BlockDevice `mapstructure:"launch_block_device_mappings"` }
func (*BlockDevices) BuildAMIDevices ¶
func (b *BlockDevices) BuildAMIDevices() []ec2.BlockDeviceMapping
func (*BlockDevices) BuildLaunchDevices ¶
func (b *BlockDevices) BuildLaunchDevices() []ec2.BlockDeviceMapping
func (*BlockDevices) Prepare ¶
func (b *BlockDevices) Prepare(t *packer.ConfigTemplate) []error
type RunConfig ¶
type RunConfig struct { AssociatePublicIpAddress bool `mapstructure:"associate_public_ip_address"` AvailabilityZone string `mapstructure:"availability_zone"` IamInstanceProfile string `mapstructure:"iam_instance_profile"` InstanceType string `mapstructure:"instance_type"` RunTags map[string]string `mapstructure:"run_tags"` SourceAmi string `mapstructure:"source_ami"` SpotPrice string `mapstructure:"spot_price"` SpotPriceAutoProduct string `mapstructure:"spot_price_auto_product"` RawSSHTimeout string `mapstructure:"ssh_timeout"` SSHUsername string `mapstructure:"ssh_username"` SSHPrivateKeyFile string `mapstructure:"ssh_private_key_file"` SSHPrivateIp bool `mapstructure:"ssh_private_ip"` SSHPort int `mapstructure:"ssh_port"` SecurityGroupId string `mapstructure:"security_group_id"` SecurityGroupIds []string `mapstructure:"security_group_ids"` SubnetId string `mapstructure:"subnet_id"` TemporaryKeyPairName string `mapstructure:"temporary_key_pair_name"` UserData string `mapstructure:"user_data"` UserDataFile string `mapstructure:"user_data_file"` 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) SSHTimeout ¶
type StateChangeConf ¶
type StateChangeConf struct { Pending []string Refresh StateRefreshFunc StepState multistep.StateBag Target string }
StateChangeConf is the configuration struct used for `WaitForState`.
type StateRefreshFunc ¶
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 AMIStateRefreshFunc ¶
func AMIStateRefreshFunc(conn *ec2.EC2, imageId string) StateRefreshFunc
AMIStateRefreshFunc returns a StateRefreshFunc that is used to watch an AMI for state changes.
func InstanceStateRefreshFunc ¶
func InstanceStateRefreshFunc(conn *ec2.EC2, i *ec2.Instance) StateRefreshFunc
InstanceStateRefreshFunc returns a StateRefreshFunc that is used to watch an EC2 instance.
func SpotRequestStateRefreshFunc ¶
func SpotRequestStateRefreshFunc(conn *ec2.EC2, spotRequestId string) StateRefreshFunc
SpotRequestStateRefreshFunc returns a StateRefreshFunc that is used to watch a spot request for state changes.
type StepAMIRegionCopy ¶
type StepAMIRegionCopy struct {
Regions []string
}
func (*StepAMIRegionCopy) Cleanup ¶
func (s *StepAMIRegionCopy) Cleanup(state multistep.StateBag)
func (*StepAMIRegionCopy) Run ¶
func (s *StepAMIRegionCopy) Run(state multistep.StateBag) multistep.StepAction
type StepCreateTags ¶
func (*StepCreateTags) Cleanup ¶
func (s *StepCreateTags) Cleanup(state multistep.StateBag)
func (*StepCreateTags) Run ¶
func (s *StepCreateTags) Run(state multistep.StateBag) multistep.StepAction
type StepKeyPair ¶
type StepKeyPair struct { Debug bool DebugKeyPath string KeyPairName string PrivateKeyFile string // contains filtered or unexported fields }
func (*StepKeyPair) Cleanup ¶
func (s *StepKeyPair) Cleanup(state multistep.StateBag)
func (*StepKeyPair) Run ¶
func (s *StepKeyPair) Run(state multistep.StateBag) multistep.StepAction
type StepModifyAMIAttributes ¶
type StepModifyAMIAttributes struct { Users []string Groups []string ProductCodes []string Description string }
func (*StepModifyAMIAttributes) Cleanup ¶
func (s *StepModifyAMIAttributes) Cleanup(state multistep.StateBag)
func (*StepModifyAMIAttributes) Run ¶
func (s *StepModifyAMIAttributes) Run(state multistep.StateBag) multistep.StepAction
type StepRunSourceInstance ¶
type StepRunSourceInstance struct { AssociatePublicIpAddress bool AvailabilityZone string BlockDevices BlockDevices Debug bool ExpectedRootDevice string InstanceType string IamInstanceProfile string SourceAMI string SpotPrice string SpotPriceProduct string SubnetId string Tags map[string]string UserData string UserDataFile string // contains filtered or unexported fields }
func (*StepRunSourceInstance) Cleanup ¶
func (s *StepRunSourceInstance) Cleanup(state multistep.StateBag)
func (*StepRunSourceInstance) Run ¶
func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepAction
type StepSecurityGroup ¶
type StepSecurityGroup struct { SecurityGroupIds []string SSHPort int VpcId string // contains filtered or unexported fields }
func (*StepSecurityGroup) Cleanup ¶
func (s *StepSecurityGroup) Cleanup(state multistep.StateBag)
func (*StepSecurityGroup) Run ¶
func (s *StepSecurityGroup) Run(state multistep.StateBag) multistep.StepAction
type StepSourceAMIInfo ¶
StepSourceAMIInfo extracts critical information from the source AMI that is used throughout the AMI creation process.
Produces:
source_image *ec2.Image - the source AMI info
func (*StepSourceAMIInfo) Cleanup ¶
func (s *StepSourceAMIInfo) Cleanup(multistep.StateBag)
func (*StepSourceAMIInfo) Run ¶
func (s *StepSourceAMIInfo) Run(state multistep.StateBag) multistep.StepAction