config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSSHUsername      = "packer"
	DefaultZone             = mws.DefaultZone
	DefaultVMType           = "gen-2-8"
	DefaultDiskType         = "nbs-pl2"
	DefaultDiskSize         = "10 GB"
	DefaultDiskIOPS         = int64(1000)
	DefaultSubnetCidr       = "192.168.0.0/16"
	DefaultIPV6Prefix       = "64:ff9b::/96"
	DefaultImageDescription = "Image created by Packer"
	DefaultCleanupTimeout   = time.Hour

	DefaultAdditionalDiskForExportSize = "0 GB"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessConfig

type AccessConfig struct {
	// The project identifier where resources will be created.
	Project string `mapstructure:"project" required:"true"`
	// The zone in which the VM will be created (defaults to "ru-central1-a")
	Zone string `mapstructure:"zone" required:"false"`

	// MWS Cloud Platform API base endpoint (defaults to "https://api.mwsapis.ru").
	// Can be specified using the `MWS_BASE_ENDPOINT` environment variable.
	BaseEndpoint string `mapstructure:"base_endpoint" required:"false"`
	// Path to the service account authorized key file used for authentication.
	// Has no effect if IAM token is set.
	// Can be specified using the `MWS_SERVICE_ACCOUNT_AUTHORIZED_KEY_PATH` environment variable.
	ServiceAccountAuthorizedKeyPath string `mapstructure:"service_account_authorized_key_path" required:"false"`
	// IAM token used for authentication.
	// Can be specified using the `MWS_TOKEN` environment variable.
	Token string `mapstructure:"token" required:"false"`
}

func (*AccessConfig) SetDefaults

func (c *AccessConfig) SetDefaults()

func (*AccessConfig) Validate

func (c *AccessConfig) Validate() error

type DiskConfig

type DiskConfig struct {
	// Name for the disk (defaults to "packer-{{uuid}}-disk").
	DiskName string `mapstructure:"disk_name" required:"false"`
	// Type of disk to create (defaults to "nbs-pl2").
	DiskType string `mapstructure:"disk_type" required:"false"`
	// Size of the disk (defaults to "10 GB").
	DiskSize string `mapstructure:"disk_size" required:"false"`
	// IOPS for the disk (defaults to 1000).
	DiskIOPS int64 `mapstructure:"disk_iops" required:"false"`
	// Project ID where the source image/snapshot exists (defaults to the `project`).
	SourceProject string `mapstructure:"source_project" required:"false"`
	// ID of an existing image to use as a base (required unless using `source_snapshot`).
	SourceImage string `mapstructure:"source_image" required:"false"`
	// ID of an existing snapshot to use as a base (required unless using `source_image`).
	SourceSnapshot string `mapstructure:"source_snapshot" required:"false"`
}

func (*DiskConfig) SetDefaults

func (c *DiskConfig) SetDefaults()

func (*DiskConfig) Validate

func (c *DiskConfig) Validate() error

type ImageConfig

type ImageConfig struct {
	// Name for the resulting image (defaults to "packer-{{uuid}}-image").
	ImageName string `mapstructure:"image_name" required:"false"`
	// Display name for the resulting image (defaults to the `image_name`).
	ImageDisplayName string `mapstructure:"image_display_name" required:"false"`
	// Description for the resulting image. (defaults to "Image created by Packer").
	ImageDescription string `mapstructure:"image_description" required:"false"`
}

func (*ImageConfig) SetDefaults

func (c *ImageConfig) SetDefaults()

func (*ImageConfig) Validate

func (c *ImageConfig) Validate() error

type NetworkConfig

type NetworkConfig struct {
	// Name for the network (defaults to "packer-{{uuid}}-network").
	// If specified, Packer will use existing network.
	NetworkName string `mapstructure:"network_name" required:"false"`
	// Name for the subnet (defaults to "packer-{{uuid}}-subnet").
	// If specified, Packer will use existing subnet.
	SubnetName string `mapstructure:"subnet_name" required:"false"`
	// Subnet CIDR (defaults to "192.168.0.0/16").
	SubnetCidr string `mapstructure:"subnet_cidr" required:"false"`
	// Use external address for connection to virtual machine from internet (defaults to "false").
	UseExternalAddress bool `mapstructure:"use_external_address" required:"false"`
	// External address name (defaults to "packer-{{uuid}}-external-address").
	// Can be specified only if external address usage is enabled.
	ExternalAddressName string `mapstructure:"external_address_name" required:"false"`
	// Enables virtual machine ip conversion from ipv4 to ipv6 with RFC 6052 (defaults to "false").
	// Meant to be used when packer is in ipv6 only network.
	Nat64Enable bool `mapstructure:"nat64_enable" required:"false"`
	// Prefix used in nat64 conversion (defaults to "64:ff9b::/96" (RFC 6052 Well-Known Prefix)).
	// CIDR notation only.
	Nat64IPV6Prefix string `mapstructure:"nat64_ipv6_prefix" required:"false"`
}

func (*NetworkConfig) SetDefaults

func (c *NetworkConfig) SetDefaults()

func (*NetworkConfig) Validate

func (c *NetworkConfig) Validate() error

type VirtualMachineConfig

type VirtualMachineConfig struct {
	DiskConfig    `mapstructure:",squash"`
	NetworkConfig `mapstructure:",squash"`
	// Name for the temporary build VM (defaults to "packer-{{uuid}}-vm").
	VirtualMachineName string `mapstructure:"virtual_machine_name" required:"false"`
	// The VM type (defaults to "gen-2-8").
	VMType string `mapstructure:"vm_type" required:"false"`

	// Configuration script for initial setup of a virtual machine in the
	// [#cloud-config](https://docs.cloud-init.io/en/latest/explanation/format/cloud-config.html)
	// format. Note that this configuration would be extended with SSH key used
	// for Packer communicator.
	CloudConfig string `mapstructure:"cloud_config" required:"false"`

	// Timeout for resources cleanup (defaults to "1h").
	CleanupTimeout time.Duration `mapstructure:"cleanup_timeout" required:"false"`
}

func (*VirtualMachineConfig) SetDefaults

func (c *VirtualMachineConfig) SetDefaults()

func (*VirtualMachineConfig) Validate

func (c *VirtualMachineConfig) Validate() error

Jump to

Keyboard shortcuts

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