-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregistries.tf
90 lines (76 loc) · 2.2 KB
/
registries.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
#
# Mirror of Docker registries to prevent docker.io throttling and removes the need of a NAT Gateway
# /!\ You must push corresponding images here once infrastructure deployed
#
resource "aws_kms_key" "registry" {
description = "KMS Key for private registries"
deletion_window_in_days = 7
policy = jsonencode({
Id = "Default Permissions"
Statement = [
{
Sid = "Enable IAM User Permissions",
Effect = "Allow",
Principal = {
AWS = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"
},
Action = "kms:*",
Resource = "*"
}
]
Version = "2012-10-17"
}
)
}
resource "aws_kms_alias" "registry" {
name = "alias/${local.resources_prefix}-registry"
target_key_id = aws_kms_key.registry.arn
}
resource "aws_ecr_repository" "jitsi_jicofo" {
name = "${local.resources_prefix}-mirror/jitsi/jicofo"
image_tag_mutability = "MUTABLE"
force_delete = true
encryption_configuration {
encryption_type = "KMS"
kms_key = aws_kms_key.registry.arn
}
image_scanning_configuration {
scan_on_push = true
}
}
resource "aws_ecr_repository" "jitsi_jvb" {
name = "${local.resources_prefix}-mirror/jitsi/jvb"
image_tag_mutability = "MUTABLE"
force_delete = true
encryption_configuration {
encryption_type = "KMS"
kms_key = aws_kms_key.registry.arn
}
image_scanning_configuration {
scan_on_push = true
}
}
resource "aws_ecr_repository" "jitsi_prosody" {
name = "${local.resources_prefix}-mirror/jitsi/prosody"
image_tag_mutability = "MUTABLE"
force_delete = true
encryption_configuration {
encryption_type = "KMS"
kms_key = aws_kms_key.registry.arn
}
image_scanning_configuration {
scan_on_push = true
}
}
resource "aws_ecr_repository" "jitsi_web" {
name = "${local.resources_prefix}-mirror/jitsi/web"
image_tag_mutability = "MUTABLE"
force_delete = true
encryption_configuration {
encryption_type = "KMS"
kms_key = aws_kms_key.registry.arn
}
image_scanning_configuration {
scan_on_push = true
}
}