forked from cloudposse/terraform-aws-transfer-sftp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
38 lines (28 loc) · 702 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
26
27
28
29
30
31
32
33
34
35
36
37
38
provider "aws" {
region = var.region
}
provider "awsutils" {
region = var.region
}
module "s3_bucket" {
source = "cloudposse/s3-bucket/aws"
version = "2.0.3"
for_each = toset(["home", "extra"])
acl = "private"
enabled = true
user_enabled = false
versioning_enabled = false
force_destroy = true
attributes = [each.value]
context = module.this.context
}
module "sftp" {
source = "../.."
sftp_users = merge(var.sftp_users, {
kenny = merge({
s3_bucket_name = module.s3_bucket["extra"].bucket_id
}, var.sftp_users["kenny"])
})
s3_bucket_name = module.s3_bucket["home"].bucket_id
context = module.this.context
}