Documentation ¶
Index ¶
Constants ¶
View Source
const BuilderId = "packer.post-processor.yandex-export"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { common.PackerConfig `mapstructure:",squash"` yandex.AccessConfig `mapstructure:",squash"` yandex.CommonConfig `mapstructure:",squash"` ExchangeConfig `mapstructure:",squash"` communicator.SSH `mapstructure:",squash"` communicator.Config `mapstructure:"-"` // List of paths to Yandex Object Storage where exported image will be uploaded. // Please be aware that use of space char inside path not supported. // Also this param support [build](/packer/docs/templates/legacy_json_templates/engine) template function. // Check available template data for [Yandex](/packer/plugins/builders/yandex#build-template-data) builder. // Paths to Yandex Object Storage where exported image will be uploaded. Paths []string `mapstructure:"paths" required:"true"` // The ID of the folder containing the source image. Default `standard-images`. SourceImageFolderID string `mapstructure:"source_image_folder_id" required:"false"` // The source image family to start export process. Default `ubuntu-1604-lts`. // Image must contains utils or supported package manager: `apt` or `yum` - // requires `root` or `sudo` without password. // Utils: `qemu-img`, `aws`. The `qemu-img` utility requires `root` user or // `sudo` access without password. SourceImageFamily string `mapstructure:"source_image_family" required:"false"` // The source image ID to use to create the new image from. Just one of a source_image_id or // source_image_family must be specified. SourceImageID string `mapstructure:"source_image_id" required:"false"` // The extra size of the source disk in GB. This defaults to `0GB`. // Requires `losetup` utility on the instance. // > **Careful!** Increases payment cost. // > See [perfomance](https://cloud.yandex.com/docs/compute/concepts/disk#performance). SourceDiskExtraSize int `mapstructure:"source_disk_extra_size" required:"false"` // StorageEndpoint custom Yandex Object Storage endpoint to upload image, Default `storage.yandexcloud.net`. StorageEndpoint string `mapstructure:"storage_endpoint" required:"false"` // StorageEndpointAutoresolve auto resolve storage endpoint via YC Public API ListEndpoints call. Option has // precedence over 'storage_endpoint' option. StorageEndpointAutoresolve bool `mapstructure:"storage_endpoint_autoresolve" required:"false"` // StorageRegion custom Yandex Object region. Default `ru-central1` StorageRegion string `mapstructure:"storage_region" required:"false"` // contains filtered or unexported fields }
type ExchangeConfig ¶
type ExchangeConfig struct { // Service Account ID with proper permission to modify an instance, create and attach disk and // make upload to specific Yandex Object Storage paths. ServiceAccountID string `mapstructure:"service_account_id" required:"true"` }
func (*ExchangeConfig) Prepare ¶
func (c *ExchangeConfig) Prepare(errs *packersdk.MultiError) *packersdk.MultiError
type FlatConfig ¶
type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Endpoint *string `mapstructure:"endpoint" required:"false" cty:"endpoint" hcl:"endpoint"` ServiceAccountKeyFile *string `mapstructure:"service_account_key_file" required:"false" cty:"service_account_key_file" hcl:"service_account_key_file"` Token *string `mapstructure:"token" required:"true" cty:"token" hcl:"token"` MaxRetries *int `mapstructure:"max_retries" cty:"max_retries" hcl:"max_retries"` SerialLogFile *string `mapstructure:"serial_log_file" required:"false" cty:"serial_log_file" hcl:"serial_log_file"` StateTimeout *string `mapstructure:"state_timeout" required:"false" cty:"state_timeout" hcl:"state_timeout"` InstanceCores *int `mapstructure:"instance_cores" required:"false" cty:"instance_cores" hcl:"instance_cores"` InstanceCoreFraction *int `mapstructure:"instance_core_fraction" required:"false" cty:"instance_core_fraction" hcl:"instance_core_fraction"` InstanceGpus *int `mapstructure:"instance_gpus" required:"false" cty:"instance_gpus" hcl:"instance_gpus"` InstanceMemory *int `mapstructure:"instance_mem_gb" required:"false" cty:"instance_mem_gb" hcl:"instance_mem_gb"` InstanceName *string `mapstructure:"instance_name" required:"false" cty:"instance_name" hcl:"instance_name"` PlatformID *string `mapstructure:"platform_id" required:"false" cty:"platform_id" hcl:"platform_id"` Labels map[string]string `mapstructure:"labels" required:"false" cty:"labels" hcl:"labels"` Metadata map[string]string `mapstructure:"metadata" required:"false" cty:"metadata" hcl:"metadata"` MetadataFromFile map[string]string `mapstructure:"metadata_from_file" cty:"metadata_from_file" hcl:"metadata_from_file"` Preemptible *bool `mapstructure:"preemptible" cty:"preemptible" hcl:"preemptible"` DiskName *string `mapstructure:"disk_name" required:"false" cty:"disk_name" hcl:"disk_name"` DiskSizeGb *int `mapstructure:"disk_size_gb" required:"false" cty:"disk_size_gb" hcl:"disk_size_gb"` DiskType *string `mapstructure:"disk_type" required:"false" cty:"disk_type" hcl:"disk_type"` DiskLabels map[string]string `mapstructure:"disk_labels" required:"false" cty:"disk_labels" hcl:"disk_labels"` SubnetID *string `mapstructure:"subnet_id" required:"false" cty:"subnet_id" hcl:"subnet_id"` Zone *string `mapstructure:"zone" required:"false" cty:"zone" hcl:"zone"` SecurityGroupIds []string `mapstructure:"security_group_ids" required:"false" cty:"security_group_ids" hcl:"security_group_ids"` UseIPv4Nat *bool `mapstructure:"use_ipv4_nat" required:"false" cty:"use_ipv4_nat" hcl:"use_ipv4_nat"` UseIPv6 *bool `mapstructure:"use_ipv6" required:"false" cty:"use_ipv6" hcl:"use_ipv6"` UseInternalIP *bool `mapstructure:"use_internal_ip" required:"false" cty:"use_internal_ip" hcl:"use_internal_ip"` FolderID *string `mapstructure:"folder_id" required:"true" cty:"folder_id" hcl:"folder_id"` ServiceAccountID *string `mapstructure:"service_account_id" required:"true" cty:"service_account_id" hcl:"service_account_id"` SSHHost *string `mapstructure:"ssh_host" cty:"ssh_host" hcl:"ssh_host"` SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHTemporaryKeyPairType *string `mapstructure:"temporary_key_pair_type" cty:"temporary_key_pair_type" hcl:"temporary_key_pair_type"` SSHTemporaryKeyPairBits *int `mapstructure:"temporary_key_pair_bits" cty:"temporary_key_pair_bits" hcl:"temporary_key_pair_bits"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` SSHKEXAlgos []string `mapstructure:"ssh_key_exchange_algorithms" cty:"ssh_key_exchange_algorithms" hcl:"ssh_key_exchange_algorithms"` SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHCertificateFile *string `mapstructure:"ssh_certificate_file" cty:"ssh_certificate_file" hcl:"ssh_certificate_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` SSHBastionPort *int `mapstructure:"ssh_bastion_port" cty:"ssh_bastion_port" hcl:"ssh_bastion_port"` SSHBastionAgentAuth *bool `mapstructure:"ssh_bastion_agent_auth" cty:"ssh_bastion_agent_auth" hcl:"ssh_bastion_agent_auth"` SSHBastionUsername *string `mapstructure:"ssh_bastion_username" cty:"ssh_bastion_username" hcl:"ssh_bastion_username"` SSHBastionPassword *string `mapstructure:"ssh_bastion_password" cty:"ssh_bastion_password" hcl:"ssh_bastion_password"` SSHBastionInteractive *bool `mapstructure:"ssh_bastion_interactive" cty:"ssh_bastion_interactive" hcl:"ssh_bastion_interactive"` SSHBastionPrivateKeyFile *string `mapstructure:"ssh_bastion_private_key_file" cty:"ssh_bastion_private_key_file" hcl:"ssh_bastion_private_key_file"` SSHBastionCertificateFile *string `mapstructure:"ssh_bastion_certificate_file" cty:"ssh_bastion_certificate_file" hcl:"ssh_bastion_certificate_file"` SSHFileTransferMethod *string `mapstructure:"ssh_file_transfer_method" cty:"ssh_file_transfer_method" hcl:"ssh_file_transfer_method"` SSHProxyHost *string `mapstructure:"ssh_proxy_host" cty:"ssh_proxy_host" hcl:"ssh_proxy_host"` SSHProxyPort *int `mapstructure:"ssh_proxy_port" cty:"ssh_proxy_port" hcl:"ssh_proxy_port"` SSHProxyUsername *string `mapstructure:"ssh_proxy_username" cty:"ssh_proxy_username" hcl:"ssh_proxy_username"` SSHProxyPassword *string `mapstructure:"ssh_proxy_password" cty:"ssh_proxy_password" hcl:"ssh_proxy_password"` SSHKeepAliveInterval *string `mapstructure:"ssh_keep_alive_interval" cty:"ssh_keep_alive_interval" hcl:"ssh_keep_alive_interval"` SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` Config *communicator.FlatConfig `mapstructure:"-" cty:"-" hcl:"-"` Paths []string `mapstructure:"paths" required:"true" cty:"paths" hcl:"paths"` SourceImageFolderID *string `mapstructure:"source_image_folder_id" required:"false" cty:"source_image_folder_id" hcl:"source_image_folder_id"` SourceImageFamily *string `mapstructure:"source_image_family" required:"false" cty:"source_image_family" hcl:"source_image_family"` SourceImageID *string `mapstructure:"source_image_id" required:"false" cty:"source_image_id" hcl:"source_image_id"` SourceDiskExtraSize *int `mapstructure:"source_disk_extra_size" required:"false" cty:"source_disk_extra_size" hcl:"source_disk_extra_size"` StorageEndpoint *string `mapstructure:"storage_endpoint" required:"false" cty:"storage_endpoint" hcl:"storage_endpoint"` StorageEndpointAutoresolve *bool `` /* 130-byte string literal not displayed */ StorageRegion *string `mapstructure:"storage_region" required:"false" cty:"storage_region" hcl:"storage_region"` }
FlatConfig is an auto-generated flat version of Config. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type PostProcessor ¶
type PostProcessor struct {
// contains filtered or unexported fields
}
func (*PostProcessor) ConfigSpec ¶
func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec
func (*PostProcessor) Configure ¶
func (p *PostProcessor) Configure(raws ...interface{}) error
type StepAttachDisk ¶
type StepAttachDisk struct { yandex.CommonConfig ImageID string ExtraSize int }
func (*StepAttachDisk) Cleanup ¶
func (s *StepAttachDisk) Cleanup(state multistep.StateBag)
func (*StepAttachDisk) Run ¶
func (c *StepAttachDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepCreateS3Keys ¶
func (*StepCreateS3Keys) Cleanup ¶
func (c *StepCreateS3Keys) Cleanup(state multistep.StateBag)
func (*StepCreateS3Keys) Run ¶
func (c *StepCreateS3Keys) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepPrepareTools ¶
type StepPrepareTools struct{}
func (*StepPrepareTools) Cleanup ¶
func (s *StepPrepareTools) Cleanup(state multistep.StateBag)
Cleanup nothing
func (*StepPrepareTools) Run ¶
func (s *StepPrepareTools) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
Run reads the instance metadata and looks for the log entry indicating the cloud-init script finished.
type StepUploadSecrets ¶
type StepUploadSecrets struct{}
func (*StepUploadSecrets) Cleanup ¶
func (s *StepUploadSecrets) Cleanup(state multistep.StateBag)
Cleanup.
func (*StepUploadSecrets) Run ¶
func (s *StepUploadSecrets) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
Run reads the instance metadata and looks for the log entry indicating the cloud-init script finished.
type StepUploadToS3 ¶
type StepUploadToS3 struct {
Paths []string
}
func (*StepUploadToS3) Cleanup ¶
func (s *StepUploadToS3) Cleanup(state multistep.StateBag)
Cleanup nothing
func (*StepUploadToS3) Run ¶
func (s *StepUploadToS3) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
Run reads the instance metadata and looks for the log entry indicating the cloud-init script finished.
Click to show internal directories.
Click to hide internal directories.