ecs

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2017 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	ClassicNet                     = InstanceNetWork("classic")
	VpcNet                         = InstanceNetWork("vpc")
	ALICLOUD_DEFAULT_SHORT_TIMEOUT = 180
	ALICLOUD_DEFAULT_TIMEOUT       = 1800
	ALICLOUD_DEFAULT_LONG_TIMEOUT  = 3600
)
View Source
const BuilderId = "alibaba.alicloud"

The unique ID for this builder

Variables

This section is empty.

Functions

func SSHConfig

func SSHConfig(useAgent bool, username, password string) func(multistep.StateBag) (*ssh.ClientConfig, error)

SSHConfig returns a function that can be used for the SSH communicator config for connecting to the instance created over SSH using the private key or password.

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

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

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"`
	AlicloudImageForceDetele          bool     `mapstructure:"image_force_delete"`
	AlicloudImageForceDeteleSnapshots bool     `mapstructure:"image_force_delete_snapshots"`
	AlicloudImageForceDeleteInstances bool     `mapstructure:"image_force_delete_instances"`
	AlicloudImageSkipRegionValidation bool     `mapstructure:"skip_region_validation"`
	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"`
	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"`
	TemporaryKeyPairName     string `mapstructure:"temporary_key_pair_name"`

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

func (*RunConfig) Prepare

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

type StepConfigAlicloudKeyPair

type StepConfigAlicloudKeyPair struct {
	Debug                bool
	SSHAgentAuth         bool
	DebugKeyPath         string
	TemporaryKeyPairName string
	KeyPairName          string
	PrivateKeyFile       string
	RegionId             string
	// contains filtered or unexported fields
}

func (*StepConfigAlicloudKeyPair) Cleanup

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

func (*StepConfigAlicloudKeyPair) Run

Jump to

Keyboard shortcuts

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