File tree 3 files changed +30
-11
lines changed
3 files changed +30
-11
lines changed Original file line number Diff line number Diff line change 1
1
module "basic_example" {
2
- source = " ../../ "
2
+ source = " ../.."
3
3
4
4
name = var. name
5
5
}
Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ resource "aws_ecr_repository" "main" {
21
21
image_tag_mutability = var. image_tag_mutability
22
22
force_delete = var. force_delete
23
23
24
+ encryption_configuration {
25
+ encryption_type = var. encryption_type
26
+ kms_key = var. kms_key
27
+ }
28
+
24
29
image_scanning_configuration {
25
30
scan_on_push = var. scan_on_push
26
31
}
@@ -46,7 +51,7 @@ resource "aws_ecr_lifecycle_policy" "main" {
46
51
# to remove any null values from the JSON before sending it to AWS.
47
52
data "jq_query" "main" {
48
53
query = " del(..|nulls)"
49
- data = jsonencode ({
54
+ data = jsonencode ({
50
55
rules = [
51
56
for index , rule in var . lifecycle_rules : {
52
57
rulePriority = index + 1
Original file line number Diff line number Diff line change @@ -11,33 +11,33 @@ variable "tags" {
11
11
}
12
12
13
13
# # REPOSITORY
14
+ variable "encryption_type" {
15
+ description = " The encryption type to use for the repository."
16
+ default = " AES256"
17
+ type = string
18
+ }
19
+
14
20
variable "image_tag_mutability" {
15
21
description = " The tag mutability setting for the repository."
16
22
default = " MUTABLE"
17
23
type = string
18
24
}
19
25
20
- variable "scan_on_push" {
21
- description = " Indicates whether images are scanned after being pushed to the repository."
22
- default = true
23
- type = bool
24
- }
25
-
26
26
variable "force_delete" {
27
27
description = " Delete the repository even if it contains images."
28
28
default = false
29
29
type = bool
30
30
}
31
31
32
- variable "policy " {
33
- description = " Repository policy document in JSON format ."
32
+ variable "kms_key " {
33
+ description = " The ARN of the KMS key to use for encryption ."
34
34
default = null
35
35
type = string
36
36
}
37
37
38
38
variable "lifecycle_rules" {
39
39
description = " Lifecycle policy rules for expiring images."
40
- default = [
40
+ default = [
41
41
{
42
42
description = " Keep the last 30 tagged images"
43
43
tag_status = " tagged"
@@ -62,3 +62,17 @@ variable "lifecycle_rules" {
62
62
count_number = number
63
63
}))
64
64
}
65
+
66
+ variable "policy" {
67
+ description = " Repository policy document in JSON format."
68
+ default = null
69
+ type = string
70
+ }
71
+
72
+ variable "scan_on_push" {
73
+ description = " Indicates whether images are scanned after being pushed to the repository."
74
+ default = true
75
+ type = bool
76
+ }
77
+
78
+
You can’t perform that action at this time.
0 commit comments