terratest: github.com/gruntwork-io/terratest/modules/azure Index | Files

package azure

import "github.com/gruntwork-io/terratest/modules/azure"

Index

Package Files

aks.go authorizer.go azure.go common.go compute.go errors.go region.go subscription.go

Constants

const (
    // AuthFromEnvClient is an env variable supported by the Azure SDK
    AuthFromEnvClient = "AZURE_CLIENT_ID"

    // AuthFromEnvTenant is an env variable supported by the Azure SDK
    AuthFromEnvTenant = "AZURE_TENANT_ID"

    // AuthFromFile is an env variable supported by the Azure SDK
    AuthFromFile = "AZURE_AUTH_LOCATION"
)
const (
    // AzureSubscriptionID is an optional env variable supported by the `azurerm` Terraform provider to
    // designate a target Azure subscription ID
    AzureSubscriptionID = "ARM_SUBSCRIPTION_ID"

    // AzureResGroupName is an optional env variable custom to Terratest to designate a target Azure resource group
    AzureResGroupName = "AZURE_RES_GROUP_NAME"
)

func GetAllAzureRegions Uses

func GetAllAzureRegions(t testing.TestingT, subscriptionID string) []string

GetAllAzureRegions gets the list of Azure regions available in this subscription.

func GetAllAzureRegionsE Uses

func GetAllAzureRegionsE(t testing.TestingT, subscriptionID string) ([]string, error)

GetAllAzureRegionsE gets the list of Azure regions available in this subscription.

func GetManagedClusterE Uses

func GetManagedClusterE(t testing.TestingT, resourceGroupName, clusterName, subscriptionID string) (*containerservice.ManagedCluster, error)

GetManagedClusterE will return ManagedCluster

func GetManagedClustersClientE Uses

func GetManagedClustersClientE(subscriptionID string) (*containerservice.ManagedClustersClient, error)

GetManagedClustersClientE is a helper function that will setup an Azure ManagedClusters client on your behalf

func GetRandomRegion Uses

func GetRandomRegion(t testing.TestingT, approvedRegions []string, forbiddenRegions []string, subscriptionID string) string

GetRandomRegion gets a randomly chosen Azure region. If approvedRegions is not empty, this will be a region from the approvedRegions list; otherwise, this method will fetch the latest list of regions from the Azure APIs and pick one of those. If forbiddenRegions is not empty, this method will make sure the returned region is not in the forbiddenRegions list.

func GetRandomRegionE Uses

func GetRandomRegionE(t testing.TestingT, approvedRegions []string, forbiddenRegions []string, subscriptionID string) (string, error)

GetRandomRegionE gets a randomly chosen Azure region. If approvedRegions is not empty, this will be a region from the approvedRegions list; otherwise, this method will fetch the latest list of regions from the Azure APIs and pick one of those. If forbiddenRegions is not empty, this method will make sure the returned region is not in the forbiddenRegions list.

func GetRandomStableRegion Uses

func GetRandomStableRegion(t testing.TestingT, approvedRegions []string, forbiddenRegions []string, subscriptionID string) string

GetStableRandomRegion gets a randomly chosen Azure region that is considered stable. Like GetRandomRegion, you can further restrict the stable region list using approvedRegions and forbiddenRegions. We consider stable regions to be those that have been around for at least 1 year. Note that regions in the approvedRegions list that are not considered stable are ignored.

func GetSizeOfVirtualMachine Uses

func GetSizeOfVirtualMachine(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) compute.VirtualMachineSizeTypes

GetSizeOfVirtualMachine gets the size type of the given Azure Virtual Machine

func GetSizeOfVirtualMachineE Uses

func GetSizeOfVirtualMachineE(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) (compute.VirtualMachineSizeTypes, error)

GetSizeOfVirtualMachineE gets the size type of the given Azure Virtual Machine

func GetSubscriptionClient Uses

func GetSubscriptionClient() (*subscriptions.Client, error)

GetSubscriptionClient is a helper function that will setup an Azure Subscription client on your behalf

func GetTagsForVirtualMachine Uses

func GetTagsForVirtualMachine(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) map[string]string

GetTagsForVirtualMachine gets the tags of the given Virtual Machine as a map

func GetTagsForVirtualMachineE Uses

func GetTagsForVirtualMachineE(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) (map[string]string, error)

GetTagsForVirtualMachineE gets the tags of the given Virtual Machine as a map

func GetVirtualMachineClient Uses

func GetVirtualMachineClient(subscriptionID string) (*compute.VirtualMachinesClient, error)

GetVirtualMachineClient is a helper function that will setup an Azure Virtual Machine client on your behalf

func NewAuthorizer Uses

func NewAuthorizer() (*autorest.Authorizer, error)

NewAuthorizer creates an Azure authorizer adhering to standard auth mechanisms provided by the Azure Go SDK See Azure Go Auth docs here: https://docs.microsoft.com/en-us/go/azure/azure-sdk-go-authorization

type ResourceGroupNameNotFound Uses

type ResourceGroupNameNotFound struct{}

ResourceGroupNameNotFound is an error that occurs when the target Azure Resource Group name could not be found or was not provided

func (ResourceGroupNameNotFound) Error Uses

func (err ResourceGroupNameNotFound) Error() string

type SubscriptionIDNotFound Uses

type SubscriptionIDNotFound struct{}

SubscriptionIDNotFound is an error that occurs when the Azure Subscription ID could not be found or was not provided

func (SubscriptionIDNotFound) Error Uses

func (err SubscriptionIDNotFound) Error() string

Package azure imports 14 packages (graph). Updated 2020-05-13. Refresh now. Tools for package owners.