Documentation
¶
Overview ¶
Code generated by "mapstructure-to-hcl2 -type Config,SharedImageGallery,SharedImageGalleryDestination,PlanInformation"; DO NOT EDIT.
Index ¶
- Constants
- Variables
- func GetKeyVaultDeployment(config *Config) (*resources.Deployment, error)
- func GetVirtualMachineDeployment(config *Config) (*resources.Deployment, error)
- type AdditionalDiskArtifact
- type Artifact
- func NewArtifact(template *CaptureTemplate, getSasUrl func(name string) string, osType string, ...) (*Artifact, error)
- func NewManagedImageArtifact(osType, resourceGroup, name, location, id, osDiskSnapshotName, ... string, ...) (*Artifact, error)
- func NewManagedImageArtifactWithSIGAsDestination(osType, resourceGroup, name, location, id, osDiskSnapshotName, ... string, ...) (*Artifact, error)
- type AzureClient
- type Builder
- type CaptureBootDiagnostics
- type CaptureDiagnosticProfile
- type CaptureDisk
- type CaptureHardwareProfile
- type CaptureNetworkInterface
- type CaptureNetworkProfile
- type CaptureOSProfile
- type CaptureOperation
- type CaptureOperationProperties
- type CaptureProperties
- type CaptureResources
- type CaptureStorageProfile
- type CaptureTemplate
- type CaptureTemplateParameter
- type CaptureUri
- type Config
- type EndpointType
- type FlatConfig
- type FlatPlanInformation
- type FlatSharedImageGallery
- type FlatSharedImageGalleryDestination
- type OpenSshKeyPair
- type PlanInformation
- type SharedImageGallery
- type SharedImageGalleryDestination
- type StepCaptureImage
- type StepCertificateInKeyVault
- type StepCreateResourceGroup
- type StepDeleteAdditionalDisk
- type StepDeleteOSDisk
- type StepDeleteResourceGroup
- type StepDeployTemplate
- type StepGetCertificate
- type StepGetDataDisk
- type StepGetIPAddress
- type StepGetOSDisk
- type StepPowerOffCompute
- type StepPublishToSharedImageGallery
- type StepSetCertificate
- type StepSnapshotDataDisks
- type StepSnapshotOSDisk
- type StepValidateTemplate
- type TempName
Constants ¶
const ( DefaultSasBlobContainer = "system/Microsoft.Compute" DefaultSecretName = "packerKeyVaultSecret" )
const ( DefaultImageVersion = "latest" DefaultUserName = "packer" DefaultPrivateVirtualNetworkWithPublicIp = false DefaultVMSize = "Standard_A1" )
const (
BuilderId = "Azure.ResourceManagement.VMImage"
)
const (
EnvPackerLogAzureMaxLen = "PACKER_LOG_AZURE_MAXLEN"
)
const (
KeySize = 2048
)
Variables ¶
var ( EndpointCommunicationText = map[EndpointType]string{ PublicEndpoint: "PublicEndpoint", PrivateEndpoint: "PrivateEndpoint", PublicEndpointInPrivateNetwork: "PublicEndpointInPrivateNetwork", } )
Functions ¶
func GetKeyVaultDeployment ¶ added in v0.11.0
func GetKeyVaultDeployment(config *Config) (*resources.Deployment, error)
func GetVirtualMachineDeployment ¶ added in v0.11.0
func GetVirtualMachineDeployment(config *Config) (*resources.Deployment, error)
Types ¶
type AdditionalDiskArtifact ¶ added in v1.2.2
type Artifact ¶ added in v0.10.1
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
ManagedImageSharedImageGalleryId string
// Additional Disks
AdditionalDisks *[]AdditionalDiskArtifact
// StateData should store data such as GeneratedData
// to be shared with post-processors
StateData map[string]interface{}
}
func NewArtifact ¶ added in v0.10.1
func NewManagedImageArtifact ¶ added in v1.0.3
func NewManagedImageArtifactWithSIGAsDestination ¶ added in v1.4.3
type AzureClient ¶
type AzureClient struct {
storage.BlobStorageClient
resources.DeploymentsClient
resources.DeploymentOperationsClient
resources.GroupsClient
network.PublicIPAddressesClient
network.InterfacesClient
network.SubnetsClient
network.VirtualNetworksClient
network.SecurityGroupsClient
compute.ImagesClient
compute.VirtualMachinesClient
common.VaultClient
armStorage.AccountsClient
compute.DisksClient
compute.SnapshotsClient
newCompute.GalleryImageVersionsClient
newCompute.GalleryImagesClient
InspectorMaxLength int
Template *CaptureTemplate
LastError azureErrorResponse
VaultClientDelete common.VaultClient
}
func NewAzureClient ¶
func NewAzureClient(subscriptionID, resourceGroupName, storageAccountName string, cloud *azure.Environment, SharedGalleryTimeout time.Duration, PollingDuration time.Duration, servicePrincipalToken, servicePrincipalTokenVault *adal.ServicePrincipalToken) (*AzureClient, error)
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 CaptureBootDiagnostics ¶ added in v0.10.1
type CaptureBootDiagnostics struct {
Enabled bool `json:"enabled"`
}
type CaptureDiagnosticProfile ¶ added in v0.10.1
type CaptureDiagnosticProfile struct {
BootDiagnostics CaptureBootDiagnostics `json:"bootDiagnostics"`
}
type CaptureDisk ¶ added in v0.10.1
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 ¶ added in v0.10.1
type CaptureHardwareProfile struct {
VMSize string `json:"vmSize"`
}
type CaptureNetworkInterface ¶ added in v0.10.1
type CaptureNetworkInterface struct {
Id string `json:"id"`
}
type CaptureNetworkProfile ¶ added in v0.10.1
type CaptureNetworkProfile struct {
NetworkInterfaces []CaptureNetworkInterface `json:"networkInterfaces"`
}
type CaptureOSProfile ¶ added in v0.10.1
type CaptureOperation ¶ added in v0.10.1
type CaptureOperation struct {
OperationId string `json:"operationId"`
Status string `json:"status"`
Properties *CaptureOperationProperties `json:"properties"`
}
type CaptureOperationProperties ¶ added in v0.10.1
type CaptureOperationProperties struct {
Output *CaptureTemplate `json:"output"`
}
type CaptureProperties ¶ added in v0.10.1
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 ¶ added in v0.10.1
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 ¶ added in v0.10.1
type CaptureStorageProfile struct {
OSDisk CaptureDisk `json:"osDisk"`
DataDisks []CaptureDisk `json:"dataDisks"`
}
type CaptureTemplate ¶ added in v0.10.1
type CaptureTemplate struct {
Schema string `json:"$schema"`
ContentVersion string `json:"contentVersion"`
Parameters map[string]CaptureTemplateParameter `json:"parameters"`
Resources []CaptureResources `json:"resources"`
}
type CaptureTemplateParameter ¶ added in v0.10.1
type CaptureUri ¶ added in v0.10.1
type CaptureUri struct {
Uri string `json:"uri"`
}
type Config ¶
type Config struct {
common.PackerConfig `mapstructure:",squash"`
// Authentication via OAUTH
ClientConfig client.Config `mapstructure:",squash"`
// Capture
CaptureNamePrefix string `mapstructure:"capture_name_prefix"`
CaptureContainerName string `mapstructure:"capture_container_name"`
// 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*.
//
// "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"`
//
// Following is an example.
//
// "shared_image_gallery_destination": {
// "resource_group": "ResourceGroup",
// "gallery_name": "GalleryName",
// "image_name": "ImageName",
// "image_version": "1.0.0",
// "replication_regions": ["regionA", "regionB", "regionC"]
// }
// "managed_image_name": "TargetImageName",
// "managed_image_resource_group_name": "TargetResourceGroup"
SharedGalleryDestination SharedImageGalleryDestination `mapstructure:"shared_image_gallery_destination"`
// 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"`
// can be used for decommissioning purposes.
SharedGalleryImageVersionEndOfLifeDate string `mapstructure:"shared_gallery_image_version_end_of_life_date" required:"false"`
// property would take effect for a region when regionalReplicaCount is not specified.
// Replica count must be between 1 and 10.
SharedGalleryImageVersionReplicaCount int32 `mapstructure:"shared_image_gallery_replica_count" required:"false"`
// 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://azure.microsoft.com/en-us/documentation/articles/resource-groups-vm-searching/)
// 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://azure.microsoft.com/en-us/documentation/articles/resource-groups-vm-searching/)
// 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://azure.microsoft.com/en-us/documentation/articles/resource-groups-vm-searching/)
// 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, do
// not set image_publisher, image_offer, image_sku, or image_version.
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 value
// `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.
// `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"`
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"`
// 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"`
// 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"`
// the user can define up to 15
// tags. Tag names cannot exceed 512 characters, and tag values cannot exceed
// 256 characters. Tags are applied to every resource deployed by a Packer
// build, i.e. Resource Group, VM, NIC, VNET, Public IP, KeyVault, etc.
AzureTags map[string]*string `mapstructure:"azure_tags" 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"`
// 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"`
// 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"`
// 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.
//
// 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"`
// 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"`
// Runtime Values
UserName string
Password string
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 ¶ 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 EndpointType ¶ added in v0.11.0
type EndpointType int
const ( PublicEndpoint EndpointType = iota PrivateEndpoint PublicEndpointInPrivateNetwork )
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"`
CloudEnvironmentName *string `mapstructure:"cloud_environment_name" required:"false" cty:"cloud_environment_name"`
ClientID *string `mapstructure:"client_id" cty:"client_id"`
ClientSecret *string `mapstructure:"client_secret" cty:"client_secret"`
ClientCertPath *string `mapstructure:"client_cert_path" cty:"client_cert_path"`
ClientJWT *string `mapstructure:"client_jwt" cty:"client_jwt"`
ObjectID *string `mapstructure:"object_id" cty:"object_id"`
TenantID *string `mapstructure:"tenant_id" required:"false" cty:"tenant_id"`
SubscriptionID *string `mapstructure:"subscription_id" cty:"subscription_id"`
CaptureNamePrefix *string `mapstructure:"capture_name_prefix" cty:"capture_name_prefix"`
CaptureContainerName *string `mapstructure:"capture_container_name" cty:"capture_container_name"`
ImagePublisher *string `mapstructure:"image_publisher" required:"true" cty:"image_publisher"`
ImageOffer *string `mapstructure:"image_offer" required:"true" cty:"image_offer"`
ImageSku *string `mapstructure:"image_sku" required:"true" cty:"image_sku"`
ImageVersion *string `mapstructure:"image_version" required:"false" cty:"image_version"`
ImageUrl *string `mapstructure:"image_url" required:"true" cty:"image_url"`
CustomManagedImageName *string `mapstructure:"custom_managed_image_name" required:"true" cty:"custom_managed_image_name"`
CustomManagedImageResourceGroupName *string `mapstructure:"custom_managed_image_resource_group_name" required:"true" cty:"custom_managed_image_resource_group_name"`
Location *string `mapstructure:"location" cty:"location"`
VMSize *string `mapstructure:"vm_size" required:"false" cty:"vm_size"`
ManagedImageResourceGroupName *string `mapstructure:"managed_image_resource_group_name" cty:"managed_image_resource_group_name"`
ManagedImageName *string `mapstructure:"managed_image_name" cty:"managed_image_name"`
ManagedImageStorageAccountType *string `mapstructure:"managed_image_storage_account_type" required:"false" cty:"managed_image_storage_account_type"`
ManagedImageOSDiskSnapshotName *string `mapstructure:"managed_image_os_disk_snapshot_name" required:"false" cty:"managed_image_os_disk_snapshot_name"`
ManagedImageDataDiskSnapshotPrefix *string `mapstructure:"managed_image_data_disk_snapshot_prefix" required:"false" cty:"managed_image_data_disk_snapshot_prefix"`
ManagedImageZoneResilient *bool `mapstructure:"managed_image_zone_resilient" required:"false" cty:"managed_image_zone_resilient"`
AzureTags map[string]*string `mapstructure:"azure_tags" required:"false" cty:"azure_tags"`
ResourceGroupName *string `mapstructure:"resource_group_name" cty:"resource_group_name"`
StorageAccount *string `mapstructure:"storage_account" cty:"storage_account"`
TempComputeName *string `mapstructure:"temp_compute_name" required:"false" cty:"temp_compute_name"`
TempResourceGroupName *string `mapstructure:"temp_resource_group_name" cty:"temp_resource_group_name"`
BuildResourceGroupName *string `mapstructure:"build_resource_group_name" cty:"build_resource_group_name"`
BuildKeyVaultName *string `mapstructure:"build_key_vault_name" cty:"build_key_vault_name"`
PrivateVirtualNetworkWithPublicIp *bool `mapstructure:"private_virtual_network_with_public_ip" required:"false" cty:"private_virtual_network_with_public_ip"`
VirtualNetworkName *string `mapstructure:"virtual_network_name" required:"false" cty:"virtual_network_name"`
VirtualNetworkSubnetName *string `mapstructure:"virtual_network_subnet_name" required:"false" cty:"virtual_network_subnet_name"`
VirtualNetworkResourceGroupName *string `mapstructure:"virtual_network_resource_group_name" required:"false" cty:"virtual_network_resource_group_name"`
CustomDataFile *string `mapstructure:"custom_data_file" required:"false" cty:"custom_data_file"`
PlanInfo *FlatPlanInformation `mapstructure:"plan_info" required:"false" cty:"plan_info"`
PollingDurationTimeout *string `mapstructure:"polling_duration_timeout" required:"false" cty:"polling_duration_timeout"`
OSType *string `mapstructure:"os_type" required:"false" cty:"os_type"`
OSDiskSizeGB *int32 `mapstructure:"os_disk_size_gb" required:"false" cty:"os_disk_size_gb"`
AdditionalDiskSize []int32 `mapstructure:"disk_additional_size" required:"false" cty:"disk_additional_size"`
DiskCachingType *string `mapstructure:"disk_caching_type" required:"false" cty:"disk_caching_type"`
AllowedInboundIpAddresses []string `mapstructure:"allowed_inbound_ip_addresses" cty:"allowed_inbound_ip_addresses"`
UserName *string `cty:"user_name"`
Password *string `cty:"password"`
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"`
AsyncResourceGroupDelete *bool `mapstructure:"async_resourcegroup_delete" required:"false" cty:"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.
type FlatPlanInformation ¶ added in v1.4.5
type FlatPlanInformation struct {
PlanName *string `mapstructure:"plan_name" cty:"plan_name"`
PlanProduct *string `mapstructure:"plan_product" cty:"plan_product"`
PlanPublisher *string `mapstructure:"plan_publisher" cty:"plan_publisher"`
PlanPromotionCode *string `mapstructure:"plan_promotion_code" cty:"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 ¶ added in v1.4.5
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 ¶ added in v1.4.5
type FlatSharedImageGallery struct {
}
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 ¶ added in v1.4.5
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 ¶ added in v1.4.5
type FlatSharedImageGalleryDestination struct {
}
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 ¶ added in v1.4.5
func (*FlatSharedImageGalleryDestination) HCL2Spec() map[string]hcldec.Spec
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 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 ¶ added in v1.2.2
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 ¶ added in v1.4.5
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 ¶ added in v1.3.2
type SharedImageGallery struct {
// 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"`
}
func (*SharedImageGallery) FlatMapstructure ¶ added in v1.4.5
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 ¶ added in v1.4.2
type SharedImageGalleryDestination struct {
}
func (*SharedImageGalleryDestination) FlatMapstructure ¶ added in v1.4.5
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 StepCaptureImage ¶
type StepCaptureImage struct {
// contains filtered or unexported fields
}
func NewStepCaptureImage ¶
func NewStepCaptureImage(client *AzureClient, ui packer.Ui) *StepCaptureImage
func (*StepCaptureImage) Cleanup ¶
func (*StepCaptureImage) Cleanup(multistep.StateBag)
func (*StepCaptureImage) Run ¶
func (s *StepCaptureImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepCertificateInKeyVault ¶ added in v1.5.2
type StepCertificateInKeyVault struct {
// contains filtered or unexported fields
}
func NewStepCertificateInKeyVault ¶ added in v1.5.2
func NewStepCertificateInKeyVault(cli common.AZVaultClientIface, ui packer.Ui, config *Config) *StepCertificateInKeyVault
func (*StepCertificateInKeyVault) Cleanup ¶ added in v1.5.2
func (*StepCertificateInKeyVault) Cleanup(multistep.StateBag)
func (*StepCertificateInKeyVault) Run ¶ added in v1.5.2
func (s *StepCertificateInKeyVault) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepCreateResourceGroup ¶
type StepCreateResourceGroup struct {
// contains filtered or unexported fields
}
func NewStepCreateResourceGroup ¶
func NewStepCreateResourceGroup(client *AzureClient, ui packer.Ui) *StepCreateResourceGroup
func (*StepCreateResourceGroup) Cleanup ¶
func (s *StepCreateResourceGroup) Cleanup(state multistep.StateBag)
func (*StepCreateResourceGroup) Run ¶
func (s *StepCreateResourceGroup) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepDeleteAdditionalDisk ¶ added in v1.2.2
type StepDeleteAdditionalDisk struct {
// contains filtered or unexported fields
}
func NewStepDeleteAdditionalDisks ¶ added in v1.2.2
func NewStepDeleteAdditionalDisks(client *AzureClient, ui packer.Ui) *StepDeleteAdditionalDisk
func (*StepDeleteAdditionalDisk) Cleanup ¶ added in v1.2.2
func (*StepDeleteAdditionalDisk) Cleanup(multistep.StateBag)
func (*StepDeleteAdditionalDisk) Run ¶ added in v1.2.2
func (s *StepDeleteAdditionalDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepDeleteOSDisk ¶
type StepDeleteOSDisk struct {
// contains filtered or unexported fields
}
func NewStepDeleteOSDisk ¶
func NewStepDeleteOSDisk(client *AzureClient, ui packer.Ui) *StepDeleteOSDisk
func (*StepDeleteOSDisk) Cleanup ¶
func (*StepDeleteOSDisk) Cleanup(multistep.StateBag)
func (*StepDeleteOSDisk) Run ¶
func (s *StepDeleteOSDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepDeleteResourceGroup ¶
type StepDeleteResourceGroup struct {
// contains filtered or unexported fields
}
func NewStepDeleteResourceGroup ¶
func NewStepDeleteResourceGroup(client *AzureClient, ui packer.Ui) *StepDeleteResourceGroup
func (*StepDeleteResourceGroup) Cleanup ¶
func (*StepDeleteResourceGroup) Cleanup(multistep.StateBag)
func (*StepDeleteResourceGroup) Run ¶
func (s *StepDeleteResourceGroup) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepDeployTemplate ¶
type StepDeployTemplate struct {
// contains filtered or unexported fields
}
func NewStepDeployTemplate ¶
func NewStepDeployTemplate(client *AzureClient, ui packer.Ui, config *Config, deploymentName string, factory templateFactoryFunc) *StepDeployTemplate
func (*StepDeployTemplate) Cleanup ¶
func (s *StepDeployTemplate) Cleanup(state multistep.StateBag)
func (*StepDeployTemplate) Run ¶
func (s *StepDeployTemplate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepGetCertificate ¶ added in v0.10.1
type StepGetCertificate struct {
// contains filtered or unexported fields
}
func NewStepGetCertificate ¶ added in v0.10.1
func NewStepGetCertificate(client *AzureClient, ui packer.Ui) *StepGetCertificate
func (*StepGetCertificate) Cleanup ¶ added in v0.10.1
func (*StepGetCertificate) Cleanup(multistep.StateBag)
func (*StepGetCertificate) Run ¶ added in v0.10.1
func (s *StepGetCertificate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepGetDataDisk ¶ added in v1.2.2
type StepGetDataDisk struct {
// contains filtered or unexported fields
}
func NewStepGetAdditionalDisks ¶ added in v1.2.2
func NewStepGetAdditionalDisks(client *AzureClient, ui packer.Ui) *StepGetDataDisk
func (*StepGetDataDisk) Cleanup ¶ added in v1.2.2
func (*StepGetDataDisk) Cleanup(multistep.StateBag)
func (*StepGetDataDisk) Run ¶ added in v1.2.2
func (s *StepGetDataDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepGetIPAddress ¶
type StepGetIPAddress struct {
// contains filtered or unexported fields
}
func NewStepGetIPAddress ¶
func NewStepGetIPAddress(client *AzureClient, ui packer.Ui, endpoint EndpointType) *StepGetIPAddress
func (*StepGetIPAddress) Cleanup ¶
func (*StepGetIPAddress) Cleanup(multistep.StateBag)
func (*StepGetIPAddress) Run ¶
func (s *StepGetIPAddress) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepGetOSDisk ¶
type StepGetOSDisk struct {
// contains filtered or unexported fields
}
func NewStepGetOSDisk ¶
func NewStepGetOSDisk(client *AzureClient, ui packer.Ui) *StepGetOSDisk
func (*StepGetOSDisk) Cleanup ¶
func (*StepGetOSDisk) Cleanup(multistep.StateBag)
func (*StepGetOSDisk) Run ¶
func (s *StepGetOSDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepPowerOffCompute ¶
type StepPowerOffCompute struct {
// contains filtered or unexported fields
}
func NewStepPowerOffCompute ¶
func NewStepPowerOffCompute(client *AzureClient, ui packer.Ui) *StepPowerOffCompute
func (*StepPowerOffCompute) Cleanup ¶
func (*StepPowerOffCompute) Cleanup(multistep.StateBag)
func (*StepPowerOffCompute) Run ¶
func (s *StepPowerOffCompute) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepPublishToSharedImageGallery ¶ added in v1.4.2
type StepPublishToSharedImageGallery struct {
// contains filtered or unexported fields
}
func NewStepPublishToSharedImageGallery ¶ added in v1.4.2
func NewStepPublishToSharedImageGallery(client *AzureClient, ui packer.Ui, config *Config) *StepPublishToSharedImageGallery
func (*StepPublishToSharedImageGallery) Cleanup ¶ added in v1.4.2
func (*StepPublishToSharedImageGallery) Cleanup(multistep.StateBag)
func (*StepPublishToSharedImageGallery) Run ¶ added in v1.4.2
func (s *StepPublishToSharedImageGallery) Run(ctx context.Context, stateBag multistep.StateBag) multistep.StepAction
type StepSetCertificate ¶ added in v0.10.1
type StepSetCertificate struct {
// contains filtered or unexported fields
}
func NewStepSetCertificate ¶ added in v0.10.1
func NewStepSetCertificate(config *Config, ui packer.Ui) *StepSetCertificate
func (*StepSetCertificate) Cleanup ¶ added in v0.10.1
func (*StepSetCertificate) Cleanup(multistep.StateBag)
func (*StepSetCertificate) Run ¶ added in v0.10.1
func (s *StepSetCertificate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepSnapshotDataDisks ¶ added in v1.3.3
type StepSnapshotDataDisks struct {
// contains filtered or unexported fields
}
func NewStepSnapshotDataDisks ¶ added in v1.3.3
func NewStepSnapshotDataDisks(client *AzureClient, ui packer.Ui, config *Config) *StepSnapshotDataDisks
func (*StepSnapshotDataDisks) Cleanup ¶ added in v1.3.3
func (*StepSnapshotDataDisks) Cleanup(multistep.StateBag)
func (*StepSnapshotDataDisks) Run ¶ added in v1.3.3
func (s *StepSnapshotDataDisks) Run(ctx context.Context, stateBag multistep.StateBag) multistep.StepAction
type StepSnapshotOSDisk ¶ added in v1.3.3
type StepSnapshotOSDisk struct {
// contains filtered or unexported fields
}
func NewStepSnapshotOSDisk ¶ added in v1.3.3
func NewStepSnapshotOSDisk(client *AzureClient, ui packer.Ui, config *Config) *StepSnapshotOSDisk
func (*StepSnapshotOSDisk) Cleanup ¶ added in v1.3.3
func (*StepSnapshotOSDisk) Cleanup(multistep.StateBag)
func (*StepSnapshotOSDisk) Run ¶ added in v1.3.3
func (s *StepSnapshotOSDisk) Run(ctx context.Context, stateBag multistep.StateBag) multistep.StepAction
type StepValidateTemplate ¶
type StepValidateTemplate struct {
// contains filtered or unexported fields
}
func NewStepValidateTemplate ¶
func NewStepValidateTemplate(client *AzureClient, ui packer.Ui, config *Config, factory templateFactoryFunc) *StepValidateTemplate
func (*StepValidateTemplate) Cleanup ¶
func (*StepValidateTemplate) Cleanup(multistep.StateBag)
func (*StepValidateTemplate) Run ¶
func (s *StepValidateTemplate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type TempName ¶
type TempName struct {
AdminPassword string
CertificatePassword string
ComputeName string
DeploymentName string
KeyVaultName string
ResourceGroupName string
OSDiskName string
NicName string
SubnetName string
PublicIPAddressName string
VirtualNetworkName string
NsgName string
}
func NewTempName ¶
func NewTempName() *TempName
Source Files
¶
- artifact.go
- azure_client.go
- azure_error_response.go
- builder.go
- capture_template.go
- config.go
- config.hcl2spec.go
- inspector.go
- openssh_key_pair.go
- resource_resolver.go
- step.go
- step_capture_image.go
- step_certificate_in_keyvault.go
- step_create_resource_group.go
- step_delete_additional_disks.go
- step_delete_os_disk.go
- step_delete_resource_group.go
- step_deploy_template.go
- step_get_additional_disks.go
- step_get_certificate.go
- step_get_ip_address.go
- step_get_os_disk.go
- step_power_off_compute.go
- step_publish_to_shared_image_gallery.go
- step_set_certificate.go
- step_snapshot_data_disks.go
- step_snapshot_os_disk.go
- step_validate_template.go
- template_factory.go
- tempname.go