azurerm backend: support loading metadata from a given host
This commit is contained in:
parent
dc886f19c5
commit
23b4c2db42
|
@ -63,6 +63,7 @@ func buildArmClient(config BackendConfig) (*ArmClient, error) {
|
|||
SubscriptionID: config.SubscriptionID,
|
||||
TenantID: config.TenantID,
|
||||
CustomResourceManagerEndpoint: config.CustomResourceManagerEndpoint,
|
||||
MetadataURL: config.MetadataHost,
|
||||
Environment: config.Environment,
|
||||
MsiEndpoint: config.MsiEndpoint,
|
||||
|
||||
|
|
|
@ -30,6 +30,13 @@ func New() backend.Backend {
|
|||
Description: "The blob key.",
|
||||
},
|
||||
|
||||
"metadata_host": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
DefaultFunc: schema.EnvDefaultFunc("ARM_METADATA_HOST", ""),
|
||||
Description: "The Metadata URL which will be used to obtain the Cloud Environment.",
|
||||
},
|
||||
|
||||
"environment": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
@ -169,6 +176,7 @@ type BackendConfig struct {
|
|||
ClientID string
|
||||
ClientSecret string
|
||||
CustomResourceManagerEndpoint string
|
||||
MetadataHost string
|
||||
Environment string
|
||||
MsiEndpoint string
|
||||
ResourceGroupName string
|
||||
|
@ -201,6 +209,7 @@ func (b *Backend) configure(ctx context.Context) error {
|
|||
ClientID: clientId,
|
||||
ClientSecret: clientSecret,
|
||||
CustomResourceManagerEndpoint: data.Get("endpoint").(string),
|
||||
MetadataHost: data.Get("metadata_host").(string),
|
||||
Environment: data.Get("environment").(string),
|
||||
MsiEndpoint: data.Get("msi_endpoint").(string),
|
||||
ResourceGroupName: data.Get("resource_group_name").(string),
|
||||
|
|
Loading…
Reference in New Issue