Version: v1.3.2 Latest Latest

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

Go to latest
Published: Oct 29, 2018 License: MPL-2.0 Imports: 20 Imported by: 0



The alicloud contains a packer.Builder implementation that builds ecs images for alicloud.



View Source
const (
	ClassicNet                     = InstanceNetWork("classic")
	VpcNet                         = InstanceNetWork("vpc")
View Source
const BuilderId = "alibaba.alicloud"

The unique ID for this builder


This section is empty.


func SSHHost

func SSHHost(e alicloudSSHHelper, private bool) func(multistep.StateBag) (string, error)

SSHHost returns a function that can be given to the SSH communicator


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"`

Config of alicloud

func (*AlicloudAccessConfig) Client

func (c *AlicloudAccessConfig) Client() (*ecs.Client, error)

Client for AlicloudClient

func (*AlicloudAccessConfig) Config

func (c *AlicloudAccessConfig) Config() error

func (*AlicloudAccessConfig) Prepare

func (c *AlicloudAccessConfig) Prepare(ctx *interpolate.Context) []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"`

type AlicloudDiskDevices

type AlicloudDiskDevices struct {
	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"`
	AlicloudImageShareAccounts        []string          `mapstructure:"image_share_account"`
	AlicloudImageUNShareAccounts      []string          `mapstructure:"image_unshare_account"`
	AlicloudImageDestinationRegions   []string          `mapstructure:"image_copy_regions"`
	AlicloudImageDestinationNames     []string          `mapstructure:"image_copy_names"`
	AlicloudImageForceDelete          bool              `mapstructure:"image_force_delete"`
	AlicloudImageForceDeleteSnapshots bool              `mapstructure:"image_force_delete_snapshots"`
	AlicloudImageForceDeleteInstances bool              `mapstructure:"image_force_delete_instances"`
	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 *ecs.Client

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 Builder

type Builder struct {
	// contains filtered or unexported fields

func (*Builder) Cancel

func (b *Builder) Cancel()

func (*Builder) Prepare

func (b *Builder) Prepare(raws ...interface{}) ([]string, error)

func (*Builder) Run

func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, 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 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"`

	// Communicator settings
	Comm         communicator.Config `mapstructure:",squash"`
	SSHPrivateIp bool                `mapstructure:"ssh_private_ip"`

func (*RunConfig) Prepare

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL