-
Notifications
You must be signed in to change notification settings - Fork 36
/
main.tf
25 lines (20 loc) · 868 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
resource "aws_transfer_server" "transfer_server" {
identity_provider_type = "SERVICE_MANAGED"
logging_role = aws_iam_role.transfer_server_role.arn
tags = {
NAME = var.transfer_server_name
}
}
resource "aws_transfer_user" "transfer_server_user" {
count = length(var.transfer_server_user_names)
server_id = aws_transfer_server.transfer_server.id
user_name = element(var.transfer_server_user_names, count.index)
role = aws_iam_role.transfer_server_role.arn
home_directory = "/${var.bucket_name}"
}
resource "aws_transfer_ssh_key" "transfer_server_ssh_key" {
count = length(var.transfer_server_user_names)
server_id = aws_transfer_server.transfer_server.id
user_name = element(aws_transfer_user.transfer_server_user.*.user_name, count.index)
body = element(var.transfer_server_ssh_keys, count.index)
}