common

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2020 License: MPL-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Code generated by "mapstructure-to-hcl2 -type SecurityGroupFilterOptions,OmiFilterOptions,SubnetFilterOptions,NetFilterOptions,BlockDevice"; DO NOT EDIT.

Index

Constants

View Source
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"
)
View Source
const (
	RunSourceVmBSUExpectedRootDevice = "ebs"
)

Variables

View Source
var TemplateFuncs = template.FuncMap{
	"clean_resource_name": templateCleanResourceName,
}

Functions

func CreateTags

func CreateTags(conn *oapi.Client, resourceID string, ui packer.Ui, tags OAPITags) error

func SSHHost

func SSHHost(e oapiDescriber, sshInterface string) func(multistep.StateBag) (string, error)

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 WaitUntilImageAvailable(conn *oapi.Client, imageID string) error

func WaitUntilSnapshotCompleted

func WaitUntilSnapshotCompleted(conn *oapi.Client, id string) error

func WaitUntilSnapshotDone

func WaitUntilSnapshotDone(conn *oapi.Client, snapshotID string) error

func WaitUntilVolumeAvailable

func WaitUntilVolumeAvailable(conn *oapi.Client, volumeID string) error

func WaitUntilVolumeIsLinked

func WaitUntilVolumeIsLinked(conn *oapi.Client, volumeID string) error

func WaitUntilVolumeIsUnlinked

func WaitUntilVolumeIsUnlinked(conn *oapi.Client, volumeID string) error

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.

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) State

func (a *Artifact) State(name string) interface{}

func (*Artifact) String

func (a *Artifact) String() string

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 BuildInfoTemplate struct {
	BuildRegion   string
	SourceOMI     string
	SourceOMIName string
	SourceOMITags map[string]string
}

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.

func (*FlatBlockDevice) HCL2Spec added in v1.4.5

func (*FlatBlockDevice) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a BlockDevice. This spec is used by HCL to read the fields of BlockDevice. The decoded values from this spec will then be applied to a FlatBlockDevice.

type FlatNetFilterOptions added in v1.4.5

type FlatNetFilterOptions struct {
	Filters map[string]string `cty:"filters"`
}

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

type FlatSecurityGroupFilterOptions struct {
	Filters map[string]string `cty:"filters"`
}

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

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

type NetFilterOptions struct {
	Filters map[string]string
}

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

func (OAPITags) Report

func (t OAPITags) Report(ui packer.Ui)

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.

func (*RunConfig) IsSpotVm

func (c *RunConfig) IsSpotVm() bool

func (*RunConfig) Prepare

func (c *RunConfig) Prepare(ctx *interpolate.Context) []error

type SecurityGroupFilterOptions

type SecurityGroupFilterOptions struct {
	Filters map[string]string
}

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

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

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

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

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

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

type StepPreValidate

type StepPreValidate struct {
	DestOmiName     string
	ForceDeregister bool
}

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

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

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

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

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

type StepStopBSUBackedVm

type StepStopBSUBackedVm struct {
	Skip          bool
	DisableStopVm bool
}

func (*StepStopBSUBackedVm) Cleanup

func (*StepStopBSUBackedVm) Run

type StepUpdateBSUBackedVm

type StepUpdateBSUBackedVm struct {
	EnableAMIENASupport      *bool
	EnableAMISriovNetSupport bool
}

func (*StepUpdateBSUBackedVm) Cleanup

func (s *StepUpdateBSUBackedVm) Cleanup(state multistep.StateBag)

func (*StepUpdateBSUBackedVm) Run

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

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.

type TagMap

type TagMap map[string]string

func (TagMap) IsSet

func (t TagMap) IsSet() bool

func (TagMap) OAPITags

func (t TagMap) OAPITags(ctx interpolate.Context, region string, state multistep.StateBag) (OAPITags, error)

Jump to

Keyboard shortcuts

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