template

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: MPL-2.0, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const BasicTemplate = `` /* 5099-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 DataDiskUnion added in v1.2.2

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  *compute.ManagedDiskParameters `json:"managedDisk,omitempty"`
}

type Identity added in v1.6.0

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 OSDiskUnion added in v1.0.3

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  *compute.ManagedDiskParameters    `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 added in v1.2.2

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"`
	NetworkProfile               *compute.NetworkProfile             `json:"networkProfile,omitempty"`
	OsProfile                    *compute.OSProfile                  `json:"osProfile,omitempty"`
	PublicIPAllocatedMethod      *network.IPAllocationMethod         `json:"publicIPAllocationMethod,omitempty"`
	Sku                          *Sku                                `json:"sku,omitempty"`
	//StorageProfile3              *compute.StorageProfile             `json:"storageProfile,omitempty"`
	StorageProfile *StorageProfileUnion    `json:"storageProfile,omitempty"`
	Subnets        *[]network.Subnet       `json:"subnets,omitempty"`
	SecurityRules  *[]network.SecurityRule `json:"securityRules,omitempty"`
	TenantId       *string                 `json:"tenantId,omitempty"`
	Value          *string                 `json:"value,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"`
}

/////////////////////////////////////////////// Template > Resource

type Sku

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

type StorageProfileUnion added in v1.0.3

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(keyVaultName, winRMCertificateUrl string) error

func (*TemplateBuilder) SetAdditionalDisks added in v1.2.2

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

func (*TemplateBuilder) SetBootDiagnostics added in v1.5.6

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

func (*TemplateBuilder) SetCustomData

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

func (*TemplateBuilder) SetIdentity added in v1.6.0

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) SetManagedDiskUrl added in v1.0.3

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

func (*TemplateBuilder) SetManagedMarketplaceImage added in v1.0.3

func (s *TemplateBuilder) SetManagedMarketplaceImage(location, publisher, offer, sku, version, imageID 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 added in v1.4.5

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

func (*TemplateBuilder) SetOSDiskSizeGB

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

func (*TemplateBuilder) SetPlanInfo added in v1.2.2

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

func (*TemplateBuilder) SetPrivateVirtualNetworkWithPublicIp added in v1.2.2

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

func (*TemplateBuilder) SetSharedGalleryImage added in v1.3.2

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

func (*TemplateBuilder) SetTags

func (s *TemplateBuilder) SetTags(tags *map[string]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"`
	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