Documentation
¶
Index ¶
- Constants
- Variables
- func GetKeyVaultDeployment(config *Config) (*resources.Deployment, error)
- func GetVirtualMachineDeployment(config *Config) (*resources.Deployment, error)
- type AdditionalDiskArtifact
- type Artifact
- type Authenticate
- 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 OpenSshKeyPair
- type PlanInformation
- type StepCaptureImage
- type StepCreateResourceGroup
- type StepDeleteAdditionalDisk
- type StepDeleteOSDisk
- type StepDeleteResourceGroup
- type StepDeployTemplate
- type StepGetCertificate
- type StepGetDataDisk
- type StepGetIPAddress
- type StepGetOSDisk
- type StepPowerOffCompute
- type StepSetCertificate
- type StepValidateTemplate
- type TempName
Constants ¶
View Source
const ( DefaultSasBlobContainer = "system/Microsoft.Compute" DefaultSasBlobPermission = "r" DefaultSecretName = "packerKeyVaultSecret" )
View Source
const ( DefaultCloudEnvironmentName = "Public" DefaultImageVersion = "latest" DefaultUserName = "packer" DefaultPrivateVirtualNetworkWithPublicIp = false DefaultVMSize = "Standard_A1" )
View Source
const ( TempNameAlphabet = "0123456789bcdfghjklmnpqrstvwxyz" TempPasswordAlphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" )
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", } )
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 {
// VHD
StorageAccountLocation string
OSDiskUri string
TemplateUri string
OSDiskUriReadOnlySas string
TemplateUriReadOnlySas string
// Managed Image
ManagedImageResourceGroupName string
ManagedImageName string
ManagedImageLocation string
// Additional Disks
AdditionalDisks *[]AdditionalDiskArtifact
}
func NewArtifact ¶ added in v0.10.1
func NewArtifact(template *CaptureTemplate, getSasUrl func(name string) string) (*Artifact, error)
func NewManagedImageArtifact ¶ added in v1.0.3
type Authenticate ¶ added in v0.10.1
type Authenticate struct {
// contains filtered or unexported fields
}
func NewAuthenticate ¶ added in v0.10.1
func NewAuthenticate(env azure.Environment, clientID, clientSecret, tenantID string) *Authenticate
type AzureClient ¶
type AzureClient struct {
storage.BlobStorageClient
resources.DeploymentsClient
resources.DeploymentOperationsClient
resources.GroupsClient
network.PublicIPAddressesClient
network.InterfacesClient
network.SubnetsClient
network.VirtualNetworksClient
compute.ImagesClient
compute.VirtualMachinesClient
common.VaultClient
armStorage.AccountsClient
disk.DisksClient
InspectorMaxLength int
Template *CaptureTemplate
LastError azureErrorResponse
VaultClientDelete common.VaultClient
}
func NewAzureClient ¶
func NewAzureClient(subscriptionID, resourceGroupName, storageAccountName string, cloud *azure.Environment, servicePrincipalToken, servicePrincipalTokenVault *adal.ServicePrincipalToken) (*AzureClient, error)
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
ClientID string `mapstructure:"client_id"`
ClientSecret string `mapstructure:"client_secret"`
ObjectID string `mapstructure:"object_id"`
TenantID string `mapstructure:"tenant_id"`
SubscriptionID string `mapstructure:"subscription_id"`
// Capture
CaptureNamePrefix string `mapstructure:"capture_name_prefix"`
CaptureContainerName string `mapstructure:"capture_container_name"`
// Compute
ImagePublisher string `mapstructure:"image_publisher"`
ImageOffer string `mapstructure:"image_offer"`
ImageSku string `mapstructure:"image_sku"`
ImageVersion string `mapstructure:"image_version"`
ImageUrl string `mapstructure:"image_url"`
CustomManagedImageResourceGroupName string `mapstructure:"custom_managed_image_resource_group_name"`
CustomManagedImageName string `mapstructure:"custom_managed_image_name"`
Location string `mapstructure:"location"`
VMSize string `mapstructure:"vm_size"`
ManagedImageResourceGroupName string `mapstructure:"managed_image_resource_group_name"`
ManagedImageName string `mapstructure:"managed_image_name"`
ManagedImageStorageAccountType string `mapstructure:"managed_image_storage_account_type"`
// Deployment
AzureTags map[string]*string `mapstructure:"azure_tags"`
ResourceGroupName string `mapstructure:"resource_group_name"`
StorageAccount string `mapstructure:"storage_account"`
TempComputeName string `mapstructure:"temp_compute_name"`
TempResourceGroupName string `mapstructure:"temp_resource_group_name"`
BuildResourceGroupName string `mapstructure:"build_resource_group_name"`
CloudEnvironmentName string `mapstructure:"cloud_environment_name"`
PrivateVirtualNetworkWithPublicIp bool `mapstructure:"private_virtual_network_with_public_ip"`
VirtualNetworkName string `mapstructure:"virtual_network_name"`
VirtualNetworkSubnetName string `mapstructure:"virtual_network_subnet_name"`
VirtualNetworkResourceGroupName string `mapstructure:"virtual_network_resource_group_name"`
CustomDataFile string `mapstructure:"custom_data_file"`
PlanInfo PlanInformation `mapstructure:"plan_info"`
// OS
OSType string `mapstructure:"os_type"`
OSDiskSizeGB int32 `mapstructure:"os_disk_size_gb"`
// Additional Disks
AdditionalDiskSize []int32 `mapstructure:"disk_additional_size"`
// Runtime Values
UserName string
Password string
Comm communicator.Config `mapstructure:",squash"`
// contains filtered or unexported fields
}
type EndpointType ¶ added in v0.11.0
type EndpointType int
const ( PublicEndpoint EndpointType = iota PrivateEndpoint PublicEndpointInPrivateNetwork )
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() string
type PlanInformation ¶ added in v1.2.2
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(_ 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(_ 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(_ 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(_ 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(_ 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(_ 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(_ 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(_ 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(_ 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(_ 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(_ context.Context, state 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(_ context.Context, state 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(_ 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
}
func NewTempName ¶
func NewTempName() *TempName
Source Files
¶
- artifact.go
- authenticate.go
- azure_client.go
- azure_error_response.go
- builder.go
- capture_template.go
- config.go
- config_retriever.go
- inspector.go
- openssh_key_pair.go
- resource_resolver.go
- step.go
- step_capture_image.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_set_certificate.go
- step_validate_template.go
- template_factory.go
- tempname.go
Click to show internal directories.
Click to hide internal directories.