arm

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2018 License: MPL-2.0, MIT Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSasBlobContainer = "system/Microsoft.Compute"
	DefaultSecretName       = "packerKeyVaultSecret"
)
View Source
const (
	DefaultCloudEnvironmentName              = "Public"
	DefaultImageVersion                      = "latest"
	DefaultUserName                          = "packer"
	DefaultPrivateVirtualNetworkWithPublicIp = false
	DefaultVMSize                            = "Standard_A1"
)
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 TemplateFuncs = template.FuncMap{
	"clean_image_name": templateCleanImageName,
}

Functions

func GetKeyVaultDeployment

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

func GetVirtualMachineDeployment

func GetVirtualMachineDeployment(config *Config) (*resources.Deployment, 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

	// Additional Disks
	AdditionalDisks *[]AdditionalDiskArtifact
}

func NewArtifact

func NewArtifact(template *CaptureTemplate, getSasUrl func(name string) string, osType string) (*Artifact, error)

func NewManagedImageArtifact

func NewManagedImageArtifact(osType, resourceGroup, name, location, id string) (*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 Authenticate

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

func NewAuthenticate

func NewAuthenticate(env azure.Environment, clientID, clientSecret, tenantID string) *Authenticate

type AzureClient

func NewAzureClient

func NewAzureClient(subscriptionID, resourceGroupName, storageAccountName string,
	cloud *azure.Environment,
	servicePrincipalToken, servicePrincipalTokenVault *adal.ServicePrincipalToken) (*AzureClient, error)

type Builder

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

func (*Builder) Cancel

func (b *Builder) Cancel()

func (*Builder) Prepare

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

func (*Builder) Run

func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error)

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"`

	// 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"`

	// Shared Gallery
	SharedGallery SharedImageGallery `mapstructure:"shared_image_gallery"`

	// 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"`

	//Cleanup
	AsyncResourceGroupDelete bool `mapstructure:"async_resourcegroup_delete"`
	// contains filtered or unexported fields
}

type EndpointType

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() []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"`
}

type SharedImageGallery

type SharedImageGallery struct {
	Subscription  string `mapstructure:"subscription"`
	ResourceGroup string `mapstructure:"resource_group"`
	GalleryName   string `mapstructure:"gallery_name"`
	ImageName     string `mapstructure:"image_name"`
	ImageVersion  string `mapstructure:"image_version"`
}

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) Run

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

type StepDeleteAdditionalDisk

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

func NewStepDeleteAdditionalDisks

func NewStepDeleteAdditionalDisks(client *AzureClient, ui packer.Ui) *StepDeleteAdditionalDisk

func (*StepDeleteAdditionalDisk) Cleanup

func (*StepDeleteAdditionalDisk) Run

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) Run

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) Run

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

type StepGetCertificate

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

func NewStepGetCertificate

func NewStepGetCertificate(client *AzureClient, ui packer.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 packer.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 packer.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 packer.Ui) *StepGetOSDisk

func (*StepGetOSDisk) Cleanup

func (*StepGetOSDisk) Cleanup(multistep.StateBag)

func (*StepGetOSDisk) Run

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) Run

type StepSaveWinRMPassword

type StepSaveWinRMPassword struct {
	Password  string
	BuildName string
}

func (*StepSaveWinRMPassword) Cleanup

func (*StepSaveWinRMPassword) Run

type StepSetCertificate

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

func NewStepSetCertificate

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

func (*StepSetCertificate) Cleanup

func (*StepSetCertificate) Run

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) Run

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

Jump to

Keyboard shortcuts

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