template

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: 7 Imported by: 1

Documentation

Index

Constants

View Source
const BasicTemplate = `` /* 5891-byte string literal not displayed */
View Source
const KeyVault = `` /* 1769-byte string literal not displayed */

Template to deploy a KeyVault.

This template is still hard-coded unlike the ARM templates used for VMs for a couple of reasons.

  1. The SDK defines no types for a Key Vault
  2. The Key Vault template is relatively simple, and is static.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessPolicies

type AccessPolicies struct {
	ObjectId    *string      `json:"objectId,omitempty"`
	TenantId    *string      `json:"tenantId,omitempty"`
	Permissions *Permissions `json:"permissions,omitempty"`
}

type BillingProfile added in v1.4.0

type BillingProfile struct {
	MaxPrice float32 `json:"maxPrice,omitempty"`
}

type CustomScriptSettings added in v1.4.0

type CustomScriptSettings struct {
	CommandToExecute *string `json:"commandToExecute,omitempty"`
}

type DataDiskUnion

type DataDiskUnion struct {
	Lun          *int                          `json:"lun,omitempty"`
	BlobURI      *string                       `json:"blobUri,omitempty"`
	Name         *string                       `json:"name,omitempty"`
	Vhd          *compute.VirtualHardDisk      `json:"vhd,omitempty"`
	Image        *compute.VirtualHardDisk      `json:"image,omitempty"`
	Caching      compute.CachingTypes          `json:"caching,omitempty"`
	CreateOption compute.DiskCreateOptionTypes `json:"createOption,omitempty"`
	DiskSizeGB   *int32                        `json:"diskSizeGB,omitempty"`
	ManagedDisk  *ManagedDisk                  `json:"managedDisk,omitempty"`
}

type Identity

type Identity struct {
	Type                   *string             `json:"type,omitempty"`
	UserAssignedIdentities map[string]struct{} `json:"userAssignedIdentities,omitempty"`
}

Template > Resource > Identity The map values are simplified to struct{} since they are read-only and cannot be set

type ManagedDisk added in v1.4.0

type ManagedDisk struct {
	StorageAccountType compute.StorageAccountTypes          `json:"storageAccountType,omitempty"`
	DiskEncryptionSet  *compute.DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"`
	SecurityProfile    *compute.VMDiskSecurityProfile       `json:"securityProfile,omitempty"`
	// ID - Resource Id
	ID *string `json:"id,omitempty"`
}

type OSDiskUnion

type OSDiskUnion struct {
	OsType       compute.OperatingSystemTypes      `json:"osType,omitempty"`
	OsState      compute.OperatingSystemStateTypes `json:"osState,omitempty"`
	BlobURI      *string                           `json:"blobUri,omitempty"`
	Name         *string                           `json:"name,omitempty"`
	Vhd          *compute.VirtualHardDisk          `json:"vhd,omitempty"`
	Image        *compute.VirtualHardDisk          `json:"image,omitempty"`
	Caching      compute.CachingTypes              `json:"caching,omitempty"`
	CreateOption compute.DiskCreateOptionTypes     `json:"createOption,omitempty"`
	DiskSizeGB   *int32                            `json:"diskSizeGB,omitempty"`
	ManagedDisk  *ManagedDisk                      `json:"managedDisk,omitempty"`
}

type Parameters

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

Template > Parameters

type Permissions

type Permissions struct {
	Keys    *[]string `json:"keys,omitempty"`
	Secrets *[]string `json:"secrets,omitempty"`
}

type Plan

type Plan struct {
	Name          *string `json:"name"`
	Product       *string `json:"product"`
	Publisher     *string `json:"publisher"`
	PromotionCode *string `json:"promotionCode,omitempty"`
}

type Properties

type Properties struct {
	AccessPolicies               *[]AccessPolicies                          `json:"accessPolicies,omitempty"`
	AddressSpace                 *network.AddressSpace                      `json:"addressSpace,omitempty"`
	DiagnosticsProfile           *compute.DiagnosticsProfile                `json:"diagnosticsProfile,omitempty"`
	DNSSettings                  *network.PublicIPAddressDNSSettings        `json:"dnsSettings,omitempty"`
	EnabledForDeployment         *string                                    `json:"enabledForDeployment,omitempty"`
	EnabledForTemplateDeployment *string                                    `json:"enabledForTemplateDeployment,omitempty"`
	EnableSoftDelete             *string                                    `json:"enableSoftDelete,omitempty"`
	HardwareProfile              *compute.HardwareProfile                   `json:"hardwareProfile,omitempty"`
	IPConfigurations             *[]network.IPConfiguration                 `json:"ipConfigurations,omitempty"`
	LicenseType                  *string                                    `json:"licenseType,omitempty"`
	NetworkProfile               *compute.NetworkProfile                    `json:"networkProfile,omitempty"`
	OsProfile                    *compute.OSProfile                         `json:"osProfile,omitempty"`
	PublicIPAllocatedMethod      *network.IPAllocationMethod                `json:"publicIPAllocationMethod,omitempty"`
	Sku                          *Sku                                       `json:"sku,omitempty"`
	UserData                     *string                                    `json:"userData,omitempty"`
	StorageProfile               *StorageProfileUnion                       `json:"storageProfile,omitempty"`
	SecurityProfile              *compute.SecurityProfile                   `json:"securityProfile,omitempty"`
	Subnets                      *[]network.Subnet                          `json:"subnets,omitempty"`
	SecurityRules                *[]network.SecurityRule                    `json:"securityRules,omitempty"`
	TenantId                     *string                                    `json:"tenantId,omitempty"`
	Value                        *string                                    `json:"value,omitempty"`
	Priority                     *string                                    `json:"priority,omitempty"`
	EvictionPolicy               *compute.VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"`
	BillingProfile               *BillingProfile                            `json:"billingProfile,omitempty"`
	//CustomScript extension related properties
	Publisher               *string               `json:"publisher,omitempty"`
	Type                    *string               `json:"type,omitempty"`
	TypeHandlerVersion      *string               `json:"typeHandlerVersion,omitempty"`
	AutoUpgradeMinorVersion *bool                 `json:"autoUpgradeMinorVersion,omitempty"`
	Settings                *CustomScriptSettings `json:"settings,omitempty"`
}

Template > Resource > Properties

type Resource

type Resource struct {
	ApiVersion *string            `json:"apiVersion"`
	Name       *string            `json:"name"`
	Type       *string            `json:"type"`
	Location   *string            `json:"location,omitempty"`
	DependsOn  *[]string          `json:"dependsOn,omitempty"`
	Plan       *Plan              `json:"plan,omitempty"`
	Properties *Properties        `json:"properties,omitempty"`
	Tags       *map[string]string `json:"tags,omitempty"`
	Resources  *[]Resource        `json:"resources,omitempty"`
	Identity   *Identity          `json:"identity,omitempty"`
	Condition  *string            `json:"condition,omitempty"`
}

Template > Resource

type Sku

type Sku struct {
	Family *string `json:"family,omitempty"`
	Name   *string `json:"name,omitempty"`
}

type StorageProfileUnion

type StorageProfileUnion struct {
	ImageReference *compute.ImageReference `json:"imageReference,omitempty"`
	OsDisk         *OSDiskUnion            `json:"osDisk,omitempty"`
	DataDisks      *[]DataDiskUnion        `json:"dataDisks,omitempty"`
}

Union of the StorageProfile and ImageStorageProfile types.

type Template

type Template struct {
	Schema         *string                `json:"$schema"`
	ContentVersion *string                `json:"contentVersion"`
	Parameters     *map[string]Parameters `json:"parameters"`
	Variables      *map[string]string     `json:"variables"`
	Resources      []*Resource            `json:"resources"`
}

Template

type TemplateBuilder

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

func NewTemplateBuilder

func NewTemplateBuilder(template string) (*TemplateBuilder, error)

func (*TemplateBuilder) BuildLinux

func (s *TemplateBuilder) BuildLinux(sshAuthorizedKey string, disablePasswordAuthentication bool) error

func (*TemplateBuilder) BuildWindows

func (s *TemplateBuilder) BuildWindows(communicatorType string, keyVaultName string, certificateUrl string) error

func (*TemplateBuilder) ClearOsProfile added in v1.4.4

func (s *TemplateBuilder) ClearOsProfile() error

func (*TemplateBuilder) SetAdditionalDisks

func (s *TemplateBuilder) SetAdditionalDisks(diskSizeGB []int32, dataDiskname string, isLegacyVHD bool, cachingType compute.CachingTypes) error

func (*TemplateBuilder) SetBootDiagnostics

func (s *TemplateBuilder) SetBootDiagnostics(diagSTG string) error

func (*TemplateBuilder) SetCommunityGalleryImage added in v1.1.0

func (s *TemplateBuilder) SetCommunityGalleryImage(location, imageID string, cachingType compute.CachingTypes) error

func (*TemplateBuilder) SetCustomData

func (s *TemplateBuilder) SetCustomData(customData string) error

func (*TemplateBuilder) SetDirectSharedGalleryImage added in v1.1.0

func (s *TemplateBuilder) SetDirectSharedGalleryImage(location, imageID string, cachingType compute.CachingTypes) error

func (*TemplateBuilder) SetDiskEncryptionSetID added in v1.4.0

func (s *TemplateBuilder) SetDiskEncryptionSetID(diskEncryptionSetID string) error

func (*TemplateBuilder) SetIdentity

func (s *TemplateBuilder) SetIdentity(userAssignedManagedIdentities []string) error

func (*TemplateBuilder) SetImageUrl

func (s *TemplateBuilder) SetImageUrl(imageUrl string, osType compute.OperatingSystemTypes, cachingType compute.CachingTypes) error

func (*TemplateBuilder) SetLicenseType added in v1.4.0

func (s *TemplateBuilder) SetLicenseType(licenseType string) error

func (*TemplateBuilder) SetManagedDiskUrl

func (s *TemplateBuilder) SetManagedDiskUrl(managedImageId string, storageAccountType compute.StorageAccountTypes, cachingType compute.CachingTypes) error

func (*TemplateBuilder) SetManagedMarketplaceImage

func (s *TemplateBuilder) SetManagedMarketplaceImage(publisher, offer, sku, version string, storageAccountType compute.StorageAccountTypes, cachingType compute.CachingTypes) error

func (*TemplateBuilder) SetMarketPlaceImage

func (s *TemplateBuilder) SetMarketPlaceImage(publisher, offer, sku, version string, cachingType compute.CachingTypes) error

func (*TemplateBuilder) SetNetworkSecurityGroup

func (s *TemplateBuilder) SetNetworkSecurityGroup(ipAddresses []string, port int) error

func (*TemplateBuilder) SetOSDiskSizeGB

func (s *TemplateBuilder) SetOSDiskSizeGB(diskSizeGB int32) error

func (*TemplateBuilder) SetPlanInfo

func (s *TemplateBuilder) SetPlanInfo(name, product, publisher, promotionCode string) error

func (*TemplateBuilder) SetPrivateVirtualNetworkWithPublicIp

func (s *TemplateBuilder) SetPrivateVirtualNetworkWithPublicIp(virtualNetworkResourceGroup, virtualNetworkName, subnetName string) error

func (*TemplateBuilder) SetSecurityProfile added in v1.4.1

func (s *TemplateBuilder) SetSecurityProfile(secureBootEnabled bool, vtpmEnabled bool, encryptionAtHost bool) error

func (*TemplateBuilder) SetSharedGalleryImage

func (s *TemplateBuilder) SetSharedGalleryImage(location, imageID string, cachingType compute.CachingTypes) error

func (*TemplateBuilder) SetSpot added in v1.4.0

func (*TemplateBuilder) SetTags

func (s *TemplateBuilder) SetTags(tags *map[string]string) error

func (*TemplateBuilder) SetUserData added in v1.0.2

func (s *TemplateBuilder) SetUserData(userData string) error

func (*TemplateBuilder) SetVirtualNetwork

func (s *TemplateBuilder) SetVirtualNetwork(virtualNetworkResourceGroup, virtualNetworkName, subnetName string) error

func (*TemplateBuilder) ToJSON

func (s *TemplateBuilder) ToJSON() (*string, error)

type TemplateParameter

type TemplateParameter struct {
	Value string `json:"value"`
}

type TemplateParameters

type TemplateParameters struct {
	AdminUsername              *TemplateParameter `json:"adminUsername,omitempty"`
	AdminPassword              *TemplateParameter `json:"adminPassword,omitempty"`
	CommandToExecute           *TemplateParameter `json:"commandToExecute,omitempty"`
	DnsNameForPublicIP         *TemplateParameter `json:"dnsNameForPublicIP,omitempty"`
	KeyVaultName               *TemplateParameter `json:"keyVaultName,omitempty"`
	KeyVaultSKU                *TemplateParameter `json:"keyVaultSKU,omitempty"`
	KeyVaultSecretValue        *TemplateParameter `json:"keyVaultSecretValue,omitempty"`
	ObjectId                   *TemplateParameter `json:"objectId,omitempty"`
	NicName                    *TemplateParameter `json:"nicName,omitempty"`
	OSDiskName                 *TemplateParameter `json:"osDiskName,omitempty"`
	DataDiskName               *TemplateParameter `json:"dataDiskName,omitempty"`
	PublicIPAddressName        *TemplateParameter `json:"publicIPAddressName,omitempty"`
	StorageAccountBlobEndpoint *TemplateParameter `json:"storageAccountBlobEndpoint,omitempty"`
	SubnetName                 *TemplateParameter `json:"subnetName,omitempty"`
	TenantId                   *TemplateParameter `json:"tenantId,omitempty"`
	VirtualNetworkName         *TemplateParameter `json:"virtualNetworkName,omitempty"`
	NsgName                    *TemplateParameter `json:"nsgName,omitempty"`
	VMSize                     *TemplateParameter `json:"vmSize,omitempty"`
	VMName                     *TemplateParameter `json:"vmName,omitempty"`
}

Jump to

Keyboard shortcuts

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