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.6k stars 4.64k forks source link

Support for Azure Redis Cache to use AD Authentication #23777

Closed jonathan-fileread closed 11 months ago

jonathan-fileread commented 1 year ago

Is there an existing issue for this?

Community Note

Description

Azure Redis now allows AD authentication to use identity based authentication (e.g. through defaultazurecredential) to make a connection string to redis.

Currently this exists in bicep, but not in terraform. We'd love to get a boolean toggle to enable this authentication method! See screenshot below. under Redis > Advanced Settings

Screenshot 2023-11-03 at 6 24 46 PM

New or Affected Resource(s)/Data Source(s)

azurerm_redis_cache

Potential Terraform Configuration

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

# NOTE: the Name used for Redis needs to be globally unique
resource "azurerm_redis_cache" "example" {
  name                = "example-cache"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  capacity            = 2
  family              = "C"
  **entra_authentication = true** <-- this one!
  sku_name            = "Standard"
  enable_non_ssl_port = false
  minimum_tls_version = "1.2"

  redis_configuration {
  }
}

References

https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/cache-azure-active-directory-for-authentication

tombuildsstuff commented 1 year ago

Support for this is available in hashicorp/go-azure-sdk in API version 2023-08-01 - however it appears this needs to be updated to use the new API Version to enable this, so I'm tagging this as such.

Waylonwhynot commented 11 months ago

When does the Terraform-provider-azurerm support this feature?

favoretti commented 11 months ago

@Waylonwhynot in a bit, PR is being tested as we speak.

dhensby commented 11 months ago

duplicate of #15068?

favoretti commented 11 months ago

duplicate of #15068?

Is it? Not sure to be honest. #15066 looks more like accessing underlying storage accounts using an either user-assigned or system-assigned managed identity, where as this is authentication towards redis instance itself?

https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/cache-azure-active-directory-for-authentication

dhensby commented 11 months ago

Ah - ok - I thought they were related, but if they are distinct then that's fair enough

jonathan-fileread commented 10 months ago

thanks @favoretti @manicminer for pushing this one out. While toggle for enabling AAD is now enabled, we're still missing functionality to add a redis_user, or access_policies via terraform. Should I create another ticket for this?

Screenshot 2024-01-04 at 3 02 11 PM

github-actions[bot] commented 6 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.