Documentation ¶
Index ¶
Constants ¶
View Source
const ( AzureImdsUrl = "http://169.254.169.254/metadata/instance/compute?api-version=2021-01-01" AzureUserDataImdsUrl = "http://169.254.169.254/metadata/instance/compute/userData?api-version=2021-01-01&format=text" )
Variables ¶
This section is empty.
Functions ¶
func GetUserData ¶
Method to retrieve userData from the instance metadata service and return it as a string
func IsAzure ¶
Method to check if the VM is running on Azure by checking if the Azure IMDS endpoint is reachable Set Metadata:true header to confirm that the VM is running on Azure If the VM is running on Azure, return true
func NewAzureClient ¶
func NewAzureClient(config Config) (azcore.TokenCredential, error)
Types ¶
type Config ¶
type Config struct { SubscriptionId string ClientId string ClientSecret string TenantId string ResourceGroupName string Zone string Region string SubnetId string SecurityGroupName string SecurityGroupId string Size string ImageId string SSHKeyPath string SSHUserName string DisableCVM bool InstanceSizes instanceSizes InstanceSizeSpecList []provider.InstanceTypeSpec Tags provider.KeyValueFlag DisableCloudConfig bool // Disabled by default, we want to do measured boot. // Secure boot brings no additional security. EnableSecureBoot bool }
Click to show internal directories.
Click to hide internal directories.