-
Notifications
You must be signed in to change notification settings - Fork 2
/
data.tf
63 lines (50 loc) · 1.4 KB
/
data.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
54
55
56
57
58
59
60
61
62
63
data "template_file" "this" {
template = file(var.definition_file)
vars = merge(var.definition_vars, zipmap(keys(var.repositories), aws_ecr_repository.this.*.repository_url), { "log_group" = module.logs.name, "region" = data.aws_region.current.name, "parameter-store-prefix" = "arn:aws:ssm:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:parameter/${local.id}-" })
}
data "aws_iam_policy_document" "ssm_parameter_store" {
statement {
actions = ["ssm:DescribeParameters"]
resources = ["*"]
}
statement {
actions = [
"ssm:GetParameters",
]
resources = [
"arn:aws:ssm:*:*:parameter/${local.id}-*",
]
}
}
data "aws_iam_policy_document" "ecr" {
statement {
actions = [
"ecr:GetAuthorizationToken"
]
resources = ["*"]
}
statement {
actions = [
"ecr:BatchCheckLayerAvailability",
"ecr:BatchGetImage",
"ecr:GetDownloadUrlForLayer"
]
resources = aws_ecr_repository.this.*.arn
}
}
data "aws_iam_role" "service_ecs" {
name = "AWSServiceRoleForECS"
}
data "aws_alb" "this" {
name = var.balancer["name"]
}
data "aws_alb_listener" "https" {
load_balancer_arn = data.aws_alb.this.arn
port = 443
}
data "aws_alb_listener" "http" {
load_balancer_arn = data.aws_alb.this.arn
port = 80
}
data "aws_region" "current" {}
data "aws_caller_identity" "current" {}