使用 Terraform 为 IAM 用户设置 AWS 控制台密码 [英] Set the AWS console password for IAM user with Terraform

查看:69
本文介绍了使用 Terraform 为 IAM 用户设置 AWS 控制台密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Terraform 的新手,我只是想问一下是否可以为使用 Terraform 的 IAM 用户设置 AWS 控制台密码.我能够配置 IAM 用户、组、他们的访问权限和密钥,但找不到设置控制台密码的方法.请指出我可以在哪里工作.谢谢

解决方案

可以使用 terraform 获取 IAM USER 的控制台密码:
使用以下命令:

terraform 输出密码 |base64 --解码 |keybase pgp 解密

按照以下说明进行操作:

  1. 将密码存储在 output.tf 文件中
  2. terraform 输出密码 > 将提供您的加密密码
  3. 现在在你的服务器上安装 nodejs 和 node 并设置 PATH 之前
  4. 现在要解密密码,我们还需要一个 KEYBASE 概念:https://keybase.io/
  5. 从控制台转到此站点在 KEYBASE 中创建一个帐户,然后在 Docs 下转到 Linux/Ubuntu 并按照说明进行操作:现在在外壳中密钥库登录输入所有详细信息.

  6. 注意事项:

<块引用>

资源aws_iam_user_login_profile"user_login"{
用户 = "${aws_iam_user.user.name}"
pgp_key = "keybase:username" ------------ 用户名表示:用户你在密钥库帐户中创建
密码长度 = 10 }

现在的地形计划
terraform 应用
密钥库 pgp 列表
terraform 输出密码 |base64 --解码 |密钥库 pgp 解密

你会得到你的密码:) :)

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

解决方案

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 :) :)

这篇关于使用 Terraform 为 IAM 用户设置 AWS 控制台密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆