-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azuread_application_password.end_date_relative is ignored #1424
Comments
This appears to be a regression caused by #1389. |
you can work around it with something similar to this: resource "time_static" "azuread_pass" {
triggers = {
# Save the time each switch of vm_count
resource_count = var.resource_count
}
}
resource "azuread_application_password" "chef_infra_spn" {
count = var.resource_count > 0 ? 1 : 0
application_id = var.infra_spn_object_id["application_id"]
display_name = var.workspace
#end_date_relative = "2h"
end_date = timeadd(time_static.azuread_pass.rfc3339, "2h")
|
damn it, the above code works, but if someone delets the password outside of terraform, terraform will try recreating the password with an end date older than start date, which is not allowed. we really need the end_relative parameter fixed |
a better solution for my previous example. the password will only rotate on count change... end date is ignored so that its not recreated on every tf run resource "azuread_application_password" "chef_infra_spn" {
count = var.resource_count > 0 ? 1 : 0
application_id = var.infra_spn_object_id["application_id"]
display_name = var.workspace
end_date = timeadd(timestamp(), "2h")
rotate_when_changed = {
resource_count = var.resource_count
}
lifecycle {
ignore_changes = [end_date]
}
} |
Here is the latest warning message with version 3.0.2 of azuread. From the message, ╷ |
Community Note
Terraform (and AzureAD Provider) Version
Terraform v1.8.5
on linux_amd64
Affected Resource(s)
azuread_application_password
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
The rotated password should have been created with an expiration date of 13 months.
Actual Behavior
The rotated password was created with an expiration date of 24 months.
Steps to Reproduce
terraform apply
Important Factoids
References
applicationPasswordResourceCreate calls
PasswordCredentialForResource, which parses
end_date_relative
, then callsPasswordCredential, which doesn't use
end_date_relative
, resulting in a defaultend_date
of 24 months.Compare with the end date calculations done in KeyCredentialForResource.
The text was updated successfully, but these errors were encountered: