Documentation ¶
Overview ¶
The alicloud contains a packer.Builder implementation that builds ecs images for alicloud.
Index ¶
- Constants
- Variables
- func ContainsInArray(arr []string, value string) bool
- func SSHHost(e alicloudSSHHelper, private bool) func(multistep.StateBag) (string, error)
- type AlicloudAccessConfig
- type AlicloudDiskDevice
- type AlicloudDiskDevices
- type AlicloudImageConfig
- type Artifact
- type Builder
- type ClientWrapper
- func (c *ClientWrapper) EvalCouldRetryResponse(evalErrors []string, evalErrorType EvalErrorType) func(response responses.AcsResponse, err error) WaitForExpectEvalResult
- func (c *ClientWrapper) WaitForExpected(args *WaitForExpectArgs) (responses.AcsResponse, error)
- func (c *ClientWrapper) WaitForImageStatus(regionId string, imageId string, expectedStatus string, timeout time.Duration) (responses.AcsResponse, error)
- func (c *ClientWrapper) WaitForInstanceStatus(regionId string, instanceId string, expectedStatus string) (responses.AcsResponse, error)
- func (c *ClientWrapper) WaitForSnapshotStatus(regionId string, snapshotId string, expectedStatus string, ...) (responses.AcsResponse, error)
- type Config
- type EvalErrorType
- type InstanceNetWork
- type RunConfig
- type WaitForExpectArgs
- type WaitForExpectEvalResult
Constants ¶
View Source
const ( ALICLOUD_DEFAULT_SHORT_TIMEOUT = 180 ALICLOUD_DEFAULT_TIMEOUT = 1800 ALICLOUD_DEFAULT_LONG_TIMEOUT = 3600 )
View Source
const ( InstanceStatusRunning = "Running" InstanceStatusStarting = "Starting" InstanceStatusStopped = "Stopped" InstanceStatusStopping = "Stopping" )
View Source
const ( ImageStatusWaiting = "Waiting" ImageStatusCreating = "Creating" ImageStatusCreateFailed = "CreateFailed" ImageStatusAvailable = "Available" )
View Source
const ( SnapshotStatusAll = "all" SnapshotStatusProgressing = "progressing" SnapshotStatusAccomplished = "accomplished" SnapshotStatusFailed = "failed" )
View Source
const ( DiskStatusInUse = "In_use" DiskStatusAvailable = "Available" DiskStatusAttaching = "Attaching" DiskStatusDetaching = "Detaching" DiskStatusCreating = "Creating" DiskStatusReIniting = "ReIniting" )
View Source
const ( VpcStatusPending = "Pending" VpcStatusAvailable = "Available" )
View Source
const ( VSwitchStatusPending = "Pending" VSwitchStatusAvailable = "Available" )
View Source
const ( EipStatusAssociating = "Associating" EipStatusUnassociating = "Unassociating" EipStatusInUse = "InUse" EipStatusAvailable = "Available" )
View Source
const ( ImageOwnerSystem = "system" ImageOwnerSelf = "self" ImageOwnerOthers = "others" ImageOwnerMarketplace = "marketplace" )
View Source
const ( IOOptimizedNone = "none" IOOptimizedOptimized = "optimized" )
View Source
const ( InstanceNetworkClassic = "classic" InstanceNetworkVpc = "vpc" )
View Source
const ( DiskTypeSystem = "system" DiskTypeData = "data" )
View Source
const ( TagResourceImage = "image" TagResourceInstance = "instance" TagResourceSnapshot = "snapshot" TagResourceDisk = "disk" )
View Source
const ( IpProtocolAll = "all" IpProtocolTCP = "tcp" IpProtocolUDP = "udp" IpProtocolICMP = "icmp" IpProtocolGRE = "gre" )
View Source
const ( NicTypeInternet = "internet" NicTypeIntranet = "intranet" )
View Source
const ( DefaultPortRange = "-1/-1" DefaultCidrIp = "0.0.0.0/0" DefaultCidrBlock = "172.16.0.0/24" )
View Source
const ( EvalRetryErrorType = EvalErrorType(true) EvalNotRetryErrorType = EvalErrorType(false) )
View Source
const BuilderId = "alibaba.alicloud"
The unique ID for this builder
View Source
const DefaultRequestReadTimeout = 10 * time.Second
View Source
const Packer = "HashiCorp-Packer"
Variables ¶
View Source
var ( WaitForExpectSuccess = WaitForExpectEvalResult{ // contains filtered or unexported fields } WaitForExpectToRetry = WaitForExpectEvalResult{ // contains filtered or unexported fields } WaitForExpectFailToStop = WaitForExpectEvalResult{ // contains filtered or unexported fields } )
View Source
var ImageStatusQueried = fmt.Sprintf("%s,%s,%s,%s", ImageStatusWaiting, ImageStatusCreating, ImageStatusCreateFailed, ImageStatusAvailable)
Functions ¶
func ContainsInArray ¶
Types ¶
type AlicloudAccessConfig ¶
type AlicloudAccessConfig struct { AlicloudAccessKey string `mapstructure:"access_key"` AlicloudSecretKey string `mapstructure:"secret_key"` AlicloudRegion string `mapstructure:"region"` AlicloudSkipValidation bool `mapstructure:"skip_region_validation"` SecurityToken string `mapstructure:"security_token"` // contains filtered or unexported fields }
Config of alicloud
func (*AlicloudAccessConfig) Client ¶
func (c *AlicloudAccessConfig) Client() (*ClientWrapper, error)
Client for AlicloudClient
func (*AlicloudAccessConfig) Config ¶
func (c *AlicloudAccessConfig) Config() error
func (*AlicloudAccessConfig) Prepare ¶
func (c *AlicloudAccessConfig) Prepare(ctx *interpolate.Context) []error
func (*AlicloudAccessConfig) ValidateRegion ¶
func (c *AlicloudAccessConfig) ValidateRegion(region string) error
type AlicloudDiskDevice ¶
type AlicloudDiskDevice struct { DiskName string `mapstructure:"disk_name"` DiskCategory string `mapstructure:"disk_category"` DiskSize int `mapstructure:"disk_size"` SnapshotId string `mapstructure:"disk_snapshot_id"` Description string `mapstructure:"disk_description"` DeleteWithInstance bool `mapstructure:"disk_delete_with_instance"` Device string `mapstructure:"disk_device"` Encrypted *bool `mapstructure:"disk_encrypted"` }
type AlicloudDiskDevices ¶
type AlicloudDiskDevices struct { ECSSystemDiskMapping AlicloudDiskDevice `mapstructure:"system_disk_mapping"` ECSImagesDiskMappings []AlicloudDiskDevice `mapstructure:"image_disk_mappings"` }
type AlicloudImageConfig ¶
type AlicloudImageConfig struct { AlicloudImageName string `mapstructure:"image_name"` AlicloudImageVersion string `mapstructure:"image_version"` AlicloudImageDescription string `mapstructure:"image_description"` AlicloudImageDestinationRegions []string `mapstructure:"image_copy_regions"` AlicloudImageDestinationNames []string `mapstructure:"image_copy_names"` ImageEncrypted *bool `mapstructure:"image_encrypted"` AlicloudImageForceDelete bool `mapstructure:"image_force_delete"` AlicloudImageForceDeleteSnapshots bool `mapstructure:"image_force_delete_snapshots"` AlicloudImageForceDeleteInstances bool `mapstructure:"image_force_delete_instances"` AlicloudImageIgnoreDataDisks bool `mapstructure:"image_ignore_data_disks"` AlicloudImageSkipRegionValidation bool `mapstructure:"skip_region_validation"` AlicloudImageTags map[string]string `mapstructure:"tags"` AlicloudDiskDevices `mapstructure:",squash"` }
func (*AlicloudImageConfig) Prepare ¶
func (c *AlicloudImageConfig) Prepare(ctx *interpolate.Context) []error
type Artifact ¶
type Artifact struct { // A map of regions to alicloud image IDs. AlicloudImages map[string]string // BuilderId is the unique ID for the builder that created this alicloud image BuilderIdValue string // Alcloud connection for performing API stuff. Client *ClientWrapper }
type ClientWrapper ¶
func (*ClientWrapper) EvalCouldRetryResponse ¶
func (c *ClientWrapper) EvalCouldRetryResponse(evalErrors []string, evalErrorType EvalErrorType) func(response responses.AcsResponse, err error) WaitForExpectEvalResult
func (*ClientWrapper) WaitForExpected ¶
func (c *ClientWrapper) WaitForExpected(args *WaitForExpectArgs) (responses.AcsResponse, error)
func (*ClientWrapper) WaitForImageStatus ¶
func (c *ClientWrapper) WaitForImageStatus(regionId string, imageId string, expectedStatus string, timeout time.Duration) (responses.AcsResponse, error)
func (*ClientWrapper) WaitForInstanceStatus ¶
func (c *ClientWrapper) WaitForInstanceStatus(regionId string, instanceId string, expectedStatus string) (responses.AcsResponse, error)
func (*ClientWrapper) WaitForSnapshotStatus ¶
func (c *ClientWrapper) WaitForSnapshotStatus(regionId string, snapshotId string, expectedStatus string, timeout time.Duration) (responses.AcsResponse, error)
type Config ¶
type Config struct { common.PackerConfig `mapstructure:",squash"` AlicloudAccessConfig `mapstructure:",squash"` AlicloudImageConfig `mapstructure:",squash"` RunConfig `mapstructure:",squash"` // contains filtered or unexported fields }
type EvalErrorType ¶
type EvalErrorType bool
type InstanceNetWork ¶
type InstanceNetWork string
type RunConfig ¶
type RunConfig struct { AssociatePublicIpAddress bool `mapstructure:"associate_public_ip_address"` ZoneId string `mapstructure:"zone_id"` IOOptimized *bool `mapstructure:"io_optimized"` InstanceType string `mapstructure:"instance_type"` Description string `mapstructure:"description"` AlicloudSourceImage string `mapstructure:"source_image"` ForceStopInstance bool `mapstructure:"force_stop_instance"` DisableStopInstance bool `mapstructure:"disable_stop_instance"` SecurityGroupId string `mapstructure:"security_group_id"` SecurityGroupName string `mapstructure:"security_group_name"` UserData string `mapstructure:"user_data"` UserDataFile string `mapstructure:"user_data_file"` VpcId string `mapstructure:"vpc_id"` VpcName string `mapstructure:"vpc_name"` CidrBlock string `mapstructure:"vpc_cidr_block"` VSwitchId string `mapstructure:"vswitch_id"` VSwitchName string `mapstructure:"vswitch_id"` InstanceName string `mapstructure:"instance_name"` InternetChargeType string `mapstructure:"internet_charge_type"` InternetMaxBandwidthOut int `mapstructure:"internet_max_bandwidth_out"` WaitSnapshotReadyTimeout int `mapstructure:"wait_snapshot_ready_timeout"` // Communicator settings Comm communicator.Config `mapstructure:",squash"` SSHPrivateIp bool `mapstructure:"ssh_private_ip"` }
type WaitForExpectArgs ¶
type WaitForExpectArgs struct { RequestFunc func() (responses.AcsResponse, error) EvalFunc func(response responses.AcsResponse, err error) WaitForExpectEvalResult RetryInterval time.Duration RetryTimes int RetryTimeout time.Duration }
type WaitForExpectEvalResult ¶
type WaitForExpectEvalResult struct {
// contains filtered or unexported fields
}
Source Files ¶
- access_config.go
- artifact.go
- builder.go
- client.go
- image_config.go
- packer_helper.go
- run_config.go
- ssh_helper.go
- step_attach_keypair.go
- step_check_source_image.go
- step_config_eip.go
- step_config_key_pair.go
- step_config_public_ip.go
- step_config_security_group.go
- step_config_vpc.go
- step_config_vswitch.go
- step_create_image.go
- step_create_instance.go
- step_create_snapshot.go
- step_create_tags.go
- step_delete_images_snapshots.go
- step_pre_validate.go
- step_region_copy_image.go
- step_run_instance.go
- step_share_image.go
- step_stop_instance.go
Click to show internal directories.
Click to hide internal directories.