mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-01 03:26:08 -04:00
Upgrade Azure SDK
Signed-off-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
parent
9741c0e6b1
commit
081dfb5037
37 changed files with 1299 additions and 1662 deletions
|
@ -6,7 +6,7 @@ package azure
|
|||
|
||||
import (
|
||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
||||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute"
|
||||
armcomputev2 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2"
|
||||
)
|
||||
|
||||
// VMInstance describes a single instance.
|
||||
|
@ -23,58 +23,58 @@ type VMInstance struct {
|
|||
|
||||
// Azure makes a new virtual machine template with default values.
|
||||
// TODO: deprecate as soon as scale sets are available.
|
||||
func (i VMInstance) Azure() armcompute.VirtualMachine {
|
||||
return armcompute.VirtualMachine{
|
||||
Name: to.StringPtr(i.Name),
|
||||
Location: to.StringPtr(i.Location),
|
||||
Properties: &armcompute.VirtualMachineProperties{
|
||||
HardwareProfile: &armcompute.HardwareProfile{
|
||||
VMSize: (*armcompute.VirtualMachineSizeTypes)(to.StringPtr(i.InstanceType)),
|
||||
func (i VMInstance) Azure() armcomputev2.VirtualMachine {
|
||||
return armcomputev2.VirtualMachine{
|
||||
Name: to.Ptr(i.Name),
|
||||
Location: to.Ptr(i.Location),
|
||||
Properties: &armcomputev2.VirtualMachineProperties{
|
||||
HardwareProfile: &armcomputev2.HardwareProfile{
|
||||
VMSize: (*armcomputev2.VirtualMachineSizeTypes)(to.Ptr(i.InstanceType)),
|
||||
},
|
||||
OSProfile: &armcompute.OSProfile{
|
||||
ComputerName: to.StringPtr(i.Name),
|
||||
AdminPassword: to.StringPtr(i.Password),
|
||||
AdminUsername: to.StringPtr(i.Username),
|
||||
OSProfile: &armcomputev2.OSProfile{
|
||||
ComputerName: to.Ptr(i.Name),
|
||||
AdminPassword: to.Ptr(i.Password),
|
||||
AdminUsername: to.Ptr(i.Username),
|
||||
},
|
||||
SecurityProfile: &armcompute.SecurityProfile{
|
||||
UefiSettings: &armcompute.UefiSettings{
|
||||
SecureBootEnabled: to.BoolPtr(true),
|
||||
VTpmEnabled: to.BoolPtr(true),
|
||||
SecurityProfile: &armcomputev2.SecurityProfile{
|
||||
UefiSettings: &armcomputev2.UefiSettings{
|
||||
SecureBootEnabled: to.Ptr(true),
|
||||
VTpmEnabled: to.Ptr(true),
|
||||
},
|
||||
SecurityType: armcompute.SecurityTypesConfidentialVM.ToPtr(),
|
||||
SecurityType: to.Ptr(armcomputev2.SecurityTypesConfidentialVM),
|
||||
},
|
||||
NetworkProfile: &armcompute.NetworkProfile{
|
||||
NetworkInterfaces: []*armcompute.NetworkInterfaceReference{
|
||||
NetworkProfile: &armcomputev2.NetworkProfile{
|
||||
NetworkInterfaces: []*armcomputev2.NetworkInterfaceReference{
|
||||
{
|
||||
ID: to.StringPtr(i.NIC),
|
||||
ID: to.Ptr(i.NIC),
|
||||
},
|
||||
},
|
||||
},
|
||||
StorageProfile: &armcompute.StorageProfile{
|
||||
OSDisk: &armcompute.OSDisk{
|
||||
CreateOption: armcompute.DiskCreateOptionTypesFromImage.ToPtr(),
|
||||
ManagedDisk: &armcompute.ManagedDiskParameters{
|
||||
StorageAccountType: armcompute.StorageAccountTypesPremiumLRS.ToPtr(),
|
||||
SecurityProfile: &armcompute.VMDiskSecurityProfile{
|
||||
SecurityEncryptionType: armcompute.SecurityEncryptionTypesVMGuestStateOnly.ToPtr(),
|
||||
StorageProfile: &armcomputev2.StorageProfile{
|
||||
OSDisk: &armcomputev2.OSDisk{
|
||||
CreateOption: to.Ptr(armcomputev2.DiskCreateOptionTypesFromImage),
|
||||
ManagedDisk: &armcomputev2.ManagedDiskParameters{
|
||||
StorageAccountType: to.Ptr(armcomputev2.StorageAccountTypesPremiumLRS),
|
||||
SecurityProfile: &armcomputev2.VMDiskSecurityProfile{
|
||||
SecurityEncryptionType: to.Ptr(armcomputev2.SecurityEncryptionTypesVMGuestStateOnly),
|
||||
},
|
||||
},
|
||||
},
|
||||
ImageReference: &armcompute.ImageReference{
|
||||
Publisher: to.StringPtr("0001-com-ubuntu-confidential-vm-focal"),
|
||||
Offer: to.StringPtr("canonical"),
|
||||
SKU: to.StringPtr("20_04-lts-gen2"),
|
||||
Version: to.StringPtr("latest"),
|
||||
ImageReference: &armcomputev2.ImageReference{
|
||||
Publisher: to.Ptr("0001-com-ubuntu-confidential-vm-focal"),
|
||||
Offer: to.Ptr("canonical"),
|
||||
SKU: to.Ptr("20_04-lts-gen2"),
|
||||
Version: to.Ptr("latest"),
|
||||
},
|
||||
},
|
||||
DiagnosticsProfile: &armcompute.DiagnosticsProfile{
|
||||
BootDiagnostics: &armcompute.BootDiagnostics{
|
||||
Enabled: to.BoolPtr(true),
|
||||
DiagnosticsProfile: &armcomputev2.DiagnosticsProfile{
|
||||
BootDiagnostics: &armcomputev2.BootDiagnostics{
|
||||
Enabled: to.Ptr(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
Identity: &armcompute.VirtualMachineIdentity{
|
||||
Type: armcompute.ResourceIdentityTypeSystemAssigned.ToPtr(),
|
||||
Identity: &armcomputev2.VirtualMachineIdentity{
|
||||
Type: to.Ptr(armcomputev2.ResourceIdentityTypeSystemAssigned),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue