Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set the AWS console password for IAM user with Terraform

Tags:

terraform

I am newbie to the Terraform and just want to ask that is there anyway to set the AWS console password for IAM user with Terraform. I am able to configure the IAM users, group, their access and secret key but couldn't find the way to set the console password. Please point me to where I can get it work. Thanks

like image 942
Arbab Nazar Avatar asked Apr 12 '16 06:04

Arbab Nazar


1 Answers

Its possible to get console password for IAM USER using terraform :
Using below command :

terraform output password | base64 --decode | keybase pgp decrypt

Follow below instructions :

  1. Store password in outputs.tf file
  2. terraform output password > would give your encrypted password
  3. Now before install nodejs and node on your server and set PATH
  4. Now to decrypt password we need one more concept that is KEYBASE : https://keybase.io/
  5. Go this site create a account in KEYBASE from consolethen under Docs go to Linux/Ubuntu and follow instructions : Now in shell keybase login enter all details.

  6. Point to be noted :

resource "aws_iam_user_login_profile" "user_login" {
user = "${aws_iam_user.user.name}"
pgp_key = "keybase:username" ------------ username means: user you created in keybase account
password_length = 10 }

Now terraform plan
terraform apply
keybase pgp list
terraform output password | base64 --decode | keybase pgp decrypt

You would get your password :) :)

like image 140
Sai Susritha Avatar answered Sep 25 '22 10:09

Sai Susritha