-
Notifications
You must be signed in to change notification settings - Fork 79
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
Ignore service principal password resources from Terraform state management #351
Conversation
…sch/features/sp-mod-pwd-ignore
@iphilpot all checks are passing and ready for review |
@@ -28,4 +28,8 @@ resource "azuread_service_principal_password" "sp" { | |||
service_principal_id = azuread_service_principal.sp[0].object_id | |||
value = local.sp_password | |||
end_date_relative = var.sp_pwd_end_date_relative | |||
|
|||
lifecycle { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lifecycle hooks bake in the original passwords inserted into the creation of the service principal password and the key vault secrets that store them. How will password updates be managed due to this change? Outside of terraform?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes should be completed outside of TF
@@ -28,4 +28,8 @@ resource "azuread_service_principal_password" "sp" { | |||
service_principal_id = azuread_service_principal.sp[0].object_id | |||
value = local.sp_password | |||
end_date_relative = var.sp_pwd_end_date_relative | |||
|
|||
lifecycle { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to put this in the SP module and not in the template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind, it's a config element it looks like.
All Submissions:
What is the current behavior?
Currently, all azure resource(s) state changes related to the service principal password are managed through Terraform. This results in state changes being triggered for Terraform incremental builds as the password is randomly generated on each run. The impact is Terraform attempts to delete and recreate the password and KV secrets on each incremental deployment, regardless of template changes. Terraform should only be responsible for creating resources like the SP password and keyvault secrets when bootstrapping the initial azure environment.
Issue Number: #330
What is the new behavior?
Terraform resource types such as service prinipal passwords and keyvault secrets capturing sp passwords are ignored from state change lifecycles events via
Does this introduce a breaking change?