Merge branch 'main' into res/api_gtw_method

main
William BEUIL 2021-10-22 14:06:00 +02:00 committed by GitHub
commit c2b368a7dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -1,5 +1,8 @@
package common
type AzureProviderConfig struct {
SubscriptionID string
SubscriptionID,
ClientID,
TenantID,
ClientSecret string
}

View File

@ -36,6 +36,15 @@ func NewAzureTerraformProvider(version string, progress output.Progress, configD
tfProvider, err := terraform.NewTerraformProvider(installer, terraform.TerraformProviderConfig{
Name: p.name,
GetProviderConfig: func(_ string) interface{} {
c := p.GetConfig()
return map[string]string{
"subscription_id": c.SubscriptionID,
"tenant_id": c.TenantID,
"client_id": c.ClientID,
"client_secret": c.ClientSecret,
}
},
}, progress)
if err != nil {
return nil, err
@ -47,6 +56,9 @@ func NewAzureTerraformProvider(version string, progress output.Progress, configD
func (p *AzureTerraformProvider) GetConfig() common.AzureProviderConfig {
return common.AzureProviderConfig{
SubscriptionID: os.Getenv("AZURE_SUBSCRIPTION_ID"),
TenantID: os.Getenv("AZURE_TENANT_ID"),
ClientID: os.Getenv("AZURE_CLIENT_ID"),
ClientSecret: os.Getenv("AZURE_CLIENT_SECRET"),
}
}