Documentation
¶
Overview ¶
Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT.
Code generated by "mapstructure-to-hcl2 -type tencentCloudDataDisk"; DO NOT EDIT.
Index ¶
- Constants
- Variables
- func CheckResourceIdFormat(resource string, id string) bool
- func Error(state multistep.StateBag, err error, prefix string)
- func Halt(state multistep.StateBag, err error, prefix string) multistep.StepAction
- func Message(state multistep.StateBag, message, prefix string)
- func Retry(ctx context.Context, fn func(context.Context) error) error
- func SSHHost(pubilcIp bool) func(multistep.StateBag) (string, error)
- func Say(state multistep.StateBag, message, prefix string)
- func SayClean(state multistep.StateBag, module string)
- func WaitForImageReady(client *cvm.Client, imageName string, status string, timeout int) error
- func WaitForInstance(client *cvm.Client, instanceId string, status string, timeout int) error
- type Artifact
- type Builder
- type Config
- type FlatConfig
- type FlattencentCloudDataDisk
- type Region
- type TencentCloudAccessConfig
- type TencentCloudImageConfig
- type TencentCloudRunConfig
Constants ¶
const ( Bangkok = Region("ap-bangkok") Beijing = Region("ap-beijing") Chengdu = Region("ap-chengdu") Chongqing = Region("ap-chongqing") Guangzhou = Region("ap-guangzhou") GuangzhouOpen = Region("ap-guangzhou-open") Hongkong = Region("ap-hongkong") Mumbai = Region("ap-mumbai") Seoul = Region("ap-seoul") Shanghai = Region("ap-shanghai") ShanghaiFsi = Region("ap-shanghai-fsi") ShenzhenFsi = Region("ap-shenzhen-fsi") Singapore = Region("ap-singapore") Tokyo = Region("ap-tokyo") Frankfurt = Region("eu-frankfurt") Moscow = Region("eu-moscow") Ashburn = Region("na-ashburn") Siliconvalley = Region("na-siliconvalley") Toronto = Region("na-toronto") )
below would be moved to tencentcloud sdk git repo
const BuilderId = "tencent.cloud"
const DefaultWaitForInterval = 5
DefaultWaitForInterval is sleep interval when wait statue
Variables ¶
var ValidCBSType = []string{
"LOCAL_BASIC", "LOCAL_SSD", "CLOUD_BASIC", "CLOUD_SSD", "CLOUD_PREMIUM",
}
var ValidRegions = []Region{ Bangkok, Beijing, Chengdu, Chongqing, Guangzhou, GuangzhouOpen, Hongkong, Shanghai, ShanghaiFsi, ShenzhenFsi, Mumbai, Seoul, Singapore, Tokyo, Moscow, Frankfurt, Ashburn, Siliconvalley, Toronto, }
Functions ¶
func CheckResourceIdFormat ¶
CheckResourceIdFormat check resource id format
func WaitForImageReady ¶
WaitForImageReady wait for image reaches statue
Types ¶
type Artifact ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (*Builder) ConfigSpec ¶ added in v1.5.0
func (b *Builder) ConfigSpec() hcldec.ObjectSpec
type Config ¶
type Config struct {
common.PackerConfig `mapstructure:",squash"`
TencentCloudAccessConfig `mapstructure:",squash"`
TencentCloudImageConfig `mapstructure:",squash"`
TencentCloudRunConfig `mapstructure:",squash"`
// contains filtered or unexported fields
}
func (*Config) FlatMapstructure ¶ added in v1.4.5
FlatMapstructure returns a new FlatConfig. FlatConfig is an auto-generated flat version of Config. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
type FlatConfig ¶ added in v1.4.5
type FlatConfig struct {
PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name"`
PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type"`
PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug"`
PackerForce *bool `mapstructure:"packer_force" cty:"packer_force"`
PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error"`
PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables"`
PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables"`
SecretId *string `mapstructure:"secret_id" required:"true" cty:"secret_id"`
SecretKey *string `mapstructure:"secret_key" required:"true" cty:"secret_key"`
Region *string `mapstructure:"region" required:"true" cty:"region"`
Zone *string `mapstructure:"zone" required:"true" cty:"zone"`
SkipValidation *bool `mapstructure:"skip_region_validation" required:"false" cty:"skip_region_validation"`
ImageName *string `mapstructure:"image_name" required:"true" cty:"image_name"`
ImageDescription *string `mapstructure:"image_description" required:"false" cty:"image_description"`
Reboot *bool `mapstructure:"reboot" required:"false" cty:"reboot"`
ForcePoweroff *bool `mapstructure:"force_poweroff" required:"false" cty:"force_poweroff"`
Sysprep *bool `mapstructure:"sysprep" required:"false" cty:"sysprep"`
ImageForceDelete *bool `mapstructure:"image_force_delete" cty:"image_force_delete"`
ImageCopyRegions []string `mapstructure:"image_copy_regions" required:"false" cty:"image_copy_regions"`
AssociatePublicIpAddress *bool `mapstructure:"associate_public_ip_address" required:"false" cty:"associate_public_ip_address"`
SourceImageId *string `mapstructure:"source_image_id" required:"true" cty:"source_image_id"`
InstanceType *string `mapstructure:"instance_type" required:"true" cty:"instance_type"`
InstanceName *string `mapstructure:"instance_name" required:"false" cty:"instance_name"`
DiskType *string `mapstructure:"disk_type" required:"false" cty:"disk_type"`
DiskSize *int64 `mapstructure:"disk_size" required:"false" cty:"disk_size"`
DataDisks []FlattencentCloudDataDisk `mapstructure:"data_disks" cty:"data_disks"`
VpcId *string `mapstructure:"vpc_id" required:"false" cty:"vpc_id"`
VpcName *string `mapstructure:"vpc_name" required:"false" cty:"vpc_name"`
VpcIp *string `mapstructure:"vpc_ip" cty:"vpc_ip"`
SubnetId *string `mapstructure:"subnet_id" required:"false" cty:"subnet_id"`
SubnetName *string `mapstructure:"subnet_name" required:"false" cty:"subnet_name"`
CidrBlock *string `mapstructure:"cidr_block" required:"false" cty:"cidr_block"`
SubnectCidrBlock *string `mapstructure:"subnect_cidr_block" required:"false" cty:"subnect_cidr_block"`
InternetChargeType *string `mapstructure:"internet_charge_type" cty:"internet_charge_type"`
InternetMaxBandwidthOut *int64 `mapstructure:"internet_max_bandwidth_out" required:"false" cty:"internet_max_bandwidth_out"`
SecurityGroupId *string `mapstructure:"security_group_id" required:"false" cty:"security_group_id"`
SecurityGroupName *string `mapstructure:"security_group_name" required:"false" cty:"security_group_name"`
UserData *string `mapstructure:"user_data" required:"false" cty:"user_data"`
UserDataFile *string `mapstructure:"user_data_file" required:"false" cty:"user_data_file"`
HostName *string `mapstructure:"host_name" required:"false" cty:"host_name"`
RunTags map[string]string `mapstructure:"run_tags" required:"false" cty:"run_tags"`
Type *string `mapstructure:"communicator" cty:"communicator"`
PauseBeforeConnect *string `mapstructure:"pause_before_connecting" cty:"pause_before_connecting"`
SSHHost *string `mapstructure:"ssh_host" cty:"ssh_host"`
SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port"`
SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username"`
SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password"`
SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name"`
SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name"`
SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys"`
SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file"`
SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty"`
SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout"`
SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth"`
SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding"`
SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts"`
SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host"`
SSHBastionPort *int `mapstructure:"ssh_bastion_port" cty:"ssh_bastion_port"`
SSHBastionAgentAuth *bool `mapstructure:"ssh_bastion_agent_auth" cty:"ssh_bastion_agent_auth"`
SSHBastionUsername *string `mapstructure:"ssh_bastion_username" cty:"ssh_bastion_username"`
SSHBastionPassword *string `mapstructure:"ssh_bastion_password" cty:"ssh_bastion_password"`
SSHBastionPrivateKeyFile *string `mapstructure:"ssh_bastion_private_key_file" cty:"ssh_bastion_private_key_file"`
SSHFileTransferMethod *string `mapstructure:"ssh_file_transfer_method" cty:"ssh_file_transfer_method"`
SSHProxyHost *string `mapstructure:"ssh_proxy_host" cty:"ssh_proxy_host"`
SSHProxyPort *int `mapstructure:"ssh_proxy_port" cty:"ssh_proxy_port"`
SSHProxyUsername *string `mapstructure:"ssh_proxy_username" cty:"ssh_proxy_username"`
SSHProxyPassword *string `mapstructure:"ssh_proxy_password" cty:"ssh_proxy_password"`
SSHKeepAliveInterval *string `mapstructure:"ssh_keep_alive_interval" cty:"ssh_keep_alive_interval"`
SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout"`
SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels"`
SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels"`
SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key"`
SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key"`
WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username"`
WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password"`
WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host"`
WinRMPort *int `mapstructure:"winrm_port" cty:"winrm_port"`
WinRMTimeout *string `mapstructure:"winrm_timeout" cty:"winrm_timeout"`
WinRMUseSSL *bool `mapstructure:"winrm_use_ssl" cty:"winrm_use_ssl"`
WinRMInsecure *bool `mapstructure:"winrm_insecure" cty:"winrm_insecure"`
WinRMUseNTLM *bool `mapstructure:"winrm_use_ntlm" cty:"winrm_use_ntlm"`
SSHPrivateIp *bool `mapstructure:"ssh_private_ip" cty:"ssh_private_ip"`
}
FlatConfig is an auto-generated flat version of Config. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlattencentCloudDataDisk ¶ added in v1.4.5
type FlattencentCloudDataDisk struct {
DiskType *string `mapstructure:"disk_type" cty:"disk_type"`
DiskSize *int64 `mapstructure:"disk_size" cty:"disk_size"`
SnapshotId *string `mapstructure:"disk_snapshot_id" cty:"disk_snapshot_id"`
}
FlattencentCloudDataDisk is an auto-generated flat version of tencentCloudDataDisk. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
func (*FlattencentCloudDataDisk) HCL2Spec ¶ added in v1.4.5
func (*FlattencentCloudDataDisk) HCL2Spec() map[string]hcldec.Spec
HCL2Spec returns the hcl spec of a tencentCloudDataDisk. This spec is used by HCL to read the fields of tencentCloudDataDisk. The decoded values from this spec will then be applied to a FlattencentCloudDataDisk.
type TencentCloudAccessConfig ¶
type TencentCloudAccessConfig struct {
// Tencentcloud secret id. You should set it directly,
// or set the TENCENTCLOUD_ACCESS_KEY environment variable.
SecretId string `mapstructure:"secret_id" required:"true"`
// Tencentcloud secret key. You should set it directly,
// or set the TENCENTCLOUD_SECRET_KEY environment variable.
SecretKey string `mapstructure:"secret_key" required:"true"`
// The region where your cvm will be launch. You should
// reference Region and Zone
// for parameter taking.
Region string `mapstructure:"region" required:"true"`
// The zone where your cvm will be launch. You should
// reference Region and Zone
// for parameter taking.
Zone string `mapstructure:"zone" required:"true"`
// Do not check region and zone when validate.
SkipValidation bool `mapstructure:"skip_region_validation" required:"false"`
}
func (*TencentCloudAccessConfig) Config ¶
func (cf *TencentCloudAccessConfig) Config() error
func (*TencentCloudAccessConfig) Prepare ¶
func (cf *TencentCloudAccessConfig) Prepare(ctx *interpolate.Context) []error
type TencentCloudImageConfig ¶
type TencentCloudImageConfig struct {
// The name you want to create your customize image,
// it should be composed of no more than 60 characters, of letters, numbers
// or minus sign.
ImageName string `mapstructure:"image_name" required:"true"`
// Image description.
ImageDescription string `mapstructure:"image_description" required:"false"`
// Whether shutdown cvm to create Image. Default value is
// false.
Reboot bool `mapstructure:"reboot" required:"false"`
// Whether to force power off cvm when create image.
// Default value is false.
ForcePoweroff bool `mapstructure:"force_poweroff" required:"false"`
// Whether enable Sysprep during creating windows image.
Sysprep bool `mapstructure:"sysprep" required:"false"`
ImageForceDelete bool `mapstructure:"image_force_delete"`
// regions that will be copied to after
// your image created.
ImageCopyRegions []string `mapstructure:"image_copy_regions" required:"false"`
// after your image created.
ImageShareAccounts []string `mapstructure:"image_share_accounts" required:"false"`
// Do not check region and zone when validate.
SkipValidation bool `mapstructure:"skip_region_validation" required:"false"`
}
func (*TencentCloudImageConfig) Prepare ¶
func (cf *TencentCloudImageConfig) Prepare(ctx *interpolate.Context) []error
type TencentCloudRunConfig ¶
type TencentCloudRunConfig struct {
// Whether allocate public ip to your cvm.
// Default value is false.
AssociatePublicIpAddress bool `mapstructure:"associate_public_ip_address" required:"false"`
// The base image id of Image you want to create
// your customized image from.
SourceImageId string `mapstructure:"source_image_id" required:"true"`
// The instance type your cvm will be launched by.
// You should reference Instace Type
// for parameter taking.
InstanceType string `mapstructure:"instance_type" required:"true"`
// Instance name.
InstanceName string `mapstructure:"instance_name" required:"false"`
// Root disk type your cvm will be launched by. you could
// reference Disk Type
// for parameter taking.
DiskType string `mapstructure:"disk_type" required:"false"`
// Root disk size your cvm will be launched by. values range(in GB):
DiskSize int64 `mapstructure:"disk_size" required:"false"`
// Add one or more data disks to the instance before creating the image.
// Note that if the source image has data disk snapshots, this argument
// will be ignored, and the running instance will use source image data
// disk settings, in such case, `disk_type` argument will be used as disk
// type for all data disks, and each data disk size will use the origin
// value in source image.
// The data disks allow for the following argument:
// - `disk_type` - Type of the data disk. Valid choices: `CLOUD_BASIC`, `CLOUD_PREMIUM` and `CLOUD_SSD`.
// - `disk_size` - Size of the data disk.
// - `disk_snapshot_id` - Id of the snapshot for a data disk.
DataDisks []tencentCloudDataDisk `mapstructure:"data_disks"`
// Specify vpc your cvm will be launched by.
VpcId string `mapstructure:"vpc_id" required:"false"`
// Specify vpc name you will create. if vpc_id is not set, packer will
// create a vpc for you named this parameter.
VpcName string `mapstructure:"vpc_name" required:"false"`
VpcIp string `mapstructure:"vpc_ip"`
// Specify subnet your cvm will be launched by.
SubnetId string `mapstructure:"subnet_id" required:"false"`
// Specify subnet name you will create. if subnet_id is not set, packer will
// create a subnet for you named this parameter.
SubnetName string `mapstructure:"subnet_name" required:"false"`
// Specify cider block of the vpc you will create if vpc_id not set
CidrBlock string `mapstructure:"cidr_block" required:"false"` // 10.0.0.0/16(default), 172.16.0.0/12, 192.168.0.0/16
// Specify cider block of the subnet you will create if
// subnet_id not set
SubnectCidrBlock string `mapstructure:"subnect_cidr_block" required:"false"`
InternetChargeType string `mapstructure:"internet_charge_type"`
// Max bandwidth out your cvm will be launched by(in MB).
// values can be set between 1 ~ 100.
InternetMaxBandwidthOut int64 `mapstructure:"internet_max_bandwidth_out" required:"false"`
// Specify securitygroup your cvm will be launched by.
SecurityGroupId string `mapstructure:"security_group_id" required:"false"`
// Specify security name you will create if security_group_id not set.
SecurityGroupName string `mapstructure:"security_group_name" required:"false"`
// userdata.
UserData string `mapstructure:"user_data" required:"false"`
// userdata file.
UserDataFile string `mapstructure:"user_data_file" required:"false"`
// host name.
HostName string `mapstructure:"host_name" required:"false"`
// Tags to apply to the instance that is *launched* to create the image.
// These tags are *not* applied to the resulting image.
RunTags map[string]string `mapstructure:"run_tags" required:"false"`
// Communicator settings
Comm communicator.Config `mapstructure:",squash"`
SSHPrivateIp bool `mapstructure:"ssh_private_ip"`
}
func (*TencentCloudRunConfig) Prepare ¶
func (cf *TencentCloudRunConfig) Prepare(ctx *interpolate.Context) []error
Source Files
¶
- access_config.go
- artifact.go
- builder.go
- builder.hcl2spec.go
- common.go
- image_config.go
- run_config.go
- run_config.hcl2spec.go
- step_check_source_image.go
- step_config_key_pair.go
- step_config_security_group.go
- step_config_subnet.go
- step_config_vpc.go
- step_copy_image.go
- step_create_image.go
- step_detach_temp_key_pair.go
- step_pre_validate.go
- step_run_instance.go
- step_share_image.go