-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
fix: ignores password_reset_required change to support changes in AWS provider 4.x #24
Conversation
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.
@gberenice Looks simple and solid, but one question on the change shared below! 💯 🚀 👋
@@ -16,6 +16,10 @@ resource "aws_iam_user_login_profile" "default" { | |||
password_length = var.password_length | |||
password_reset_required = var.password_reset_required | |||
depends_on = [aws_iam_user.default] | |||
|
|||
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.
Hm... Does adding the lifecycle
block force a recreate of this resource? What does that do for existing IAM users that you're managing?
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.
After upgrade of AWS provider to 4.x (in our case - to 4.21, without any change to root module configuration or terraform vars) the resource was forced to recreate:
# module.users["veronika_gnilitska"].aws_iam_user_login_profile.default[0] must be replaced
-/+ resource "aws_iam_user_login_profile" "default" {
~ encrypted_password = "wcBMAwEF3O2PIAyrAQgAvoQ6klRbbQ705f0Pj6l9uf4C/9GOdVfiEqmBkendM3dKPRkbbcJVXRP80xaTkElae17OiS69QJVji3/sS3ru2TLnFyZcNtSMayu9sodi2VDbNOhN6FRywuv9OBkBcgDu7686pOZLG27H2zT7V18sBwYR6bDaUepnLtDLq" -> (known after apply)
~ id = "veronika.gnilitska" -> (known after apply)
~ key_fingerprint = "92f19546ec0f7d7ca8f9d" -> (known after apply)
+ password = (known after apply)
~ password_reset_required = false -> true # forces replacement
# (3 unchanged attributes hidden)
}
If you apply this plan you won't be able to login with the credentials used before the apply. To avoid this behaviour for existing users - lifecycle was used.
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.
👍 👍
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.
@Gowiem thank you! 💯
/test all |
@Gowiem oh, I see that some check were failed, but I doubt that it's related to introduced changes:
Could you please advise how it can be fixed? |
@gberenice the issue is due to a missing |
/test all |
@Gowiem awesome, that worked! 😃 |
@gberenice Solid work -- Thanks for the fix! Released as https://github.com/cloudposse/terraform-aws-iam-user/releases/tag/0.8.2 |
what
why
references