Documentation ¶
Overview ¶
Code generated by "mapstructure-to-hcl2 -type SecurityGroupFilterOptions,OmiFilterOptions,SubnetFilterOptions,NetFilterOptions,BlockDevice"; DO NOT EDIT.
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 FlatBlockDevice
- type FlatNetFilterOptions
- type FlatOmiFilterOptions
- type FlatSecurityGroupFilterOptions
- type FlatSubnetFilterOptions
- 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 StepPublicIp
- 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 // StateData should store data such as GeneratedData // to be shared with post-processors StateData map[string]interface{} }
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) FlatMapstructure ¶ added in v1.4.5
func (*BlockDevice) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatBlockDevice. FlatBlockDevice is an auto-generated flat version of BlockDevice. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
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 FlatBlockDevice ¶ added in v1.4.5
type FlatBlockDevice struct { DeleteOnVmDeletion *bool `mapstructure:"delete_on_vm_deletion" cty:"delete_on_vm_deletion"` DeviceName *string `mapstructure:"device_name" cty:"device_name"` IOPS *int64 `mapstructure:"iops" cty:"iops"` NoDevice *bool `mapstructure:"no_device" cty:"no_device"` SnapshotId *string `mapstructure:"snapshot_id" cty:"snapshot_id"` VirtualName *string `mapstructure:"virtual_name" cty:"virtual_name"` VolumeType *string `mapstructure:"volume_type" cty:"volume_type"` VolumeSize *int64 `mapstructure:"volume_size" cty:"volume_size"` }
FlatBlockDevice is an auto-generated flat version of BlockDevice. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatNetFilterOptions ¶ added in v1.4.5
FlatNetFilterOptions is an auto-generated flat version of NetFilterOptions. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
func (*FlatNetFilterOptions) HCL2Spec ¶ added in v1.4.5
func (*FlatNetFilterOptions) HCL2Spec() map[string]hcldec.Spec
HCL2Spec returns the hcl spec of a NetFilterOptions. This spec is used by HCL to read the fields of NetFilterOptions. The decoded values from this spec will then be applied to a FlatNetFilterOptions.
type FlatOmiFilterOptions ¶ added in v1.4.5
type FlatOmiFilterOptions struct { Filters map[string]string `cty:"filters"` Owners []string `cty:"owners"` MostRecent *bool `mapstructure:"most_recent" cty:"most_recent"` }
FlatOmiFilterOptions is an auto-generated flat version of OmiFilterOptions. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
func (*FlatOmiFilterOptions) HCL2Spec ¶ added in v1.4.5
func (*FlatOmiFilterOptions) HCL2Spec() map[string]hcldec.Spec
HCL2Spec returns the hcl spec of a OmiFilterOptions. This spec is used by HCL to read the fields of OmiFilterOptions. The decoded values from this spec will then be applied to a FlatOmiFilterOptions.
type FlatSecurityGroupFilterOptions ¶ added in v1.4.5
FlatSecurityGroupFilterOptions is an auto-generated flat version of SecurityGroupFilterOptions. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
func (*FlatSecurityGroupFilterOptions) HCL2Spec ¶ added in v1.4.5
func (*FlatSecurityGroupFilterOptions) HCL2Spec() map[string]hcldec.Spec
HCL2Spec returns the hcl spec of a SecurityGroupFilterOptions. This spec is used by HCL to read the fields of SecurityGroupFilterOptions. The decoded values from this spec will then be applied to a FlatSecurityGroupFilterOptions.
type FlatSubnetFilterOptions ¶ added in v1.4.5
type FlatSubnetFilterOptions struct { Filters map[string]string `cty:"filters"` MostFree *bool `mapstructure:"most_free" cty:"most_free"` Random *bool `mapstructure:"random" cty:"random"` }
FlatSubnetFilterOptions is an auto-generated flat version of SubnetFilterOptions. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
func (*FlatSubnetFilterOptions) HCL2Spec ¶ added in v1.4.5
func (*FlatSubnetFilterOptions) HCL2Spec() map[string]hcldec.Spec
HCL2Spec returns the hcl spec of a SubnetFilterOptions. This spec is used by HCL to read the fields of SubnetFilterOptions. The decoded values from this spec will then be applied to a FlatSubnetFilterOptions.
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
func (*NetFilterOptions) FlatMapstructure ¶ added in v1.4.5
func (*NetFilterOptions) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatNetFilterOptions. FlatNetFilterOptions is an auto-generated flat version of NetFilterOptions. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
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) FlatMapstructure ¶ added in v1.4.5
func (*OmiFilterOptions) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatOmiFilterOptions. FlatOmiFilterOptions is an auto-generated flat version of OmiFilterOptions. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
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
func (*SecurityGroupFilterOptions) FlatMapstructure ¶ added in v1.4.5
func (*SecurityGroupFilterOptions) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatSecurityGroupFilterOptions. FlatSecurityGroupFilterOptions is an auto-generated flat version of SecurityGroupFilterOptions. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
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 StepPublicIp ¶ added in v1.5.2
type StepPublicIp struct { AssociatePublicIpAddress bool Comm *communicator.Config Debug bool // contains filtered or unexported fields }
func (*StepPublicIp) Cleanup ¶ added in v1.5.2
func (s *StepPublicIp) Cleanup(state multistep.StateBag)
func (*StepPublicIp) Run ¶ added in v1.5.2
func (s *StepPublicIp) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepRunSourceVm ¶
type StepRunSourceVm struct { 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
func (*SubnetFilterOptions) FlatMapstructure ¶ added in v1.4.5
func (*SubnetFilterOptions) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatSubnetFilterOptions. FlatSubnetFilterOptions is an auto-generated flat version of SubnetFilterOptions. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
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
- run_config.hcl2spec.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_public_ip.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