hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.46k stars 4.54k forks source link

azurerm_synapse_workspace identity issue #25761

Open farwind opened 2 months ago

farwind commented 2 months ago

Is there an existing issue for this?

Community Note

Terraform Version

1.5.7

AzureRM Provider Version

3.100.0

Affected Resource(s)/Data Source(s)

azurerm_synapse_workspace

Terraform Configuration Files

minimal build of synapse workspace based on terraform registry docs.
without identity block since that is marked as optional.

Debug Output/Panic Output

N/A

Expected Behaviour

synapse workspace created

Actual Behaviour

Error: creating Workspace: (Name "synw-cancom-ci-synapse-ytb9-we-test" / Resource Group "rg-cancom-ci-synapse-ytb9-we-test"): synapse.WorkspacesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="ValidationFailed" Message="Workspace request validation failed, check error details for more information" Details=[{"code":"SystemAssignedManagedIdentityNotSpecified","message":"Workspace creation request should have an identity section with Type = SystemAssigned"}] │ │ with module.defaults.azurerm_synapse_workspace.this[0], │ on ../../main.tf line 54, in resource "azurerm_synapse_workspace" "this": │ 54: resource "azurerm_synapse_workspace" "this" {

Steps to Reproduce

create resource group, create storage account, in that create data_lake_gen2_filesystem, take all required variables based on the terraform registry and try to spin up synapse workspace.

Important Factoids

no

References

No response

farwind commented 2 months ago

https://registry.terraform.io/providers/hashicorp/azurerm/3.100.0/docs/resources/synapse_workspace documentation required parameters do not match criteria for synapse_workspace to be sucesfully built.

Chambras commented 2 months ago

@farwind you are right. It failed when using only the required values in the documentation. I added

  identity {
    type = "SystemAssigned"
  }

and it worked. Do not know if it is documentation issue and it needs to say identity block is required or if there is a bug and if the block is not set, it needs to default to SystemAssigned. Most likely it needs to default to SystemAssigned