File tree Expand file tree Collapse file tree 6 files changed +13
-0
lines changed
Expand file tree Collapse file tree 6 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ provider "azurerm" {
1313 client_certificate_path = var. azure_certificate_path
1414 tenant_id = var. azure_tenant_id
1515 environment = var. azure_environment
16+ use_msi = var. azure_use_msi
1617}
1718
1819data "azurerm_storage_account" "storage_account" {
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ provider "azurerm" {
1212 client_certificate_password = var. azure_certificate_password
1313 client_certificate_path = var. azure_certificate_path
1414 tenant_id = var. azure_tenant_id
15+ use_msi = var. azure_use_msi
1516 environment = var. azure_environment
1617}
1718
Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ variable "azure_subscription_id" {
9999variable "azure_client_id" {
100100 type = string
101101 description = " The app ID that should be used to interact with Azure API"
102+ default = " "
102103}
103104
104105variable "azure_client_secret" {
@@ -124,6 +125,12 @@ variable "azure_tenant_id" {
124125 description = " The tenant ID that should be used to interact with Azure API"
125126}
126127
128+ variable "azure_use_msi" {
129+ type = bool
130+ default = false
131+ description = " Specifies if we are to use a managed identity for authentication"
132+ }
133+
127134variable "azure_master_availability_zones" {
128135 type = list (string )
129136 description = " The availability zones in which to create the masters. The length of this list must match master_count."
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ provider "azurerm" {
1919 client_certificate_password = var. azure_certificate_password
2020 client_certificate_path = var. azure_certificate_path
2121 tenant_id = var. azure_tenant_id
22+ use_msi = var. azure_use_msi
2223 environment = var. azure_environment
2324}
2425
Original file line number Diff line number Diff line change @@ -315,13 +315,15 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error {
315315 if err != nil {
316316 return err
317317 }
318+
318319 auth := azuretfvars.Auth {
319320 SubscriptionID : session .Credentials .SubscriptionID ,
320321 ClientID : session .Credentials .ClientID ,
321322 ClientSecret : session .Credentials .ClientSecret ,
322323 TenantID : session .Credentials .TenantID ,
323324 ClientCertificatePath : session .Credentials .ClientCertificatePath ,
324325 ClientCertificatePassword : session .Credentials .ClientCertificatePassword ,
326+ UseMSI : session .AuthType == aztypes .ManagedIdentityAuth ,
325327 }
326328 masters , err := mastersAsset .Machines ()
327329 if err != nil {
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ type Auth struct {
2222 TenantID string `json:"azure_tenant_id,omitempty"`
2323 ClientCertificatePath string `json:"azure_certificate_path,omitempty"`
2424 ClientCertificatePassword string `json:"azure_certificate_password,omitempty"`
25+ UseMSI bool `json:"azure_use_msi,omitempty"`
2526}
2627
2728type config struct {
You can’t perform that action at this time.
0 commit comments