这是我的输出定义:
data "template_file" "decrypted_keys" {
count = "${aws_instance.worker.count}"
template = "${rsadecrypt(element(aws_instance.worker.*.password_data, count.index), file(module.ssh_key_pair.private_key_filename))}"
}
output "administrator_password" {
value = "${data.template_file.decrypted_keys.*.rendered}"
}
我发现我只需运行即可获取密码
terraform output administrator_password
即使我已经删除了私钥文件。
我需要此密码输出,因为它对于例如RDP访问至关重要。
但是,由于我将此状态文件保存在私有github存储库中,因此我认为这是一个潜在的安全漏洞。有权访问该存储库的人都可以获取管理员密码。
在保护这些密码方面是否有最佳实践?