-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: Added aws_iam_login_profile custom password setting #10734
Conversation
cc47308
to
e4aff6d
Compare
@@ -90,7 +90,27 @@ func TestAccAWSUserLoginProfile_notAKey(t *testing.T) { | |||
{ | |||
// We own this account but it doesn't have any key associated with it | |||
Config: testAccAWSUserLoginProfileConfig(username, "/", "lolimnotakey"), | |||
ExpectError: regexp.MustCompile(`Error encrypting password`), | |||
ExpectError: regexp.MustCompile(`Error encrypting Password`), |
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 typo here for password
, with error:
* aws_iam_user_login_profile.user: Error encrypting Password: Error parsing given PGP key: unexpected EOF
@@ -169,7 +189,7 @@ func testDecryptPasswordAndTest(nProfile, nAccessKey, key string) resource.TestC | |||
NewPassword: aws.String(generatePassword(20)), | |||
}) | |||
if err != nil { | |||
if awserr, ok := err.(awserr.Error); ok && awserr.Code() == "InvalidClientTokenId" { | |||
if awserr, ok := err.(awserr.Error); ok && (awserr.Code() == "InvalidClientTokenId" || awserr.Code() == "EntityTemporarilyUnmodifiable") { |
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.
This is required since I encountered this error:
Check failed: Check 2/2 error: Error changing decrypted password: EntityTemporarilyUnmodifiable: Login Profile for User test-user-5423997845776594466 cannot be modified while login profile is being created.
Hi @Ninir! The issue with setting a custom password is that it then appears in configuration unencrypted - is this the desired outcome? |
Hi @jen20 ! It is. In my case, it is sometimes useful to provide sequence-based passwords, like "user1", "user2" etc (training purposes for instance). Also, the variable can be passed using |
e4aff6d
to
ad52101
Compare
If you try to change the password without impersonating the user, the following error will be thrown:
I am able to do the update stuff, but it will require to impersonate the user, and update the profile. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Reasoning for this change
This is the continuation of #9605.
The previous PR introduced PGP-based keys, encrypting and decrypting using keybase.io.
As the login_profile password was generated, it was missing the ability to generate a custom password.
This allows to set it, making this even more flexible.
Real Configuration
Use cases
Demos, trainings or handsons.
Acceptance tests