Documentation
¶
Index ¶
- Constants
- Variables
- func CreateTags(conn *oapi.Client, resourceID string, ui packer.Ui, tags OAPITags) error
- func SSHHost(e oapiDescriber, sshInterface string) func(multistep.StateBag) (string, error)
- func WaitUntilImageAvailable(conn *oapi.Client, imageID string) error
- func WaitUntilSnapshotCompleted(conn *oapi.Client, id string) error
- func WaitUntilSnapshotDone(conn *oapi.Client, snapshotID string) error
- func WaitUntilVolumeAvailable(conn *oapi.Client, volumeID string) error
- func WaitUntilVolumeIsLinked(conn *oapi.Client, volumeID string) error
- func WaitUntilVolumeIsUnlinked(conn *oapi.Client, volumeID string) error
- type AccessConfig
- type Artifact
- type BlockDevice
- type BlockDevices
- type BuildInfoTemplate
- type LaunchBlockDevices
- type NetFilterOptions
- type OAPITags
- type OMIBlockDevices
- type OMIConfig
- type OmiFilterOptions
- type RunConfig
- type SecurityGroupFilterOptions
- type StepCleanupVolumes
- type StepCreateTags
- type StepDeregisterOMI
- type StepGetPassword
- type StepKeyPair
- type StepNetworkInfo
- type StepPreValidate
- type StepRunSourceVm
- type StepSecurityGroup
- type StepSourceOMIInfo
- type StepStopBSUBackedVm
- type StepUpdateBSUBackedVm
- type StepUpdateOMIAttributes
- type SubnetFilterOptions
- type TagMap
Constants ¶
const ( // VolumeTypeStandard is a VolumeType enum value VolumeTypeStandard = "standard" // VolumeTypeIo1 is a VolumeType enum value VolumeTypeIo1 = "io1" // VolumeTypeGp2 is a VolumeType enum value VolumeTypeGp2 = "gp2" // VolumeTypeSc1 is a VolumeType enum value VolumeTypeSc1 = "sc1" // VolumeTypeSt1 is a VolumeType enum value VolumeTypeSt1 = "st1" )
const (
RunSourceVmBSUExpectedRootDevice = "ebs"
)
Variables ¶
var TemplateFuncs = template.FuncMap{
"clean_resource_name": templateCleanResourceName,
}
Functions ¶
func CreateTags ¶
func SSHHost ¶
SSHHost returns a function that can be given to the SSH communicator for determining the SSH address based on the vm DNS name.
func WaitUntilImageAvailable ¶
func WaitUntilVolumeIsLinked ¶
Types ¶
type AccessConfig ¶
type AccessConfig struct {
AccessKey string `mapstructure:"access_key"`
CustomEndpointOAPI string `mapstructure:"custom_endpoint_oapi"`
InsecureSkipTLSVerify bool `mapstructure:"insecure_skip_tls_verify"`
MFACode string `mapstructure:"mfa_code"`
ProfileName string `mapstructure:"profile"`
RawRegion string `mapstructure:"region"`
SecretKey string `mapstructure:"secret_key"`
SkipValidation bool `mapstructure:"skip_region_validation"`
SkipMetadataApiCheck bool `mapstructure:"skip_metadata_api_check"`
Token string `mapstructure:"token"`
// contains filtered or unexported fields
}
AccessConfig is for common configuration related to Outscale API access
func (*AccessConfig) Config ¶
func (c *AccessConfig) Config() (*oapi.Config, error)
Config returns a valid oapi.Config object for access to Outscale services, or an error if the authentication and region couldn't be resolved
func (*AccessConfig) NewOAPIConnection ¶
func (c *AccessConfig) NewOAPIConnection() (oapi.OAPIClient, error)
func (*AccessConfig) Prepare ¶
func (c *AccessConfig) Prepare(ctx *interpolate.Context) []error
func (*AccessConfig) ValidateRegion ¶
func (c *AccessConfig) ValidateRegion(regions ...string) error
ValidateRegion returns true if the supplied region is a valid Outscale region and false if it's not.
type Artifact ¶
type Artifact struct {
// A map of regions to OMI IDs.
Omis map[string]string
// BuilderId is the unique ID for the builder that created this OMI
BuilderIdValue string
// OAPI connection for performing API stuff.
Config *oapi.Config
}
Artifact is an artifact implementation that contains built OMIs.
type BlockDevice ¶
type BlockDevice struct {
DeleteOnVmDeletion bool `mapstructure:"delete_on_vm_deletion"`
DeviceName string `mapstructure:"device_name"`
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
func (*BlockDevice) Prepare ¶
func (b *BlockDevice) Prepare(ctx *interpolate.Context) error
type BlockDevices ¶
type BlockDevices struct {
OMIBlockDevices `mapstructure:",squash"`
LaunchBlockDevices `mapstructure:",squash"`
}
func (*BlockDevices) Prepare ¶
func (b *BlockDevices) Prepare(ctx *interpolate.Context) (errs []error)
type BuildInfoTemplate ¶
type LaunchBlockDevices ¶
type LaunchBlockDevices struct {
LaunchMappings []BlockDevice `mapstructure:"launch_block_device_mappings"`
}
func (*LaunchBlockDevices) BuildLaunchDevices ¶
func (b *LaunchBlockDevices) BuildLaunchDevices() []oapi.BlockDeviceMappingVmCreation
type NetFilterOptions ¶
func (*NetFilterOptions) Empty ¶
func (d *NetFilterOptions) Empty() bool
type OAPITags ¶
type OAPITags []oapi.ResourceTag
type OMIBlockDevices ¶
type OMIBlockDevices struct {
OMIMappings []BlockDevice `mapstructure:"omi_block_device_mappings"`
}
func (*OMIBlockDevices) BuildOMIDevices ¶
func (b *OMIBlockDevices) BuildOMIDevices() []oapi.BlockDeviceMappingImage
type OMIConfig ¶
type OMIConfig struct {
OMIName string `mapstructure:"omi_name"`
OMIDescription string `mapstructure:"omi_description"`
OMIVirtType string `mapstructure:"omi_virtualization_type"`
OMIAccountIDs []string `mapstructure:"omi_account_ids"`
OMIGroups []string `mapstructure:"omi_groups"`
OMIProductCodes []string `mapstructure:"omi_product_codes"`
OMIRegions []string `mapstructure:"omi_regions"`
OMISkipRegionValidation bool `mapstructure:"skip_region_validation"`
OMITags TagMap `mapstructure:"tags"`
OMIForceDeregister bool `mapstructure:"force_deregister"`
OMIForceDeleteSnapshot bool `mapstructure:"force_delete_snapshot"`
SnapshotTags TagMap `mapstructure:"snapshot_tags"`
SnapshotAccountIDs []string `mapstructure:"snapshot_account_ids"`
SnapshotGroups []string `mapstructure:"snapshot_groups"`
}
OMIConfig is for common configuration related to creating OMIs.
func (*OMIConfig) Prepare ¶
func (c *OMIConfig) Prepare(accessConfig *AccessConfig, ctx *interpolate.Context) []error
type OmiFilterOptions ¶
type OmiFilterOptions struct {
Filters map[string]string
Owners []string
MostRecent bool `mapstructure:"most_recent"`
}
func (*OmiFilterOptions) Empty ¶
func (d *OmiFilterOptions) Empty() bool
func (*OmiFilterOptions) NoOwner ¶
func (d *OmiFilterOptions) NoOwner() bool
type RunConfig ¶
type RunConfig struct {
AssociatePublicIpAddress bool `mapstructure:"associate_public_ip_address"`
Subregion string `mapstructure:"subregion_name"`
BlockDurationMinutes int64 `mapstructure:"block_duration_minutes"`
DisableStopVm bool `mapstructure:"disable_stop_vm"`
BsuOptimized bool `mapstructure:"bsu_optimized"`
EnableT2Unlimited bool `mapstructure:"enable_t2_unlimited"`
IamVmProfile string `mapstructure:"iam_vm_profile"`
VmInitiatedShutdownBehavior string `mapstructure:"shutdown_behavior"`
VmType string `mapstructure:"vm_type"`
SecurityGroupFilter SecurityGroupFilterOptions `mapstructure:"security_group_filter"`
RunTags map[string]string `mapstructure:"run_tags"`
SecurityGroupId string `mapstructure:"security_group_id"`
SecurityGroupIds []string `mapstructure:"security_group_ids"`
SourceOmi string `mapstructure:"source_omi"`
SourceOmiFilter OmiFilterOptions `mapstructure:"source_omi_filter"`
SpotPrice string `mapstructure:"spot_price"`
SpotPriceAutoProduct string `mapstructure:"spot_price_auto_product"`
SpotTags map[string]string `mapstructure:"spot_tags"`
SubnetFilter SubnetFilterOptions `mapstructure:"subnet_filter"`
SubnetId string `mapstructure:"subnet_id"`
TemporaryKeyPairName string `mapstructure:"temporary_key_pair_name"`
TemporarySGSourceCidr string `mapstructure:"temporary_security_group_source_cidr"`
UserData string `mapstructure:"user_data"`
UserDataFile string `mapstructure:"user_data_file"`
NetFilter NetFilterOptions `mapstructure:"net_filter"`
NetId string `mapstructure:"net_id"`
WindowsPasswordTimeout time.Duration `mapstructure:"windows_password_timeout"`
// Communicator settings
Comm communicator.Config `mapstructure:",squash"`
SSHInterface string `mapstructure:"ssh_interface"`
}
RunConfig contains configuration for running an vm from a source AMI and details on how to access that launched image.
type SecurityGroupFilterOptions ¶
func (*SecurityGroupFilterOptions) Empty ¶
func (d *SecurityGroupFilterOptions) Empty() bool
type StepCleanupVolumes ¶
type StepCleanupVolumes struct {
BlockDevices BlockDevices
}
stepCleanupVolumes cleans up any orphaned volumes that were not designated to remain after termination of the vm. These volumes are typically ones that are marked as "delete on terminate:false" in the source_ami of a build.
func (*StepCleanupVolumes) Cleanup ¶
func (s *StepCleanupVolumes) Cleanup(state multistep.StateBag)
func (*StepCleanupVolumes) Run ¶
func (s *StepCleanupVolumes) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepCreateTags ¶
type StepCreateTags struct {
Tags TagMap
SnapshotTags TagMap
Ctx interpolate.Context
}
func (*StepCreateTags) Cleanup ¶
func (s *StepCreateTags) Cleanup(state multistep.StateBag)
func (*StepCreateTags) Run ¶
func (s *StepCreateTags) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepDeregisterOMI ¶
type StepDeregisterOMI struct {
AccessConfig *AccessConfig
ForceDeregister bool
ForceDeleteSnapshot bool
OMIName string
Regions []string
}
func (*StepDeregisterOMI) Cleanup ¶
func (s *StepDeregisterOMI) Cleanup(state multistep.StateBag)
func (*StepDeregisterOMI) Run ¶
func (s *StepDeregisterOMI) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepGetPassword ¶
type StepGetPassword struct {
Debug bool
Comm *communicator.Config
Timeout time.Duration
BuildName string
}
StepGetPassword reads the password from a Windows server and sets it on the WinRM config.
func (*StepGetPassword) Cleanup ¶
func (s *StepGetPassword) Cleanup(multistep.StateBag)
func (*StepGetPassword) Run ¶
func (s *StepGetPassword) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepKeyPair ¶
type StepKeyPair struct {
Debug bool
Comm *communicator.Config
DebugKeyPath string
// contains filtered or unexported fields
}
func (*StepKeyPair) Cleanup ¶
func (s *StepKeyPair) Cleanup(state multistep.StateBag)
func (*StepKeyPair) Run ¶
func (s *StepKeyPair) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepNetworkInfo ¶
type StepNetworkInfo struct {
NetId string
NetFilter NetFilterOptions
SubnetId string
SubnetFilter SubnetFilterOptions
SubregionName string
SecurityGroupIds []string
SecurityGroupFilter SecurityGroupFilterOptions
}
StepNetworkInfo queries OUTSCALE for information about NET's and Subnets that is used throughout the OMI creation process.
Produces (adding them to the state bag):
vpc_id string - the NET ID subnet_id string - the Subnet ID availability_zone string - the Subregion name
func (*StepNetworkInfo) Cleanup ¶
func (s *StepNetworkInfo) Cleanup(multistep.StateBag)
func (*StepNetworkInfo) Run ¶
func (s *StepNetworkInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepPreValidate ¶
StepPreValidate provides an opportunity to pre-validate any configuration for the build before actually doing any time consuming work
func (*StepPreValidate) Cleanup ¶
func (s *StepPreValidate) Cleanup(multistep.StateBag)
func (*StepPreValidate) Run ¶
func (s *StepPreValidate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepRunSourceVm ¶
type StepRunSourceVm struct {
AssociatePublicIpAddress bool
BlockDevices BlockDevices
Comm *communicator.Config
Ctx interpolate.Context
Debug bool
BsuOptimized bool
EnableT2Unlimited bool
ExpectedRootDevice string
IamVmProfile string
VmInitiatedShutdownBehavior string
VmType string
IsRestricted bool
SourceOMI string
Tags TagMap
UserData string
UserDataFile string
VolumeTags TagMap
// contains filtered or unexported fields
}
func (*StepRunSourceVm) Cleanup ¶
func (s *StepRunSourceVm) Cleanup(state multistep.StateBag)
func (*StepRunSourceVm) Run ¶
func (s *StepRunSourceVm) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepSecurityGroup ¶
type StepSecurityGroup struct {
CommConfig *communicator.Config
SecurityGroupFilter SecurityGroupFilterOptions
SecurityGroupIds []string
TemporarySGSourceCidr string
// contains filtered or unexported fields
}
func (*StepSecurityGroup) Cleanup ¶
func (s *StepSecurityGroup) Cleanup(state multistep.StateBag)
func (*StepSecurityGroup) Run ¶
func (s *StepSecurityGroup) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepSourceOMIInfo ¶
type StepSourceOMIInfo struct {
SourceOmi string
OMIVirtType string
OmiFilters OmiFilterOptions
}
StepSourceOMIInfo extracts critical information from the source OMI that is used throughout the OMI creation process.
Produces:
source_image *oapi.Image - the source OMI info
func (*StepSourceOMIInfo) Cleanup ¶
func (s *StepSourceOMIInfo) Cleanup(multistep.StateBag)
func (*StepSourceOMIInfo) Run ¶
func (s *StepSourceOMIInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepStopBSUBackedVm ¶
func (*StepStopBSUBackedVm) Cleanup ¶
func (s *StepStopBSUBackedVm) Cleanup(multistep.StateBag)
func (*StepStopBSUBackedVm) Run ¶
func (s *StepStopBSUBackedVm) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepUpdateBSUBackedVm ¶
func (*StepUpdateBSUBackedVm) Cleanup ¶
func (s *StepUpdateBSUBackedVm) Cleanup(state multistep.StateBag)
func (*StepUpdateBSUBackedVm) Run ¶
func (s *StepUpdateBSUBackedVm) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepUpdateOMIAttributes ¶
type StepUpdateOMIAttributes struct {
AccountIds []string
SnapshotAccountIds []string
Ctx interpolate.Context
}
func (*StepUpdateOMIAttributes) Cleanup ¶
func (s *StepUpdateOMIAttributes) Cleanup(state multistep.StateBag)
func (*StepUpdateOMIAttributes) Run ¶
func (s *StepUpdateOMIAttributes) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type SubnetFilterOptions ¶
type SubnetFilterOptions struct {
Filters map[string]string
MostFree bool `mapstructure:"most_free"`
Random bool `mapstructure:"random"`
}
func (*SubnetFilterOptions) Empty ¶
func (d *SubnetFilterOptions) Empty() bool
Source Files
¶
- access_config.go
- artifact.go
- block_device.go
- build_filters.go
- interpolate_build_info.go
- omi_config.go
- regions.go
- run_config.go
- ssh.go
- state.go
- step_cleanup_volumes.go
- step_create_tags.go
- step_deregister_omi.go
- step_get_password.go
- step_key_pair.go
- step_network_info.go
- step_pre_validate.go
- step_run_source_vm.go
- step_security_group.go
- step_source_omi_info.go
- step_stop_bsu_backed_vm.go
- step_update_bsu_vm.go
- step_update_omi.go
- tags.go
- temp_const.go
- template_funcs.go