-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathecr.tf
129 lines (94 loc) · 2.69 KB
/
ecr.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
module "ecr_fluentbit" {
source = "./repo_pair"
namespace = local.namespace
repo_name = "fluentbit"
description = "A fluentbit image for sending logs to Logstash"
providers = {
aws.ecr_public = aws.ecr_public
}
}
module "ecr_nginx_experience" {
source = "./repo_pair"
namespace = local.namespace
repo_name = "nginx_experience"
description = "DEPRECATED: prefer nginx_frontend"
providers = {
aws.ecr_public = aws.ecr_public
}
}
module "ecr_nginx_frontend" {
source = "./repo_pair"
namespace = local.namespace
repo_name = "nginx_frontend"
description = "An nginx image for reverse proxying applications with frontends"
providers = {
aws.ecr_public = aws.ecr_public
}
}
module "ecr_nginx_frontend_identity" {
source = "./repo_pair"
namespace = local.namespace
repo_name = "nginx_frontend_identity"
description = "An nginx image for reverse proxying in the identity web app"
providers = {
aws.ecr_public = aws.ecr_public
}
}
module "ecr_nginx_apigw" {
source = "./repo_pair"
namespace = local.namespace
repo_name = "nginx_apigw"
description = "An nginx image to run as a proxy between API Gateway and our app containers"
providers = {
aws.ecr_public = aws.ecr_public
}
}
// Cross account access policies
module "nginx_apigw" {
source = "./repo_policy"
account_ids = local.account_ids
repo_name = module.ecr_nginx_apigw.private_repo_name
}
module "nginx_experience" {
source = "./repo_policy"
account_ids = local.account_ids
repo_name = module.ecr_nginx_experience.private_repo_name
}
module "nginx_frontend" {
source = "./repo_policy"
account_ids = local.account_ids
repo_name = module.ecr_nginx_frontend.private_repo_name
}
module "nginx_frontend_identity" {
source = "./repo_policy"
account_ids = local.account_ids
repo_name = module.ecr_nginx_frontend_identity.private_repo_name
}
module "fluentbit" {
source = "./repo_policy"
account_ids = local.account_ids
repo_name = module.ecr_fluentbit.private_repo_name
}
# In order to avoid docker hub rate limiting, we mirror some docker hub images
# see .../publish_mirrored_images.py for the script that copies images to these repos
resource "aws_ecr_repository" "mirrored_images" {
for_each = toset(local.mirrored_images)
name = each.key
}
module "mirrored_images_policy" {
source = "./repo_policy"
for_each = toset(local.mirrored_images)
account_ids = local.account_ids
repo_name = aws_ecr_repository.mirrored_images[each.key].name
}
locals {
mirrored_images = [
"localstack/localstack",
"nginx",
"pyfound/black",
"wellcome/flake8",
"wellcome/sbt_wrapper",
"wellcome/tox",
"zenko/cloudserver",
]
}