我正在尝试创建从映射用户到 SSH 密钥的传输密钥
content_users = {
"master" = [
"ssh-rsa ...",
"ssh-rsa ...",
"ssh-rsa ...",
]
"test" = [
"ssh-rsa ...",
"ssh-rsa ...",
]
}
这aws_transfer_user
部分很简单
resource "aws_transfer_user" "content" {
for_each = var.content_users
server_id = aws_transfer_server.content.id
user_name = each.key
role = aws_iam_role.transfer.arn
}
但我试图弄清楚如何做aws_transfer_key
只接受一个 ssh 密钥
resource "aws_transfer_ssh_key" "content" {
for_each = var.content_users
server_id = aws_transfer_server.content.id
user_name = each.key
body = "... SSH key ..."
}