arm

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MPL-2.0, MIT Imports: 63 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultSasBlobContainer = "system/Microsoft.Compute"
	DefaultSecretName       = "packerKeyVaultSecret"
)
View Source
const (
	DefaultImageVersion                      = "latest"
	DefaultUserName                          = "packer"
	DefaultPrivateVirtualNetworkWithPublicIp = false
	DefaultVMSize                            = "Standard_A1"
	DefaultKeyVaultSKU                       = "standard"
)
View Source
const (
	BuilderId = "Azure.ResourceManagement.VMImage"
)
View Source
const (
	EnvPackerLogAzureMaxLen = "PACKER_LOG_AZURE_MAXLEN"
)
View Source
const (
	KeySize = 2048
)

Variables

View Source
var (
	EndpointCommunicationText = map[EndpointType]string{
		PublicEndpoint:                 "PublicEndpoint",
		PrivateEndpoint:                "PrivateEndpoint",
		PublicEndpointInPrivateNetwork: "PublicEndpointInPrivateNetwork",
	}
)
View Source
var ErrNoImage = errors.New("failed to find shared image gallery id in state")

Functions

func GetCommunicatorSpecificKeyVaultDeployment added in v1.4.0

func GetCommunicatorSpecificKeyVaultDeployment(config *Config) (*resources.Deployment, error)

func GetKeyVaultDeployment

func GetKeyVaultDeployment(config *Config, secretValue string) (*resources.Deployment, error)

func GetSpecializedVirtualMachineDeployment added in v1.4.4

func GetSpecializedVirtualMachineDeployment(config *Config) (*resources.Deployment, error)

func GetVirtualMachineDeployment

func GetVirtualMachineDeployment(config *Config) (*resources.Deployment, error)

func GetVirtualMachineTemplateBuilder added in v1.4.4

func GetVirtualMachineTemplateBuilder(config *Config) (*template.TemplateBuilder, error)

Types

type AdditionalDiskArtifact

type AdditionalDiskArtifact struct {
	AdditionalDiskUri            string
	AdditionalDiskUriReadOnlySas string
}

type Artifact

type Artifact struct {
	// OS type: Linux, Windows
	OSType string

	// VHD
	StorageAccountLocation string
	OSDiskUri              string
	TemplateUri            string
	OSDiskUriReadOnlySas   string
	TemplateUriReadOnlySas string

	// Managed Image
	ManagedImageResourceGroupName      string
	ManagedImageName                   string
	ManagedImageLocation               string
	ManagedImageId                     string
	ManagedImageOSDiskSnapshotName     string
	ManagedImageDataDiskSnapshotPrefix string

	// Shared Image Gallery
	// ARM resource id for Shared Image Gallery
	ManagedImageSharedImageGalleryId string
	SharedImageGalleryLocation       string

	// Additional Disks
	AdditionalDisks *[]AdditionalDiskArtifact

	// StateData should store data such as GeneratedData
	// to be shared with post-processors
	StateData map[string]interface{}
}

func NewArtifact

func NewArtifact(template *CaptureTemplate, getSasUrl func(name string) string, osType string, generatedData map[string]interface{}) (*Artifact, error)

func NewManagedImageArtifact

func NewManagedImageArtifact(osType, resourceGroup, name, location, id, osDiskSnapshotName, dataDiskSnapshotPrefix string, generatedData map[string]interface{}, keepOSDisk bool, template *CaptureTemplate, getSasUrl func(name string) string) (*Artifact, error)

func NewManagedImageArtifactWithSIGAsDestination

func NewManagedImageArtifactWithSIGAsDestination(osType, resourceGroup, name, location, id, osDiskSnapshotName, dataDiskSnapshotPrefix, destinationSharedImageGalleryId string, generatedData map[string]interface{}) (*Artifact, error)

func NewSharedImageArtifact added in v1.4.0

func NewSharedImageArtifact(osType, destinationSharedImageGalleryId string, location string, generatedData map[string]interface{}) (*Artifact, error)

func (*Artifact) BuilderId

func (*Artifact) BuilderId() string

func (*Artifact) Destroy

func (*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) ConfigSpec

func (b *Builder) ConfigSpec() hcldec.ObjectSpec

func (*Builder) Prepare

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

func (*Builder) Run

type CaptureBootDiagnostics

type CaptureBootDiagnostics struct {
	Enabled bool `json:"enabled"`
}

type CaptureDiagnosticProfile

type CaptureDiagnosticProfile struct {
	BootDiagnostics CaptureBootDiagnostics `json:"bootDiagnostics"`
}

type CaptureDisk

type CaptureDisk struct {
	OSType       string     `json:"osType"`
	Name         string     `json:"name"`
	Image        CaptureUri `json:"image"`
	Vhd          CaptureUri `json:"vhd"`
	CreateOption string     `json:"createOption"`
	Caching      string     `json:"caching"`
}

type CaptureHardwareProfile

type CaptureHardwareProfile struct {
	VMSize string `json:"vmSize"`
}

type CaptureNetworkInterface

type CaptureNetworkInterface struct {
	Id string `json:"id"`
}

type CaptureNetworkProfile

type CaptureNetworkProfile struct {
	NetworkInterfaces []CaptureNetworkInterface `json:"networkInterfaces"`
}

type CaptureOSProfile

type CaptureOSProfile struct {
	ComputerName  string `json:"computerName"`
	AdminUsername string `json:"adminUsername"`
	AdminPassword string `json:"adminPassword"`
}

type CaptureOperation

type CaptureOperation struct {
	OperationId string                      `json:"operationId"`
	Status      string                      `json:"status"`
	Properties  *CaptureOperationProperties `json:"properties"`
}

type CaptureOperationProperties

type CaptureOperationProperties struct {
	Output *CaptureTemplate `json:"output"`
}

type CaptureProperties

type CaptureProperties struct {
	HardwareProfile    CaptureHardwareProfile   `json:"hardwareProfile"`
	StorageProfile     CaptureStorageProfile    `json:"storageProfile"`
	OSProfile          CaptureOSProfile         `json:"osProfile"`
	NetworkProfile     CaptureNetworkProfile    `json:"networkProfile"`
	DiagnosticsProfile CaptureDiagnosticProfile `json:"diagnosticsProfile"`
	ProvisioningState  int                      `json:"provisioningState"`
}

type CaptureResources

type CaptureResources struct {
	ApiVersion string            `json:"apiVersion"`
	Name       string            `json:"name"`
	Type       string            `json:"type"`
	Location   string            `json:"location"`
	Properties CaptureProperties `json:"properties"`
}

type CaptureStorageProfile

type CaptureStorageProfile struct {
	OSDisk    CaptureDisk   `json:"osDisk"`
	DataDisks []CaptureDisk `json:"dataDisks"`
}

type CaptureTemplate

type CaptureTemplate struct {
	Schema         string                              `json:"$schema"`
	ContentVersion string                              `json:"contentVersion"`
	Parameters     map[string]CaptureTemplateParameter `json:"parameters"`
	Resources      []CaptureResources                  `json:"resources"`
}

type CaptureTemplateParameter

type CaptureTemplateParameter struct {
	Type         string `json:"type"`
	DefaultValue string `json:"defaultValue,omitempty"`
}

type CaptureUri

type CaptureUri struct {
	Uri string `json:"uri"`
}

type Config

type Config struct {
	common.PackerConfig `mapstructure:",squash"`

	azcommon.Config `mapstructure:",squash"`

	// Authentication via OAUTH
	ClientConfig client.Config `mapstructure:",squash"`

	// A list of one or more fully-qualified resource IDs of user assigned
	// managed identities to be configured on the VM.
	// See [documentation](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token)
	// for how to acquire tokens within the VM.
	// To assign a user assigned managed identity to a VM, the provided account or service principal must have [Managed Identity Operator](https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#managed-identity-operator)
	// and [Virtual Machine Contributor](https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#virtual-machine-contributor) role assignments.
	UserAssignedManagedIdentities []string `mapstructure:"user_assigned_managed_identities" required:"false"`

	// VHD prefix.
	CaptureNamePrefix string `mapstructure:"capture_name_prefix"`
	// Destination container name.
	CaptureContainerName string `mapstructure:"capture_container_name"`
	// Use a [Shared Gallery
	// image](https://azure.microsoft.com/en-us/blog/announcing-the-public-preview-of-shared-image-gallery/)
	// as the source for this build. *VHD targets are incompatible with this
	// build type* - the target must be a *Managed Image*. When using shared_image_gallery as a source, image_publisher,
	// image_offer, image_sku, image_version, and custom_managed_image_name should not be set.
	//
	// In JSON
	// “`json
	// "shared_image_gallery": {
	//     "subscription": "00000000-0000-0000-0000-00000000000",
	//     "resource_group": "ResourceGroup",
	//     "gallery_name": "GalleryName",
	//     "image_name": "ImageName",
	//     "image_version": "1.0.0",
	// }
	// "managed_image_name": "TargetImageName",
	// "managed_image_resource_group_name": "TargetResourceGroup"
	// “`
	// In HCL2
	// “`hcl
	// shared_image_gallery {
	//     subscription = "00000000-0000-0000-0000-00000000000"
	//     resource_group = "ResourceGroup"
	//     gallery_name = "GalleryName"
	//     image_name = "ImageName"
	//     image_version = "1.0.0"
	// }
	// managed_image_name = "TargetImageName"
	// managed_image_resource_group_name = "TargetResourceGroup"
	// “`
	SharedGallery SharedImageGallery `mapstructure:"shared_image_gallery" required:"false"`
	// The name of the Shared Image Gallery under which the managed image will be published as Shared Gallery Image version.
	//
	// Following is an example.
	//
	// In JSON
	// “`json
	// "shared_image_gallery_destination": {
	//     "subscription": "00000000-0000-0000-0000-00000000000",
	//     "resource_group": "ResourceGroup",
	//     "gallery_name": "GalleryName",
	//     "image_name": "ImageName",
	//     "image_version": "1.0.0",
	//     "replication_regions": ["regionA", "regionB", "regionC"],
	//     "storage_account_type": "Standard_LRS"
	// }
	// "managed_image_name": "TargetImageName",
	// "managed_image_resource_group_name": "TargetResourceGroup"
	// “`
	// In HCL2
	// “`hcl
	// shared_image_gallery_destination {
	//     subscription = "00000000-0000-0000-0000-00000000000"
	//     resource_group = "ResourceGroup"
	//     gallery_name = "GalleryName"
	//     image_name = "ImageName"
	//     image_version = "1.0.0"
	//     replication_regions = ["regionA", "regionB", "regionC"]
	//     storage_account_type = "Standard_LRS"
	// }
	// managed_image_name = "TargetImageName"
	// managed_image_resource_group_name = "TargetResourceGroup"
	// “`
	SharedGalleryDestination SharedImageGalleryDestination `mapstructure:"shared_image_gallery_destination"`
	// How long to wait for an image to be published to the shared image
	// gallery before timing out. If your Packer build is failing on the
	// Publishing to Shared Image Gallery step with the error `Original Error:
	// context deadline exceeded`, but the image is present when you check your
	// Azure dashboard, then you probably need to increase this timeout from
	// its default of "60m" (valid time units include `s` for seconds, `m` for
	// minutes, and `h` for hours.)
	SharedGalleryTimeout time.Duration `mapstructure:"shared_image_gallery_timeout"`
	// The end of life date (2006-01-02T15:04:05.99Z) of the gallery Image Version. This property
	// can be used for decommissioning purposes.
	SharedGalleryImageVersionEndOfLifeDate string `mapstructure:"shared_gallery_image_version_end_of_life_date" required:"false"`
	// The number of replicas of the Image Version to be created per region. This
	// property would take effect for a region when regionalReplicaCount is not specified.
	// Replica count must be between 1 and 100, but 50 replicas should be sufficient for most use cases.
	SharedGalleryImageVersionReplicaCount int32 `mapstructure:"shared_image_gallery_replica_count" required:"false"`
	// If set to true, Virtual Machines deployed from the latest version of the
	// Image Definition won't use this Image Version.
	SharedGalleryImageVersionExcludeFromLatest bool `mapstructure:"shared_gallery_image_version_exclude_from_latest" required:"false"`
	// Name of the publisher to use for your base image (Azure Marketplace Images only). See
	// [documentation](https://docs.microsoft.com/en-us/cli/azure/vm/image)
	// for details.
	//
	// CLI example `az vm image list-publishers --location westus`
	ImagePublisher string `mapstructure:"image_publisher" required:"true"`
	// Name of the publisher's offer to use for your base image (Azure Marketplace Images only). See
	// [documentation](https://docs.microsoft.com/en-us/cli/azure/vm/image)
	// for details.
	//
	// CLI example
	// `az vm image list-offers --location westus --publisher Canonical`
	ImageOffer string `mapstructure:"image_offer" required:"true"`
	// SKU of the image offer to use for your base image (Azure Marketplace Images only). See
	// [documentation](https://docs.microsoft.com/en-us/cli/azure/vm/image)
	// for details.
	//
	// CLI example
	// `az vm image list-skus --location westus --publisher Canonical --offer UbuntuServer`
	ImageSku string `mapstructure:"image_sku" required:"true"`
	// Specify a specific version of an OS to boot from.
	// Defaults to `latest`. There may be a difference in versions available
	// across regions due to image synchronization latency. To ensure a consistent
	// version across regions set this value to one that is available in all
	// regions where you are deploying.
	//
	// CLI example
	// `az vm image list --location westus --publisher Canonical --offer UbuntuServer --sku 16.04.0-LTS --all`
	ImageVersion string `mapstructure:"image_version" required:"false"`
	// URL to a custom VHD to use for your base image. If this value is set,
	// image_publisher, image_offer, image_sku, or image_version should not be set.
	ImageUrl string `mapstructure:"image_url" required:"true"`
	// Name of a custom managed image to use for your base image. If this value is set, do
	// not set image_publisher, image_offer, image_sku, or image_version.
	// If this value is set, the option
	// `custom_managed_image_resource_group_name` must also be set. See
	// [documentation](https://docs.microsoft.com/en-us/azure/storage/storage-managed-disks-overview#images)
	// to learn more about managed images.
	CustomManagedImageName string `mapstructure:"custom_managed_image_name" required:"true"`

	// Name of a custom managed image's resource group to use for your base image. If this
	// value is set, image_publisher, image_offer, image_sku, or image_version should not be set.
	// If this value is set, the option
	// `custom_managed_image_name` must also be set. See
	// [documentation](https://docs.microsoft.com/en-us/azure/storage/storage-managed-disks-overview#images)
	// to learn more about managed images.
	CustomManagedImageResourceGroupName string `mapstructure:"custom_managed_image_resource_group_name" required:"true"`

	// Azure datacenter in which your VM will build.
	Location string `mapstructure:"location"`
	// Size of the VM used for building. This can be changed when you deploy a
	// VM from your VHD. See
	// [pricing](https://azure.microsoft.com/en-us/pricing/details/virtual-machines/)
	// information. Defaults to `Standard_A1`.
	//
	// CLI example `az vm list-sizes --location westus`
	VMSize string `mapstructure:"vm_size" required:"false"`

	// If set use a spot instance during build; spot configuration settings only apply to the virtual machine launched by Packer and will not be persisted on the resulting image artifact.
	//
	// Following is an example.
	//
	// In JSON
	//
	// “`json
	// "spot": {
	//     "eviction_policy": "Delete",
	// 	   "max_price": "0.4",
	// }
	// “`
	//
	// In HCL2
	//
	// “`hcl
	// spot {
	//     eviction_policy = "Delete"
	//     max_price = "0.4"
	// }
	// “`
	Spot Spot `mapstructure:"spot" required:"false"`

	// Specify the managed image resource group name where the result of the
	// Packer build will be saved. The resource group must already exist. If
	// this value is set, the value managed_image_name must also be set. See
	// documentation to learn more about managed images.
	ManagedImageResourceGroupName string `mapstructure:"managed_image_resource_group_name"`
	// Specify the managed image name where the result of the Packer build will
	// be saved. The image name must not exist ahead of time, and will not be
	// overwritten. If this value is set, the value
	// managed_image_resource_group_name must also be set. See documentation to
	// learn more about managed images.
	ManagedImageName string `mapstructure:"managed_image_name"`
	// Specify the storage account
	// type for a managed image. Valid values are Standard_LRS and Premium_LRS.
	// The default is Standard_LRS.
	ManagedImageStorageAccountType string `mapstructure:"managed_image_storage_account_type" required:"false"`

	// If
	// managed_image_os_disk_snapshot_name is set, a snapshot of the OS disk
	// is created with the same name as this value before the VM is captured.
	ManagedImageOSDiskSnapshotName string `mapstructure:"managed_image_os_disk_snapshot_name" required:"false"`
	// If
	// managed_image_data_disk_snapshot_prefix is set, snapshot of the data
	// disk(s) is created with the same prefix as this value before the VM is
	// captured.
	ManagedImageDataDiskSnapshotPrefix string `mapstructure:"managed_image_data_disk_snapshot_prefix" required:"false"`
	// If
	// keep_os_disk is set, the OS disk is not deleted.
	// The default is false.
	KeepOSDisk bool `mapstructure:"keep_os_disk" required:"false"`
	// Store the image in zone-resilient storage. You need to create it in a
	// region that supports [availability
	// zones](https://docs.microsoft.com/en-us/azure/availability-zones/az-overview).
	ManagedImageZoneResilient bool `mapstructure:"managed_image_zone_resilient" required:"false"`
	// Name/value pair tags to apply to every resource deployed i.e. Resource
	// Group, VM, NIC, VNET, Public IP, KeyVault, etc. The user can define up
	// to 15 tags. Tag names cannot exceed 512 characters, and tag values
	// cannot exceed 256 characters.
	AzureTags map[string]string `mapstructure:"azure_tags" required:"false"`
	// Same as [`azure_tags`](#azure_tags) but defined as a singular repeatable block
	// containing a `name` and a `value` field. In HCL2 mode the
	// [`dynamic_block`](/packer/docs/templates/hcl_templates/expressions#dynamic-blocks)
	// will allow you to create those programatically.
	AzureTag config.NameValues `mapstructure:"azure_tag" required:"false"`
	// Resource group under which the final artifact will be stored.
	ResourceGroupName string `mapstructure:"resource_group_name"`
	// Storage account under which the final artifact will be stored.
	StorageAccount string `mapstructure:"storage_account"`
	// temporary name assigned to the VM. If this
	// value is not set, a random value will be assigned. Knowing the resource
	// group and VM name allows one to execute commands to update the VM during a
	// Packer build, e.g. attach a resource disk to the VM.
	TempComputeName string `mapstructure:"temp_compute_name" required:"false"`
	// temporary name assigned to the Nic. If this
	// value is not set, a random value will be assigned. Being able to assign a custom
	// nicname could ease deployment if naming conventions are used.
	TempNicName string `mapstructure:"temp_nic_name" required:"false"`
	// name assigned to the temporary resource group created during the build.
	// If this value is not set, a random value will be assigned. This resource
	// group is deleted at the end of the build.
	TempResourceGroupName string `mapstructure:"temp_resource_group_name"`
	// Specify an existing resource group to run the build in.
	BuildResourceGroupName string `mapstructure:"build_resource_group_name"`
	// Specify an existing key vault to use for uploading certificates to the
	// instance to connect.
	BuildKeyVaultName string `mapstructure:"build_key_vault_name"`
	// Specify the KeyVault SKU to create during the build. Valid values are
	// standard or premium. The default value is standard.
	BuildKeyVaultSKU string `mapstructure:"build_key_vault_sku"`

	// Specify the Disk Encryption Set ID to use to encrypt the OS and data disks created with the VM during the build
	// Only supported when publishing to Shared Image Galleries, without a managed image
	// The disk encryption set ID can be found in the properties tab of a disk encryption set on the Azure Portal, and is labeled as its resource ID
	// https://learn.microsoft.com/en-us/azure/virtual-machines/image-version-encryption
	DiskEncryptionSetId string `mapstructure:"disk_encryption_set_id"`

	// This value allows you to
	// set a virtual_network_name and obtain a public IP. If this value is not
	// set and virtual_network_name is defined Packer is only allowed to be
	// executed from a host on the same subnet / virtual network.
	PrivateVirtualNetworkWithPublicIp bool `mapstructure:"private_virtual_network_with_public_ip" required:"false"`
	// Use a pre-existing virtual network for the
	// VM. This option enables private communication with the VM, no public IP
	// address is used or provisioned (unless you set
	// private_virtual_network_with_public_ip).
	VirtualNetworkName string `mapstructure:"virtual_network_name" required:"false"`
	// If virtual_network_name is set,
	// this value may also be set. If virtual_network_name is set, and this
	// value is not set the builder attempts to determine the subnet to use with
	// the virtual network. If the subnet cannot be found, or it cannot be
	// disambiguated, this value should be set.
	VirtualNetworkSubnetName string `mapstructure:"virtual_network_subnet_name" required:"false"`
	// If virtual_network_name is
	// set, this value may also be set. If virtual_network_name is set, and
	// this value is not set the builder attempts to determine the resource group
	// containing the virtual network. If the resource group cannot be found, or
	// it cannot be disambiguated, this value should be set.
	VirtualNetworkResourceGroupName string `mapstructure:"virtual_network_resource_group_name" required:"false"`
	// Specify a file containing custom data to inject into the cloud-init
	// process. The contents of the file are read and injected into the ARM
	// template. The custom data will be passed to cloud-init for processing at
	// the time of provisioning. See
	// [documentation](http://cloudinit.readthedocs.io/en/latest/topics/examples.html)
	// to learn more about custom data, and how it can be used to influence the
	// provisioning process.
	CustomDataFile string `mapstructure:"custom_data_file" required:"false"`

	// Specify a Base64-encode custom data to apply when launching the instance.
	// Note that you need to be careful about escaping characters due to the templates being JSON.
	// The custom data will be passed to cloud-init for processing at
	// the time of provisioning. See
	// [documentation](http://cloudinit.readthedocs.io/en/latest/topics/examples.html)
	// to learn more about custom data, and how it can be used to influence the
	// provisioning process.
	CustomData string `mapstructure:"custom_data" required:"false"`
	// Specify a file containing user data to inject into the cloud-init
	// process. The contents of the file are read and injected into the ARM
	// template. The user data will be available from the provision until the vm is
	// deleted. Any application on the virtual machine can access the user data
	// from the Azure Instance Metadata Service (IMDS) after provision.
	// See [documentation](https://docs.microsoft.com/en-us/azure/virtual-machines/user-data)
	// to learn more about user data.
	UserDataFile string `mapstructure:"user_data_file" required:"false"`

	// Specify a Base64-encode user data to apply
	// Note that you need to be careful about escaping characters due to the templates being JSON.
	// The user data will be available from the provision until the vm is
	// deleted. Any application on the virtual machine can access the user data
	// from the Azure Instance Metadata Service (IMDS) after provision.
	// See [documentation](https://docs.microsoft.com/en-us/azure/virtual-machines/user-data)
	// to learn more about user data.
	UserData string `mapstructure:"user_data" required:"false"`

	// Used for running a script on VM provision during the image build
	// The following example executes the contents of the file specified by `user_data_file`:
	//  “`hcl2
	//  custom_script   = "powershell -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -Command \"$userData = (Invoke-RestMethod -Headers @{Metadata=$true} -Method GET -Uri http://169.254.169.254/metadata/instance/compute/userData?api-version=2021-01-01$([char]38)format=text); $contents = [System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($userData)); set-content -path c:\\Windows\\Temp\\userdata.ps1 -value $contents; . c:\\Windows\\Temp\\userdata.ps1;\""
	//  user_data_file  = "./scripts/userdata.ps1"
	//  “`
	// Specify a command to inject into the CustomScriptExtension, to run on startup
	// on Windows builds, before the communicator attempts to connect
	// See [documentation](https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/custom-script-windows)
	// to learn more.
	CustomScript string `mapstructure:"custom_script" required:"false"`

	// Used for creating images from Marketplace images. Please refer to
	// [Deploy an image with Marketplace
	// terms](https://aka.ms/azuremarketplaceapideployment) for more details.
	// Not all Marketplace images support programmatic deployment, and support
	// is controlled by the image publisher.
	//
	// An example plan\_info object is defined below.
	//
	// “`json
	// {
	//   "plan_info": {
	//       "plan_name": "rabbitmq",
	//       "plan_product": "rabbitmq",
	//       "plan_publisher": "bitnami"
	//   }
	// }
	// “`
	//
	// `plan_name` (string) - The plan name, required. `plan_product` (string) -
	// The plan product, required. `plan_publisher` (string) - The plan publisher,
	// required. `plan_promotion_code` (string) - Some images accept a promotion
	// code, optional.
	//
	// Images created from the Marketplace with `plan_info` **must** specify
	// `plan_info` whenever the image is deployed. The builder automatically adds
	// tags to the image to ensure this information is not lost. The following
	// tags are added.
	//
	// “`text
	// 1.  PlanName
	// 2.  PlanProduct
	// 3.  PlanPublisher
	// 4.  PlanPromotionCode
	// “`
	//
	PlanInfo PlanInformation `mapstructure:"plan_info" required:"false"`
	// The default PollingDuration for azure is 15mins, this property will override
	// that value. See [Azure DefaultPollingDuration](https://godoc.org/github.com/Azure/go-autorest/autorest#pkg-constants)
	// If your Packer build is failing on the
	// ARM deployment step with the error `Original Error:
	// context deadline exceeded`, then you probably need to increase this timeout from
	// its default of "15m" (valid time units include `s` for seconds, `m` for
	// minutes, and `h` for hours.)
	PollingDurationTimeout time.Duration `mapstructure:"polling_duration_timeout" required:"false"`
	// If either Linux or Windows is specified Packer will
	// automatically configure authentication credentials for the provisioned
	// machine. For Linux this configures an SSH authorized key. For Windows
	// this configures a WinRM certificate.
	OSType string `mapstructure:"os_type" required:"false"`
	// temporary name assigned to the OSDisk. If this
	// value is not set, a random value will be assigned. Being able to assign a custom
	// osDiskName could ease deployment if naming conventions are used.
	TempOSDiskName string `mapstructure:"temp_os_disk_name" required:"false"`
	// Specify the size of the OS disk in GB
	// (gigabytes). Values of zero or less than zero are ignored.
	OSDiskSizeGB int32 `mapstructure:"os_disk_size_gb" required:"false"`
	// The size(s) of any additional hard disks for the VM in gigabytes. If
	// this is not specified then the VM will only contain an OS disk. The
	// number of additional disks and maximum size of a disk depends on the
	// configuration of your VM. See
	// [Windows](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/about-disks-and-vhds)
	// or
	// [Linux](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/about-disks-and-vhds)
	// for more information.
	//
	// For VHD builds the final artifacts will be named
	// `PREFIX-dataDisk-<n>.UUID.vhd` and stored in the specified capture
	// container along side the OS disk. The additional disks are included in
	// the deployment template `PREFIX-vmTemplate.UUID`.
	//
	// For Managed build the final artifacts are included in the managed image.
	// The additional disk will have the same storage account type as the OS
	// disk, as specified with the `managed_image_storage_account_type`
	// setting.
	AdditionalDiskSize []int32 `mapstructure:"disk_additional_size" required:"false"`
	// Specify the disk caching type. Valid values
	// are None, ReadOnly, and ReadWrite. The default value is ReadWrite.
	DiskCachingType string `mapstructure:"disk_caching_type" required:"false"`

	// Specify the list of IP addresses and CIDR blocks that should be
	// allowed access to the VM. If provided, an Azure Network Security
	// Group will be created with corresponding rules and be bound to
	// the subnet of the VM.
	// Providing `allowed_inbound_ip_addresses` in combination with
	// `virtual_network_name` is not allowed.
	AllowedInboundIpAddresses []string `mapstructure:"allowed_inbound_ip_addresses"`

	// Specify storage to store Boot Diagnostics -- Enabling this option
	// will create 2 Files in the specified storage account. (serial console log & screehshot file)
	// once the build is completed, it has to be removed manually.
	// see [here](https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/boot-diagnostics) for more info
	BootDiagSTGAccount string `mapstructure:"boot_diag_storage_account" required:"false"`

	// specify custom azure resource names during build limited to max 10 characters
	// this will set the prefix for the resources. The actuall resource names will be
	// `custom_resource_build_prefix` + resourcetype + 5 character random alphanumeric string
	CustomResourcePrefix string `mapstructure:"custom_resource_build_prefix" required:"false"`

	// Specify a license type for the build VM to enable Azure Hybrid Benefit. If not set, Pay-As-You-Go license
	// model (default) will be used. Valid values are:
	//
	// For Windows:
	// - `Windows_Client`
	// - `Windows_Server`
	//
	// For Linux:
	// - `RHEL_BYOS`
	// - `SLES_BYOS`
	//
	// Refer to the following documentation for more information about Hybrid Benefit:
	// [Windows](https://learn.microsoft.com/en-us/azure/virtual-machines/windows/hybrid-use-benefit-licensing)
	// or
	// [Linux](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/azure-hybrid-benefit-linux)
	LicenseType string `mapstructure:"license_type" required:"false"`
	// Specifies if Secure Boot and Trusted Launch is enabled for the Virtual Machine.
	SecureBootEnabled bool `mapstructure:"secure_boot_enabled" required:"false"`
	// Specifies if Encryption at host is enabled for the Virtual Machine.
	// Requires enabling encryption at host in the Subscription read more [here](https://learn.microsoft.com/en-us/azure/virtual-machines/disks-enable-host-based-encryption-portal?tabs=azure-powershell)
	EncryptionAtHost bool `mapstructure:"encryption_at_host" required:"false"`

	// Specifies if vTPM (virtual Trusted Platform Module) and Trusted Launch is enabled for the Virtual Machine.
	VTpmEnabled bool `mapstructure:"vtpm_enabled" required:"false"`

	// Runtime Values
	UserName string `mapstructure-to-hcl2:",skip"`
	Password string `mapstructure-to-hcl2:",skip"`

	Comm communicator.Config `mapstructure:",squash"`

	// If you want packer to delete the
	// temporary resource group asynchronously set this value. It's a boolean
	// value and defaults to false. Important Setting this true means that
	// your builds are faster, however any failed deletes are not reported.
	AsyncResourceGroupDelete bool `mapstructure:"async_resourcegroup_delete" required:"false"`
	// contains filtered or unexported fields
}

func (*Config) FlatMapstructure

func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

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.

func (*Config) Prepare

func (c *Config) Prepare(raws ...interface{}) ([]string, error)

type DeploymentTemplateType added in v1.4.3

type DeploymentTemplateType int
const (
	VirtualMachineTemplate DeploymentTemplateType = iota
	KeyVaultTemplate
)

type EndpointType

type EndpointType int
const (
	PublicEndpoint EndpointType = iota
	PrivateEndpoint
	PublicEndpointInPrivateNetwork
)

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"`
	SkipCreateImage                            *bool                              `mapstructure:"skip_create_image" required:"false" cty:"skip_create_image" hcl:"skip_create_image"`
	CloudEnvironmentName                       *string                            `mapstructure:"cloud_environment_name" required:"false" cty:"cloud_environment_name" hcl:"cloud_environment_name"`
	MetadataHost                               *string                            `mapstructure:"metadata_host" required:"false" cty:"metadata_host" hcl:"metadata_host"`
	ClientID                                   *string                            `mapstructure:"client_id" cty:"client_id" hcl:"client_id"`
	ClientSecret                               *string                            `mapstructure:"client_secret" cty:"client_secret" hcl:"client_secret"`
	ClientCertPath                             *string                            `mapstructure:"client_cert_path" cty:"client_cert_path" hcl:"client_cert_path"`
	ClientCertExpireTimeout                    *string                            `mapstructure:"client_cert_token_timeout" required:"false" cty:"client_cert_token_timeout" hcl:"client_cert_token_timeout"`
	ClientJWT                                  *string                            `mapstructure:"client_jwt" cty:"client_jwt" hcl:"client_jwt"`
	ObjectID                                   *string                            `mapstructure:"object_id" cty:"object_id" hcl:"object_id"`
	TenantID                                   *string                            `mapstructure:"tenant_id" required:"false" cty:"tenant_id" hcl:"tenant_id"`
	SubscriptionID                             *string                            `mapstructure:"subscription_id" cty:"subscription_id" hcl:"subscription_id"`
	UseAzureCLIAuth                            *bool                              `mapstructure:"use_azure_cli_auth" required:"false" cty:"use_azure_cli_auth" hcl:"use_azure_cli_auth"`
	UseInteractiveAuth                         *bool                              `mapstructure:"use_interactive_auth" required:"false" cty:"use_interactive_auth" hcl:"use_interactive_auth"`
	UserAssignedManagedIdentities              []string                           `` /* 142-byte string literal not displayed */
	CaptureNamePrefix                          *string                            `mapstructure:"capture_name_prefix" cty:"capture_name_prefix" hcl:"capture_name_prefix"`
	CaptureContainerName                       *string                            `mapstructure:"capture_container_name" cty:"capture_container_name" hcl:"capture_container_name"`
	SharedGallery                              *FlatSharedImageGallery            `mapstructure:"shared_image_gallery" required:"false" cty:"shared_image_gallery" hcl:"shared_image_gallery"`
	SharedGalleryDestination                   *FlatSharedImageGalleryDestination `mapstructure:"shared_image_gallery_destination" cty:"shared_image_gallery_destination" hcl:"shared_image_gallery_destination"`
	SharedGalleryTimeout                       *string                            `mapstructure:"shared_image_gallery_timeout" cty:"shared_image_gallery_timeout" hcl:"shared_image_gallery_timeout"`
	SharedGalleryImageVersionEndOfLifeDate     *string                            `` /* 181-byte string literal not displayed */
	SharedGalleryImageVersionReplicaCount      *int32                             `` /* 148-byte string literal not displayed */
	SharedGalleryImageVersionExcludeFromLatest *bool                              `` /* 190-byte string literal not displayed */
	ImagePublisher                             *string                            `mapstructure:"image_publisher" required:"true" cty:"image_publisher" hcl:"image_publisher"`
	ImageOffer                                 *string                            `mapstructure:"image_offer" required:"true" cty:"image_offer" hcl:"image_offer"`
	ImageSku                                   *string                            `mapstructure:"image_sku" required:"true" cty:"image_sku" hcl:"image_sku"`
	ImageVersion                               *string                            `mapstructure:"image_version" required:"false" cty:"image_version" hcl:"image_version"`
	ImageUrl                                   *string                            `mapstructure:"image_url" required:"true" cty:"image_url" hcl:"image_url"`
	CustomManagedImageName                     *string                            `mapstructure:"custom_managed_image_name" required:"true" cty:"custom_managed_image_name" hcl:"custom_managed_image_name"`
	CustomManagedImageResourceGroupName        *string                            `` /* 165-byte string literal not displayed */
	Location                                   *string                            `mapstructure:"location" cty:"location" hcl:"location"`
	VMSize                                     *string                            `mapstructure:"vm_size" required:"false" cty:"vm_size" hcl:"vm_size"`
	Spot                                       *FlatSpot                          `mapstructure:"spot" required:"false" cty:"spot" hcl:"spot"`
	ManagedImageResourceGroupName              *string                            `` /* 128-byte string literal not displayed */
	ManagedImageName                           *string                            `mapstructure:"managed_image_name" cty:"managed_image_name" hcl:"managed_image_name"`
	ManagedImageStorageAccountType             *string                            `` /* 148-byte string literal not displayed */
	ManagedImageOSDiskSnapshotName             *string                            `` /* 151-byte string literal not displayed */
	ManagedImageDataDiskSnapshotPrefix         *string                            `` /* 163-byte string literal not displayed */
	KeepOSDisk                                 *bool                              `mapstructure:"keep_os_disk" required:"false" cty:"keep_os_disk" hcl:"keep_os_disk"`
	ManagedImageZoneResilient                  *bool                              `` /* 130-byte string literal not displayed */
	AzureTags                                  map[string]string                  `mapstructure:"azure_tags" required:"false" cty:"azure_tags" hcl:"azure_tags"`
	AzureTag                                   []config.FlatNameValue             `mapstructure:"azure_tag" required:"false" cty:"azure_tag" hcl:"azure_tag"`
	ResourceGroupName                          *string                            `mapstructure:"resource_group_name" cty:"resource_group_name" hcl:"resource_group_name"`
	StorageAccount                             *string                            `mapstructure:"storage_account" cty:"storage_account" hcl:"storage_account"`
	TempComputeName                            *string                            `mapstructure:"temp_compute_name" required:"false" cty:"temp_compute_name" hcl:"temp_compute_name"`
	TempNicName                                *string                            `mapstructure:"temp_nic_name" required:"false" cty:"temp_nic_name" hcl:"temp_nic_name"`
	TempResourceGroupName                      *string                            `mapstructure:"temp_resource_group_name" cty:"temp_resource_group_name" hcl:"temp_resource_group_name"`
	BuildResourceGroupName                     *string                            `mapstructure:"build_resource_group_name" cty:"build_resource_group_name" hcl:"build_resource_group_name"`
	BuildKeyVaultName                          *string                            `mapstructure:"build_key_vault_name" cty:"build_key_vault_name" hcl:"build_key_vault_name"`
	BuildKeyVaultSKU                           *string                            `mapstructure:"build_key_vault_sku" cty:"build_key_vault_sku" hcl:"build_key_vault_sku"`
	DiskEncryptionSetId                        *string                            `mapstructure:"disk_encryption_set_id" cty:"disk_encryption_set_id" hcl:"disk_encryption_set_id"`
	PrivateVirtualNetworkWithPublicIp          *bool                              `` /* 160-byte string literal not displayed */
	VirtualNetworkName                         *string                            `mapstructure:"virtual_network_name" required:"false" cty:"virtual_network_name" hcl:"virtual_network_name"`
	VirtualNetworkSubnetName                   *string                            `` /* 127-byte string literal not displayed */
	VirtualNetworkResourceGroupName            *string                            `` /* 151-byte string literal not displayed */
	CustomDataFile                             *string                            `mapstructure:"custom_data_file" required:"false" cty:"custom_data_file" hcl:"custom_data_file"`
	CustomData                                 *string                            `mapstructure:"custom_data" required:"false" cty:"custom_data" hcl:"custom_data"`
	UserDataFile                               *string                            `mapstructure:"user_data_file" required:"false" cty:"user_data_file" hcl:"user_data_file"`
	UserData                                   *string                            `mapstructure:"user_data" required:"false" cty:"user_data" hcl:"user_data"`
	CustomScript                               *string                            `mapstructure:"custom_script" required:"false" cty:"custom_script" hcl:"custom_script"`
	PlanInfo                                   *FlatPlanInformation               `mapstructure:"plan_info" required:"false" cty:"plan_info" hcl:"plan_info"`
	PollingDurationTimeout                     *string                            `mapstructure:"polling_duration_timeout" required:"false" cty:"polling_duration_timeout" hcl:"polling_duration_timeout"`
	OSType                                     *string                            `mapstructure:"os_type" required:"false" cty:"os_type" hcl:"os_type"`
	TempOSDiskName                             *string                            `mapstructure:"temp_os_disk_name" required:"false" cty:"temp_os_disk_name" hcl:"temp_os_disk_name"`
	OSDiskSizeGB                               *int32                             `mapstructure:"os_disk_size_gb" required:"false" cty:"os_disk_size_gb" hcl:"os_disk_size_gb"`
	AdditionalDiskSize                         []int32                            `mapstructure:"disk_additional_size" required:"false" cty:"disk_additional_size" hcl:"disk_additional_size"`
	DiskCachingType                            *string                            `mapstructure:"disk_caching_type" required:"false" cty:"disk_caching_type" hcl:"disk_caching_type"`
	AllowedInboundIpAddresses                  []string                           `mapstructure:"allowed_inbound_ip_addresses" cty:"allowed_inbound_ip_addresses" hcl:"allowed_inbound_ip_addresses"`
	BootDiagSTGAccount                         *string                            `mapstructure:"boot_diag_storage_account" required:"false" cty:"boot_diag_storage_account" hcl:"boot_diag_storage_account"`
	CustomResourcePrefix                       *string                            `` /* 130-byte string literal not displayed */
	LicenseType                                *string                            `mapstructure:"license_type" required:"false" cty:"license_type" hcl:"license_type"`
	SecureBootEnabled                          *bool                              `mapstructure:"secure_boot_enabled" required:"false" cty:"secure_boot_enabled" hcl:"secure_boot_enabled"`
	EncryptionAtHost                           *bool                              `mapstructure:"encryption_at_host" required:"false" cty:"encryption_at_host" hcl:"encryption_at_host"`
	VTpmEnabled                                *bool                              `mapstructure:"vtpm_enabled" required:"false" cty:"vtpm_enabled" hcl:"vtpm_enabled"`
	Type                                       *string                            `mapstructure:"communicator" cty:"communicator" hcl:"communicator"`
	PauseBeforeConnect                         *string                            `mapstructure:"pause_before_connecting" cty:"pause_before_connecting" hcl:"pause_before_connecting"`
	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"`
	WinRMUser                                  *string                            `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"`
	WinRMPassword                              *string                            `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"`
	WinRMHost                                  *string                            `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"`
	WinRMNoProxy                               *bool                              `mapstructure:"winrm_no_proxy" cty:"winrm_no_proxy" hcl:"winrm_no_proxy"`
	WinRMPort                                  *int                               `mapstructure:"winrm_port" cty:"winrm_port" hcl:"winrm_port"`
	WinRMTimeout                               *string                            `mapstructure:"winrm_timeout" cty:"winrm_timeout" hcl:"winrm_timeout"`
	WinRMUseSSL                                *bool                              `mapstructure:"winrm_use_ssl" cty:"winrm_use_ssl" hcl:"winrm_use_ssl"`
	WinRMInsecure                              *bool                              `mapstructure:"winrm_insecure" cty:"winrm_insecure" hcl:"winrm_insecure"`
	WinRMUseNTLM                               *bool                              `mapstructure:"winrm_use_ntlm" cty:"winrm_use_ntlm" hcl:"winrm_use_ntlm"`
	AsyncResourceGroupDelete                   *bool                              `mapstructure:"async_resourcegroup_delete" required:"false" cty:"async_resourcegroup_delete" hcl:"async_resourcegroup_delete"`
}

FlatConfig is an auto-generated flat version of Config. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatConfig) HCL2Spec

func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a Config. This spec is used by HCL to read the fields of Config. The decoded values from this spec will then be applied to a FlatConfig.

type FlatPlanInformation

type FlatPlanInformation struct {
	PlanName          *string `mapstructure:"plan_name" cty:"plan_name" hcl:"plan_name"`
	PlanProduct       *string `mapstructure:"plan_product" cty:"plan_product" hcl:"plan_product"`
	PlanPublisher     *string `mapstructure:"plan_publisher" cty:"plan_publisher" hcl:"plan_publisher"`
	PlanPromotionCode *string `mapstructure:"plan_promotion_code" cty:"plan_promotion_code" hcl:"plan_promotion_code"`
}

FlatPlanInformation is an auto-generated flat version of PlanInformation. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatPlanInformation) HCL2Spec

func (*FlatPlanInformation) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a PlanInformation. This spec is used by HCL to read the fields of PlanInformation. The decoded values from this spec will then be applied to a FlatPlanInformation.

type FlatSharedImageGallery

type FlatSharedImageGallery struct {
	Subscription               *string `mapstructure:"subscription" cty:"subscription" hcl:"subscription"`
	ResourceGroup              *string `mapstructure:"resource_group" cty:"resource_group" hcl:"resource_group"`
	GalleryName                *string `mapstructure:"gallery_name" cty:"gallery_name" hcl:"gallery_name"`
	ImageName                  *string `mapstructure:"image_name" cty:"image_name" hcl:"image_name"`
	ImageVersion               *string `mapstructure:"image_version" required:"false" cty:"image_version" hcl:"image_version"`
	CommunityGalleryImageId    *string `mapstructure:"community_gallery_image_id" required:"false" cty:"community_gallery_image_id" hcl:"community_gallery_image_id"`
	DirectSharedGalleryImageID *string `` /* 136-byte string literal not displayed */
}

FlatSharedImageGallery is an auto-generated flat version of SharedImageGallery. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatSharedImageGallery) HCL2Spec

func (*FlatSharedImageGallery) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a SharedImageGallery. This spec is used by HCL to read the fields of SharedImageGallery. The decoded values from this spec will then be applied to a FlatSharedImageGallery.

type FlatSharedImageGalleryDestination

type FlatSharedImageGalleryDestination struct {
	SigDestinationSubscription       *string  `mapstructure:"subscription" cty:"subscription" hcl:"subscription"`
	SigDestinationResourceGroup      *string  `mapstructure:"resource_group" cty:"resource_group" hcl:"resource_group"`
	SigDestinationGalleryName        *string  `mapstructure:"gallery_name" cty:"gallery_name" hcl:"gallery_name"`
	SigDestinationImageName          *string  `mapstructure:"image_name" cty:"image_name" hcl:"image_name"`
	SigDestinationImageVersion       *string  `mapstructure:"image_version" cty:"image_version" hcl:"image_version"`
	SigDestinationReplicationRegions []string `mapstructure:"replication_regions" cty:"replication_regions" hcl:"replication_regions"`
	SigDestinationStorageAccountType *string  `mapstructure:"storage_account_type" cty:"storage_account_type" hcl:"storage_account_type"`
	SigDestinationSpecialized        *bool    `mapstructure:"specialized" cty:"specialized" hcl:"specialized"`
}

FlatSharedImageGalleryDestination is an auto-generated flat version of SharedImageGalleryDestination. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatSharedImageGalleryDestination) HCL2Spec

HCL2Spec returns the hcl spec of a SharedImageGalleryDestination. This spec is used by HCL to read the fields of SharedImageGalleryDestination. The decoded values from this spec will then be applied to a FlatSharedImageGalleryDestination.

type FlatSpot added in v1.4.0

type FlatSpot struct {
	EvictionPolicy *compute.VirtualMachineEvictionPolicyTypes `mapstructure:"eviction_policy" cty:"eviction_policy" hcl:"eviction_policy"`
	MaxPrice       *float32                                   `mapstructure:"max_price" cty:"max_price" hcl:"max_price"`
}

FlatSpot is an auto-generated flat version of Spot. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatSpot) HCL2Spec added in v1.4.0

func (*FlatSpot) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a Spot. This spec is used by HCL to read the fields of Spot. The decoded values from this spec will then be applied to a FlatSpot.

type OpenSshKeyPair

type OpenSshKeyPair struct {
	// contains filtered or unexported fields
}

func NewOpenSshKeyPair

func NewOpenSshKeyPair() (*OpenSshKeyPair, error)

func NewOpenSshKeyPairWithSize

func NewOpenSshKeyPairWithSize(keySize int) (*OpenSshKeyPair, error)

func (*OpenSshKeyPair) AuthorizedKey

func (s *OpenSshKeyPair) AuthorizedKey() string

func (*OpenSshKeyPair) PrivateKey

func (s *OpenSshKeyPair) PrivateKey() []byte

type PlanInformation

type PlanInformation struct {
	PlanName          string `mapstructure:"plan_name"`
	PlanProduct       string `mapstructure:"plan_product"`
	PlanPublisher     string `mapstructure:"plan_publisher"`
	PlanPromotionCode string `mapstructure:"plan_promotion_code"`
}

func (*PlanInformation) FlatMapstructure

func (*PlanInformation) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatPlanInformation. FlatPlanInformation is an auto-generated flat version of PlanInformation. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type SharedImageGallery

type SharedImageGallery struct {
	Subscription  string `mapstructure:"subscription"`
	ResourceGroup string `mapstructure:"resource_group"`
	GalleryName   string `mapstructure:"gallery_name"` //Gallery resource name
	ImageName     string `mapstructure:"image_name"`
	// Specify a specific version of an OS to boot from.
	// Defaults to latest. There may be a difference in versions available
	// across regions due to image synchronization latency. To ensure a consistent
	// version across regions set this value to one that is available in all
	// regions where you are deploying.
	ImageVersion string `mapstructure:"image_version" required:"false"`

	// Id of the community gallery image : /CommunityGalleries/{galleryUniqueName}/Images/{img}[/Versions/{}] (Versions part is optional)
	CommunityGalleryImageId string `mapstructure:"community_gallery_image_id" required:"false"`

	// Id of the direct shared gallery image : /sharedGalleries/{galleryUniqueName}/Images/{img}[/Versions/{}] (Versions part is optional)
	DirectSharedGalleryImageID string `mapstructure:"direct_shared_gallery_image_id" required:"false"`
}

func (*SharedImageGallery) FlatMapstructure

func (*SharedImageGallery) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatSharedImageGallery. FlatSharedImageGallery is an auto-generated flat version of SharedImageGallery. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type SharedImageGalleryDestination

type SharedImageGalleryDestination struct {
	SigDestinationSubscription       string   `mapstructure:"subscription"`
	SigDestinationResourceGroup      string   `mapstructure:"resource_group"`
	SigDestinationGalleryName        string   `mapstructure:"gallery_name"`
	SigDestinationImageName          string   `mapstructure:"image_name"`
	SigDestinationImageVersion       string   `mapstructure:"image_version"`
	SigDestinationReplicationRegions []string `mapstructure:"replication_regions"`
	// Specify a storage account type for the Shared Image Gallery Image Version.
	// Defaults to `Standard_LRS`. Accepted values are `Standard_LRS`, `Standard_ZRS` and `Premium_LRS`
	SigDestinationStorageAccountType string `mapstructure:"storage_account_type"`
	// Set to true if publishing to a Specialized Gallery, this skips a call to set the build VM's OS state as Generalized
	SigDestinationSpecialized bool `mapstructure:"specialized"`
}

func (*SharedImageGalleryDestination) FlatMapstructure

func (*SharedImageGalleryDestination) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatSharedImageGalleryDestination. FlatSharedImageGalleryDestination is an auto-generated flat version of SharedImageGalleryDestination. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type Spot added in v1.4.0

type Spot struct {
	// Specify eviction policy for spot instance: "Deallocate" or "Delete". If this is set, a spot instance will be used.
	EvictionPolicy compute.VirtualMachineEvictionPolicyTypes `mapstructure:"eviction_policy"`
	// How much should the VM cost maximally per hour. Specify -1 (or do not specify) to not evict based on price.
	MaxPrice float32 `mapstructure:"max_price"`
}

func (*Spot) FlatMapstructure added in v1.4.0

func (*Spot) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatSpot. FlatSpot is an auto-generated flat version of Spot. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type StepCaptureImage

type StepCaptureImage struct {
	// contains filtered or unexported fields
}

func NewStepCaptureImage

func NewStepCaptureImage(client *AzureClient, ui packersdk.Ui) *StepCaptureImage

func (*StepCaptureImage) Cleanup

func (*StepCaptureImage) Run

type StepCertificateInKeyVault

type StepCertificateInKeyVault struct {
	// contains filtered or unexported fields
}

func NewStepCertificateInKeyVault

func NewStepCertificateInKeyVault(cli common.AZVaultClientIface, ui packersdk.Ui, config *Config, certificate string) *StepCertificateInKeyVault

func (*StepCertificateInKeyVault) Cleanup

func (*StepCertificateInKeyVault) Run

type StepCreateResourceGroup

type StepCreateResourceGroup struct {
	// contains filtered or unexported fields
}

func NewStepCreateResourceGroup

func NewStepCreateResourceGroup(client *AzureClient, ui packersdk.Ui) *StepCreateResourceGroup

func (*StepCreateResourceGroup) Cleanup

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

func (*StepCreateResourceGroup) Run

type StepDeployTemplate

type StepDeployTemplate struct {
	// contains filtered or unexported fields
}

func NewStepDeployTemplate

func NewStepDeployTemplate(client *AzureClient, ui packersdk.Ui, config *Config, deploymentName string, factory templateFactoryFunc, templateType DeploymentTemplateType) *StepDeployTemplate

func (*StepDeployTemplate) Cleanup

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

func (*StepDeployTemplate) Run

type StepGetCertificate

type StepGetCertificate struct {
	// contains filtered or unexported fields
}

func NewStepGetCertificate

func NewStepGetCertificate(client *AzureClient, ui packersdk.Ui) *StepGetCertificate

func (*StepGetCertificate) Cleanup

func (*StepGetCertificate) Run

type StepGetDataDisk

type StepGetDataDisk struct {
	// contains filtered or unexported fields
}

func NewStepGetAdditionalDisks

func NewStepGetAdditionalDisks(client *AzureClient, ui packersdk.Ui) *StepGetDataDisk

func (*StepGetDataDisk) Cleanup

func (*StepGetDataDisk) Run

type StepGetIPAddress

type StepGetIPAddress struct {
	// contains filtered or unexported fields
}

func NewStepGetIPAddress

func NewStepGetIPAddress(client *AzureClient, ui packersdk.Ui, endpoint EndpointType) *StepGetIPAddress

func (*StepGetIPAddress) Cleanup

func (*StepGetIPAddress) Run

type StepGetOSDisk

type StepGetOSDisk struct {
	// contains filtered or unexported fields
}

func NewStepGetOSDisk

func NewStepGetOSDisk(client *AzureClient, ui packersdk.Ui) *StepGetOSDisk

func (*StepGetOSDisk) Cleanup

func (*StepGetOSDisk) Cleanup(multistep.StateBag)

func (*StepGetOSDisk) Run

type StepGetSourceImageName added in v1.0.4

type StepGetSourceImageName struct {
	GeneratedData *packerbuilderdata.GeneratedData
	// contains filtered or unexported fields
}

func NewStepGetSourceImageName added in v1.4.3

func NewStepGetSourceImageName(client *AzureClient, ui packersdk.Ui, config *Config, GeneratedData *packerbuilderdata.GeneratedData) *StepGetSourceImageName

func (*StepGetSourceImageName) Cleanup added in v1.0.4

func (*StepGetSourceImageName) GetGalleryImageVersion added in v1.4.3

func (s *StepGetSourceImageName) GetGalleryImageVersion(ctx context.Context) (compute.GalleryImageVersion, error)

func (*StepGetSourceImageName) Run added in v1.0.4

type StepPowerOffCompute

type StepPowerOffCompute struct {
	// contains filtered or unexported fields
}

func NewStepPowerOffCompute

func NewStepPowerOffCompute(client *AzureClient, ui packersdk.Ui) *StepPowerOffCompute

func (*StepPowerOffCompute) Cleanup

func (*StepPowerOffCompute) Run

type StepPublishToSharedImageGallery

type StepPublishToSharedImageGallery struct {
	// contains filtered or unexported fields
}

func NewStepPublishToSharedImageGallery

func NewStepPublishToSharedImageGallery(client *AzureClient, ui packersdk.Ui, config *Config) *StepPublishToSharedImageGallery

func (*StepPublishToSharedImageGallery) Cleanup

func (*StepPublishToSharedImageGallery) Run

type StepSetCertificate

type StepSetCertificate struct {
	// contains filtered or unexported fields
}

func NewStepSetCertificate

func NewStepSetCertificate(config *Config, ui packersdk.Ui) *StepSetCertificate

func (*StepSetCertificate) Cleanup

func (*StepSetCertificate) Run

type StepSnapshotDataDisks

type StepSnapshotDataDisks struct {
	// contains filtered or unexported fields
}

func NewStepSnapshotDataDisks

func NewStepSnapshotDataDisks(client *AzureClient, ui packersdk.Ui, config *Config) *StepSnapshotDataDisks

func (*StepSnapshotDataDisks) Cleanup

func (*StepSnapshotDataDisks) Run

type StepSnapshotOSDisk

type StepSnapshotOSDisk struct {
	// contains filtered or unexported fields
}

func NewStepSnapshotOSDisk

func NewStepSnapshotOSDisk(client *AzureClient, ui packersdk.Ui, config *Config) *StepSnapshotOSDisk

func (*StepSnapshotOSDisk) Cleanup

func (*StepSnapshotOSDisk) Run

type StepValidateTemplate

type StepValidateTemplate struct {
	// contains filtered or unexported fields
}

func NewStepValidateTemplate

func NewStepValidateTemplate(client *AzureClient, ui packersdk.Ui, config *Config, deploymentName string, factory templateFactoryFunc) *StepValidateTemplate

func (*StepValidateTemplate) Cleanup

func (*StepValidateTemplate) Run

type TempName

type TempName struct {
	AdminPassword       string
	CertificatePassword string
	ComputeName         string
	DeploymentName      string
	KeyVaultName        string
	ResourceGroupName   string
	OSDiskName          string
	DataDiskName        string
	NicName             string
	SubnetName          string
	PublicIPAddressName string
	VirtualNetworkName  string
	NsgName             string
}

func NewTempName

func NewTempName(p string) *TempName

Jump to

Keyboard shortcuts

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