Skip to content

azurerm_postgresql_flexible_server_active_directory_administrator does not work with security groups #19448

Description

@ThorstenHans

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.3.5

AzureRM Provider Version

3.33.0

Affected Resource(s)/Data Source(s)

azurerm_postgresql_flexible_server_active_directory_administrator

Terraform Configuration Files

resource "azurerm_postgresql_flexible_server_active_directory_administrator" "psql_aad_admin" {
  server_name         = azurerm_postgresql_flexible_server.server.name
  resource_group_name = azurerm_postgresql_flexible_server.server.resource_group_name

  object_id      = module.postgre_admin_group.object_id
  principal_name = module.postgre_admin_group.display_name
  principal_type = "Group"
  tenant_id      = data.azurerm_client_config.current.tenant_id
}

Debug Output/Panic Output

Error: creating Administrator (Subscription: "***"
Resource Group Name: "rg-foo"
Server Name: "psql-foo"
Object: "11a0c311-1111-1111-1111-1111c2f81111"): polling after Create: Code="AadAuthPrincipalCreationFailed" Message="Failed to create Azure AD Principal. Reason - 0LP01: An unexpected error occurred while trying to validate user."

  with module.prod.azurerm_postgresql_flexible_server_active_directory_administrator.psql_aad_admin,
  on ../postgre.tf line 19, in resource "azurerm_postgresql_flexible_server_active_directory_administrator" "psql_aad_admin":
  59: resource "azurerm_postgresql_flexible_server_active_directory_administrator" "psql_aad_admin" {

Releasing state lock. This may take a few moments...

Expected Behaviour

Terraform should set the AAD Administrator for Flexible PostgreSQL Server to the existing AAD Group (Security Group)

Actual Behaviour

Terraform fails upon linking the existing AAD Group to Flexible PostgreSQL Server

Steps to Reproduce

No response

Important Factoids

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions