boltops-tools / terraspace

Terraspace: The Terraform Framework
https://terraspace.cloud
Apache License 2.0
679 stars 46 forks source link

Enabled OIDC in terraspace_plugin_azurerm #290

Open ahmedulde7 opened 1 year ago

ahmedulde7 commented 1 year ago

terraform provider supports oidc but when we use this block in terraspace it give ARM Rest error Support for OpenID Connect was added in version 3.7.0 of the Terraform AzureRM provider.

As per terraform doc

It is recommend using the required_providers block to set the Azure Provider source and version being used terraform { required_providers { azurerm = { source = "hashicorp/azurerm" version = "=3.7.0" } } }

Configure the Microsoft Azure Provider provider "azurerm" { use_oidc = true features {} }

with OIDC support export of client_secret should not be needed.

Terraspace error: Exception Armrest::Error: # /var/lib/gems/3.0.0/gems/armrest-0.1.3/lib/armrest/api/base.rb:43:in request' /var/lib/gems/3.0.0/gems/armrest-0.1.3/lib/armrest/api/base.rb:18:inblock (2 levels) in ' /var/lib/gems/3.0.0/gems/armrest-0.1.3/lib/armrest/services/resource_group.rb:20:in create_or_update' var/lib/gems/3.0.0/gems/terraspace_plugin_azurerm-0.7.0/lib/terraspace_plugin_azurerm/interfaces/backend/resource_group_creator.rb:19:increate_or_update_resource_group'

teddimitrov commented 1 year ago

Did you find a solution/workaround to this by any chance? Experiencing same behavior and error:

297

Building .terraspace-cache/eastus/dev/stacks/demo Current directory: .terraspace-cache/eastus/dev/stacks/demo Creating Resource Group dev-eastus... Exception Armrest::Error: # /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/armrest-0.1.3/lib/armrest/api/base.rb:43:in request' /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/armrest-0.1.3/lib/armrest/api/base.rb:18:inblock (2 levels) in ' /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/armrest-0.1.3/lib/armrest/services/resource_group.rb:20:in create_or_update' /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace_plugin_azurerm-0.7.0/lib/terraspace_plugin_azurerm/interfaces/backend/resource_group_creator.rb:19:increate_or_update_resource_group'

ahmedulde7 commented 1 year ago

Just exportting ARM variables works but not the best solution given that terraform already has support for oidc.