-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlocals.tf
53 lines (51 loc) · 1.36 KB
/
locals.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
locals {
workflows_lambda_policy = [
{
Effect = "Allow",
Action = [
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage"
],
Resource = [
"${aws_ecr_repository.workflows_api_lambda_repository.arn}",
],
},
{
Effect = "Allow",
Action = [
"secretsmanager:GetSecretValue"
],
Resource = [
"arn:aws:secretsmanager:${var.aws_region}:${local.account_id}:secret:${var.cognito_app_secret}*"
],
},
{
Action : [
"airflow:CreateCliToken"
],
Resource : [
"arn:aws:airflow:${var.aws_region}:${local.account_id}:environment/${var.prefix}-mwaa"
],
Effect : "Allow"
},
{
"Effect" : "Allow",
"Action" : [
"ec2:DescribeNetworkInterfaces",
"ec2:CreateNetworkInterface",
"ec2:DeleteNetworkInterface",
"ec2:DescribeInstances",
"ec2:AttachNetworkInterface"
],
"Resource" : ["*"]
}
]
conditional_workflows_lambda_policy = var.data_access_role_arn != "" ? concat(local.workflows_lambda_policy, [
{
Effect : "Allow",
Action : ["sts:AssumeRole"],
Resource : [var.data_access_role_arn]
}
]) : local.workflows_lambda_policy
build_jwks_url = format("https://cognito-idp.%s.amazonaws.com/%s/.well-known/jwks.json", local.aws_region, var.userpool_id)
}