terraform-provider-azuread icon indicating copy to clipboard operation
terraform-provider-azuread copied to clipboard

bugfix: end_date_relative for application_password

Open nickdala opened this issue 1 year ago • 2 comments

This fix supports end_date_relative for azuread_application_password. See https://github.com/hashicorp/terraform-provider-azuread/issues/843 and https://github.com/hashicorp/terraform-provider-azuread/issues/1424 for more details.

Terraform version

Terraform v1.9.1 on darwin_amd64

Provider version

2.53.1

Terraform Configuration Files

data "azuread_client_config" "current" {}

resource "azuread_application" "example" {
  display_name = "example"
  owners       = [data.azuread_client_config.current.object_id]
}

resource "azuread_application_password" "application_password" {
  application_id = azuread_application.example.id
  end_date_relative = "360h" # 15 days
}

Expected Behavior

The expiration of the client secret in Microsoft Entra ID is calculated based on the end_date_relative argument.

Actual Behavior

end_date_relative is ignored and the expiration of the client secret in Microsoft Entra ID is set to the default of 2 years.

Steps to Reproduce

terraform apply

Sample

https://github.com/nickdala/azure-app-registration

Fixed #1424

nickdala avatar Jul 08 '24 13:07 nickdala

Hi @nickdala can you give us an estimate when this PR will be closed and the fix will be released? regards Thomas

twalter-dev avatar Sep 24 '24 06:09 twalter-dev

Hi @nickdala can you give us an estimate when this PR will be closed and the fix will be released? regards Thomas

I'm reaching out to folks internally to see how I can get this PR reviewed and merged.

nickdala avatar Oct 04 '24 17:10 nickdala

Here is the latest warning message with version 3.0.2 of azuread. From the message, end_date_relative is deprecated.

╷ │ Warning: Argument is deprecated │ │ with azuread_application_password.application_password, │ on main.tf line 10, in resource "azuread_application_password" "application_password": │ 10: end_date_relative = "360h" # 15 days │ │ The end_date_relative property is deprecated and will be removed in a future │ version of the AzureAD provider. Please instead use the Terraform timeadd() │ function to calculate a value for the end_date property.

nickdala avatar Nov 08 '24 17:11 nickdala