-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.tf
37 lines (32 loc) · 1.08 KB
/
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
resource "humanitec_resource_definition" "main" {
driver_type = "humanitec/terraform"
id = "${var.prefix}iam-policy-s3-${var.policy}"
name = "${var.prefix}iam-policy-s3-${var.policy}"
type = "aws-policy"
driver_account = var.driver_account
driver_inputs = {
values_string = jsonencode({
source = {
path = "modules/iam-policy/s3-${var.policy}"
rev = var.resource_packs_aws_rev
url = var.resource_packs_aws_url
}
append_logs_to_error = var.append_logs_to_error
credentials_config = {
environment = {
AWS_ACCESS_KEY_ID = "AccessKeyId"
AWS_SECRET_ACCESS_KEY = "SecretAccessKey"
AWS_SESSION_TOKEN = "SessionToken"
}
}
variables = {
region = var.region,
prefix = "${var.prefix}$${context.res.id}"
res_id = "$${context.res.id}"
app_id = "$${context.app.id}"
env_id = "$${context.env.id}"
s3_bucket_arn = "$${resources['s3.${var.s3_resource_class}'].outputs.arn}"
}
})
}
}