generated from hashicorp/packer-plugin-scaffolding
/
template.go
151 lines (134 loc) · 7.48 KB
/
template.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package template
import (
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-11-01/compute"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network"
)
// 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 > Parameters
type Parameters struct {
Type *string `json:"type"`
DefaultValue *string `json:"defaultValue,omitempty"`
}
// Template > 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"`
}
type Plan struct {
Name *string `json:"name"`
Product *string `json:"product"`
Publisher *string `json:"publisher"`
PromotionCode *string `json:"promotionCode,omitempty"`
}
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 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 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"`
}
// Union of the StorageProfile and ImageStorageProfile types.
type StorageProfileUnion struct {
ImageReference *compute.ImageReference `json:"imageReference,omitempty"`
OsDisk *OSDiskUnion `json:"osDisk,omitempty"`
DataDisks *[]DataDiskUnion `json:"dataDisks,omitempty"`
}
type BillingProfile struct {
MaxPrice float32 `json:"maxPrice,omitempty"`
}
// Template > Resource > 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"`
}
type CustomScriptSettings struct {
CommandToExecute *string `json:"commandToExecute,omitempty"`
}
// Template > Resource > Identity
// The map values are simplified to struct{} since they are read-only and cannot be set
type Identity struct {
Type *string `json:"type,omitempty"`
UserAssignedIdentities map[string]struct{} `json:"userAssignedIdentities,omitempty"`
}
type AccessPolicies struct {
ObjectId *string `json:"objectId,omitempty"`
TenantId *string `json:"tenantId,omitempty"`
Permissions *Permissions `json:"permissions,omitempty"`
}
type Permissions struct {
Keys *[]string `json:"keys,omitempty"`
Secrets *[]string `json:"secrets,omitempty"`
}
type Sku struct {
Family *string `json:"family,omitempty"`
Name *string `json:"name,omitempty"`
}