@intentius/chant-lexicon-terraform 0.100.0 → 0.102.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codegen/package.d.ts +1 -1
- package/dist/config.d.ts +2 -2
- package/dist/hcl/jsonencode.d.ts +106 -0
- package/dist/hcl/jsonencode.d.ts.map +1 -0
- package/dist/hcl/marker.d.ts.map +1 -1
- package/dist/integrity.json +11 -2
- package/dist/lint/audit-catalog.d.ts.map +1 -1
- package/dist/lint/audit-lineage.d.ts +1 -1
- package/dist/lint/audit-lineage.d.ts.map +1 -1
- package/dist/lint/post-synth/flat-attributes.d.ts +69 -0
- package/dist/lint/post-synth/flat-attributes.d.ts.map +1 -0
- package/dist/lint/post-synth/index.d.ts.map +1 -1
- package/dist/lint/post-synth/tf030.d.ts +51 -0
- package/dist/lint/post-synth/tf030.d.ts.map +1 -0
- package/dist/lint/post-synth/tf031.d.ts +55 -0
- package/dist/lint/post-synth/tf031.d.ts.map +1 -0
- package/dist/lint/post-synth/tf032.d.ts +71 -0
- package/dist/lint/post-synth/tf032.d.ts.map +1 -0
- package/dist/lint/post-synth/tf033.d.ts +50 -0
- package/dist/lint/post-synth/tf033.d.ts.map +1 -0
- package/dist/lint/post-synth/tf034.d.ts +25 -0
- package/dist/lint/post-synth/tf034.d.ts.map +1 -0
- package/dist/lint/post-synth/tf035.d.ts +33 -0
- package/dist/lint/post-synth/tf035.d.ts.map +1 -0
- package/dist/lint/post-synth/tf036.d.ts +33 -0
- package/dist/lint/post-synth/tf036.d.ts.map +1 -0
- package/dist/lint/post-synth/tf037.d.ts +31 -0
- package/dist/lint/post-synth/tf037.d.ts.map +1 -0
- package/dist/manifest.json +1 -1
- package/dist/okf/index.md +8 -0
- package/dist/okf/rules/TF030.md +11 -0
- package/dist/okf/rules/TF031.md +11 -0
- package/dist/okf/rules/TF032.md +11 -0
- package/dist/okf/rules/TF033.md +11 -0
- package/dist/okf/rules/TF034.md +11 -0
- package/dist/okf/rules/TF035.md +11 -0
- package/dist/okf/rules/TF036.md +11 -0
- package/dist/okf/rules/TF037.md +11 -0
- package/dist/op/activity-contracts.d.ts +18 -18
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/rules/flat-attributes.ts +146 -0
- package/dist/rules/tf030.ts +290 -0
- package/dist/rules/tf031.ts +370 -0
- package/dist/rules/tf032.ts +226 -0
- package/dist/rules/tf033.ts +160 -0
- package/dist/rules/tf034.ts +63 -0
- package/dist/rules/tf035.ts +74 -0
- package/dist/rules/tf036.ts +119 -0
- package/dist/rules/tf037.ts +101 -0
- package/package.json +3 -3
- package/src/hcl/jsonencode.test.ts +226 -0
- package/src/hcl/jsonencode.ts +454 -0
- package/src/lint/audit-catalog.ts +148 -0
- package/src/lint/audit-lineage.ts +155 -1
- package/src/lint/post-synth/estate-2284.test.ts +68 -0
- package/src/lint/post-synth/fixtures/TF030/negative-rules.tf +45 -0
- package/src/lint/post-synth/fixtures/TF030/negative.tf +55 -0
- package/src/lint/post-synth/fixtures/TF030/not-determined-port.tf +28 -0
- package/src/lint/post-synth/fixtures/TF030/not-determined-standalone.tf +32 -0
- package/src/lint/post-synth/fixtures/TF030/not-determined-vpc-rule.tf +21 -0
- package/src/lint/post-synth/fixtures/TF030/not-determined.tf +39 -0
- package/src/lint/post-synth/fixtures/TF030/positive-ipv6.tf +44 -0
- package/src/lint/post-synth/fixtures/TF030/positive-mixed.tf +36 -0
- package/src/lint/post-synth/fixtures/TF030/positive-standalone.tf +25 -0
- package/src/lint/post-synth/fixtures/TF030/positive.tf +43 -0
- package/src/lint/post-synth/fixtures/TF031/negative.tf +89 -0
- package/src/lint/post-synth/fixtures/TF031/not-determined.tf +139 -0
- package/src/lint/post-synth/fixtures/TF031/positive-data-source.tf +57 -0
- package/src/lint/post-synth/fixtures/TF031/positive-heredoc.tf +149 -0
- package/src/lint/post-synth/fixtures/TF031/positive-jsonencode.tf +115 -0
- package/src/lint/post-synth/fixtures/TF032/negative-heredoc.tf +20 -0
- package/src/lint/post-synth/fixtures/TF032/negative-references.tf +214 -0
- package/src/lint/post-synth/fixtures/TF032/negative.tf +99 -0
- package/src/lint/post-synth/fixtures/TF032/positive-heredoc.tf +22 -0
- package/src/lint/post-synth/fixtures/TF032/positive-sidecar.tf +197 -0
- package/src/lint/post-synth/fixtures/TF032/positive.tf +54 -0
- package/src/lint/post-synth/fixtures/TF033/negative.tf +39 -0
- package/src/lint/post-synth/fixtures/TF033/not-determined-aurora.tf +25 -0
- package/src/lint/post-synth/fixtures/TF033/positive-absent.tf +93 -0
- package/src/lint/post-synth/fixtures/TF033/positive.tf +50 -0
- package/src/lint/post-synth/fixtures/TF034/negative.tf +24 -0
- package/src/lint/post-synth/fixtures/TF034/positive-absent.tf +36 -0
- package/src/lint/post-synth/fixtures/TF034/positive.tf +14 -0
- package/src/lint/post-synth/fixtures/TF035/negative-absent.tf +43 -0
- package/src/lint/post-synth/fixtures/TF035/negative.tf +54 -0
- package/src/lint/post-synth/fixtures/TF035/positive.tf +37 -0
- package/src/lint/post-synth/fixtures/TF036/negative.tf +61 -0
- package/src/lint/post-synth/fixtures/TF036/not-determined.tf +28 -0
- package/src/lint/post-synth/fixtures/TF036/positive.tf +38 -0
- package/src/lint/post-synth/fixtures/TF037/negative-exclusion.tf +63 -0
- package/src/lint/post-synth/fixtures/TF037/negative.tf +27 -0
- package/src/lint/post-synth/fixtures/TF037/not-determined.tf +27 -0
- package/src/lint/post-synth/fixtures/TF037/positive-absent.tf +15 -0
- package/src/lint/post-synth/fixtures/TF037/positive.tf +26 -0
- package/src/lint/post-synth/fixtures/estate-2284/clean/main.tf +132 -0
- package/src/lint/post-synth/fixtures/estate-2284/violating/main.tf +112 -0
- package/src/lint/post-synth/flat-attributes.ts +146 -0
- package/src/lint/post-synth/index.ts +16 -0
- package/src/lint/post-synth/tf030.test.ts +219 -0
- package/src/lint/post-synth/tf030.ts +290 -0
- package/src/lint/post-synth/tf031.test.ts +229 -0
- package/src/lint/post-synth/tf031.ts +370 -0
- package/src/lint/post-synth/tf032.test.ts +127 -0
- package/src/lint/post-synth/tf032.ts +226 -0
- package/src/lint/post-synth/tf033.test.ts +126 -0
- package/src/lint/post-synth/tf033.ts +160 -0
- package/src/lint/post-synth/tf034.test.ts +71 -0
- package/src/lint/post-synth/tf034.ts +63 -0
- package/src/lint/post-synth/tf035.test.ts +68 -0
- package/src/lint/post-synth/tf035.ts +74 -0
- package/src/lint/post-synth/tf036.test.ts +87 -0
- package/src/lint/post-synth/tf036.ts +119 -0
- package/src/lint/post-synth/tf037.test.ts +88 -0
- package/src/lint/post-synth/tf037.ts +101 -0
- package/src/op/activities/terraform.test.ts +2 -2
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Vendored for TF033 (chant #2288) from https://github.com/zoitech/terraform-aws-concourse
|
|
2
|
+
# Path: rds.tf
|
|
3
|
+
# Commit: fa3f3c3eecaa9144ea556e52cd3c43bff3bdd510
|
|
4
|
+
# Licence: MIT, https://github.com/zoitech/terraform-aws-concourse/blob/fa3f3c3eecaa9144ea556e52cd3c43bff3bdd510/LICENSE
|
|
5
|
+
# The whole file, unmodified.
|
|
6
|
+
#
|
|
7
|
+
# TF033: one error. aws_db_instance.postgres does not set storage_encrypted, and the provider default is false.
|
|
8
|
+
# Its snapshot_identifier = "" is not a source: the provider reads it with GetOk, so "" is the same as unset.
|
|
9
|
+
#
|
|
10
|
+
# Copyright (c) 2017 Zoi TechCon GmbH
|
|
11
|
+
#
|
|
12
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
# in the Software without restriction, including without limitation the rights
|
|
15
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
# furnished to do so, subject to the following conditions:
|
|
18
|
+
#
|
|
19
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
# copies or substantial portions of the Software.
|
|
21
|
+
#
|
|
22
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
# SOFTWARE.
|
|
29
|
+
|
|
30
|
+
resource "aws_db_subnet_group" "postgres" {
|
|
31
|
+
name = "${lower(var.prefix)}-private"
|
|
32
|
+
subnet_ids = var.private_sn
|
|
33
|
+
|
|
34
|
+
tags = var.rds_tags
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
resource "aws_db_parameter_group" "concourse" {
|
|
38
|
+
name = "${var.prefix}-concourse-${var.postgres_family}"
|
|
39
|
+
family = var.postgres_family
|
|
40
|
+
|
|
41
|
+
tags = var.rds_tags
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
resource "aws_db_instance" "postgres" {
|
|
45
|
+
identifier = "${lower(var.prefix)}-concourse-db"
|
|
46
|
+
allocated_storage = var.concourse_db_storage
|
|
47
|
+
storage_type = "gp2"
|
|
48
|
+
engine = "postgres"
|
|
49
|
+
engine_version = var.postgres_version
|
|
50
|
+
instance_class = var.concourse_db_size
|
|
51
|
+
username = var.postgres_username
|
|
52
|
+
password = local.postgres_password
|
|
53
|
+
db_subnet_group_name = aws_db_subnet_group.postgres.id
|
|
54
|
+
parameter_group_name = aws_db_parameter_group.concourse.id
|
|
55
|
+
multi_az = var.postgres_multiaz
|
|
56
|
+
backup_retention_period = 35
|
|
57
|
+
maintenance_window = "Sat:21:00-Sun:00:00"
|
|
58
|
+
backup_window = "00:00-02:00"
|
|
59
|
+
vpc_security_group_ids = [aws_security_group.RuleGroupWsIn.id]
|
|
60
|
+
copy_tags_to_snapshot = true
|
|
61
|
+
snapshot_identifier = ""
|
|
62
|
+
skip_final_snapshot = true
|
|
63
|
+
final_snapshot_identifier = "LastSnap"
|
|
64
|
+
apply_immediately = true
|
|
65
|
+
|
|
66
|
+
lifecycle {
|
|
67
|
+
prevent_destroy = true
|
|
68
|
+
ignore_changes = [engine_version]
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
tags = merge({ Name = "${lower(var.prefix)}-concourse-db"}, var.rds_tags)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
# Monitoring of DB events
|
|
75
|
+
resource "aws_sns_topic" "postgres" {
|
|
76
|
+
name = "${lower(var.prefix)}-rds-topic"
|
|
77
|
+
|
|
78
|
+
tags = merge({ Name = "${lower(var.prefix)}-rds-topic"}, var.sns_tags)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
resource "aws_db_event_subscription" "postgres" {
|
|
82
|
+
name = "${lower(var.prefix)}-rds-sub"
|
|
83
|
+
sns_topic = aws_sns_topic.postgres.arn
|
|
84
|
+
|
|
85
|
+
source_type = "db-instance"
|
|
86
|
+
source_ids = [aws_db_instance.postgres.identifier]
|
|
87
|
+
|
|
88
|
+
# see here for further event categories
|
|
89
|
+
event_categories = [
|
|
90
|
+
"low storage",
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Vendored for TF033 (chant #2288) from https://github.com/bridgecrewio/terragoat
|
|
2
|
+
# Path: terraform/aws/db-app.tf
|
|
3
|
+
# Commit: 729f8da62c6a85ce4af5ad3d123de97776d954c4
|
|
4
|
+
# Licence: Apache-2.0, https://github.com/bridgecrewio/terragoat/blob/729f8da62c6a85ce4af5ad3d123de97776d954c4/LICENSE
|
|
5
|
+
# Excerpt: lines 1-42, unmodified.
|
|
6
|
+
#
|
|
7
|
+
# TF033: one error. TerraGoat is a deliberately vulnerable estate; aws_db_instance.default writes storage_encrypted = false.
|
|
8
|
+
|
|
9
|
+
resource "aws_db_instance" "default" {
|
|
10
|
+
|
|
11
|
+
name = var.dbname
|
|
12
|
+
engine = "mysql"
|
|
13
|
+
option_group_name = aws_db_option_group.default.name
|
|
14
|
+
parameter_group_name = aws_db_parameter_group.default.name
|
|
15
|
+
db_subnet_group_name = aws_db_subnet_group.default.name
|
|
16
|
+
vpc_security_group_ids = ["${aws_security_group.default.id}"]
|
|
17
|
+
|
|
18
|
+
identifier = "rds-${local.resource_prefix.value}"
|
|
19
|
+
engine_version = "8.0" # Latest major version
|
|
20
|
+
instance_class = "db.t3.micro"
|
|
21
|
+
allocated_storage = "20"
|
|
22
|
+
username = "admin"
|
|
23
|
+
password = var.password
|
|
24
|
+
apply_immediately = true
|
|
25
|
+
multi_az = false
|
|
26
|
+
backup_retention_period = 0
|
|
27
|
+
storage_encrypted = false
|
|
28
|
+
skip_final_snapshot = true
|
|
29
|
+
monitoring_interval = 0
|
|
30
|
+
publicly_accessible = true
|
|
31
|
+
|
|
32
|
+
tags = merge({
|
|
33
|
+
Name = "${local.resource_prefix.value}-rds"
|
|
34
|
+
Environment = local.resource_prefix.value
|
|
35
|
+
}, {
|
|
36
|
+
git_commit = "e6d83b21346fe85d4fe28b16c0b2f1e0662eb1d7"
|
|
37
|
+
git_file = "terraform/aws/db-app.tf"
|
|
38
|
+
git_last_modified_at = "2023-04-27 12:47:51"
|
|
39
|
+
git_last_modified_by = "nadler@paloaltonetworks.com"
|
|
40
|
+
git_modifiers = "nadler/nimrodkor"
|
|
41
|
+
git_org = "bridgecrewio"
|
|
42
|
+
git_repo = "terragoat"
|
|
43
|
+
yor_trace = "47c13290-c2ce-48a7-b666-1b0085effb92"
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
# Ignore password changes from tf plan diff
|
|
47
|
+
lifecycle {
|
|
48
|
+
ignore_changes = ["password"]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Vendored for TF034 (chant #2288) from https://github.com/covidgreen/covid-green-infra
|
|
2
|
+
# Path: sns.tf
|
|
3
|
+
# Commit: 864d159afca9367db21cca05b1e8eb58038bdbd6
|
|
4
|
+
# Licence: Apache-2.0, https://github.com/covidgreen/covid-green-infra/blob/864d159afca9367db21cca05b1e8eb58038bdbd6/LICENSE
|
|
5
|
+
# The whole file, unmodified.
|
|
6
|
+
#
|
|
7
|
+
# TF034: silent. Both topics set kms_master_key_id = aws_kms_alias.sns.arn, an attribute of a managed alias,
|
|
8
|
+
# which is never empty.
|
|
9
|
+
|
|
10
|
+
resource "aws_sns_topic" "callback_email_notifications" {
|
|
11
|
+
count = local.enable_callback_email_notifications_count
|
|
12
|
+
|
|
13
|
+
name = "${module.labels.id}-callback-email-notifications"
|
|
14
|
+
kms_master_key_id = aws_kms_alias.sns.arn
|
|
15
|
+
tags = module.labels.tags
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
resource "aws_sns_topic" "daily_registrations_reporter" {
|
|
19
|
+
count = local.lambda_daily_registrations_reporter_count
|
|
20
|
+
|
|
21
|
+
name = "${module.labels.id}-daily-registrations-reporter"
|
|
22
|
+
kms_master_key_id = aws_kms_alias.sns.arn
|
|
23
|
+
tags = module.labels.tags
|
|
24
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Vendored for TF034 (chant #2288) from https://github.com/radian-software/riju
|
|
2
|
+
# Path: tf/sns.tf
|
|
3
|
+
# Commit: ace9df7cd8f186b869af14d721e055864ed8f3e4
|
|
4
|
+
# Licence: MIT, https://github.com/radian-software/riju/blob/ace9df7cd8f186b869af14d721e055864ed8f3e4/LICENSE.md
|
|
5
|
+
# The whole file, unmodified.
|
|
6
|
+
#
|
|
7
|
+
# TF034: one warning. The topic does not set kms_master_key_id, and no AWS default encrypts a topic that names no key.
|
|
8
|
+
#
|
|
9
|
+
# Copyright (c) 2020–2022 [Radian LLC](https://radian.codes) and
|
|
10
|
+
# contributors
|
|
11
|
+
#
|
|
12
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
# in the Software without restriction, including without limitation the rights
|
|
15
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
# furnished to do so, subject to the following conditions:
|
|
18
|
+
#
|
|
19
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
# copies or substantial portions of the Software.
|
|
21
|
+
#
|
|
22
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
# SOFTWARE.
|
|
29
|
+
|
|
30
|
+
resource "aws_sns_topic" "riju" {
|
|
31
|
+
name = "Riju"
|
|
32
|
+
|
|
33
|
+
tags = {
|
|
34
|
+
BillingSubcategory = "Riju:SNS"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Vendored for TF034 (chant #2288) from https://github.com/Checkmarx/kics
|
|
2
|
+
# Path: assets/queries/terraform/aws/sns_topic_not_encrypted/test/positive1.tf
|
|
3
|
+
# Commit: 8a0f0bbaf380c6f9110bfe9808311f49aac45cde
|
|
4
|
+
# Licence: Apache-2.0, https://github.com/Checkmarx/kics/blob/8a0f0bbaf380c6f9110bfe9808311f49aac45cde/LICENSE
|
|
5
|
+
# The whole file, unmodified.
|
|
6
|
+
#
|
|
7
|
+
# KICS's own test corpus for "SNS Topic Not Encrypted".
|
|
8
|
+
#
|
|
9
|
+
# TF034: one warning. kms_master_key_id = "" names no key.
|
|
10
|
+
|
|
11
|
+
resource "aws_sns_topic" "user_updates" {
|
|
12
|
+
name = "user-updates-topic"
|
|
13
|
+
kms_master_key_id = ""
|
|
14
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Vendored for TF035 (chant #2288) from https://github.com/cds-snc/notification-terraform
|
|
2
|
+
# Path: aws/common/sqs.tf
|
|
3
|
+
# Commit: f202d882331fa2814170e4a65695291797af282d
|
|
4
|
+
# Licence: MIT, https://github.com/cds-snc/notification-terraform/blob/f202d882331fa2814170e4a65695291797af282d/LICENSE
|
|
5
|
+
# Excerpt: lines 60-73, unmodified.
|
|
6
|
+
#
|
|
7
|
+
# TF035: silent. The queue sets neither sqs_managed_sse_enabled nor kms_master_key_id, so AWS's SSE-SQS default
|
|
8
|
+
# encrypts it. This is the case the bridged WAW026 got wrong on every queue.
|
|
9
|
+
#
|
|
10
|
+
# Copyright (c) 2020 Canadian Digital Service – Service numérique canadien
|
|
11
|
+
#
|
|
12
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
# in the Software without restriction, including without limitation the rights
|
|
15
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
# furnished to do so, subject to the following conditions:
|
|
18
|
+
#
|
|
19
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
# copies or substantial portions of the Software.
|
|
21
|
+
#
|
|
22
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
# SOFTWARE.
|
|
29
|
+
|
|
30
|
+
resource "aws_sqs_queue" "eks_notification_canada_cadelivery_receipts" {
|
|
31
|
+
provider = aws.core_services
|
|
32
|
+
name = "eks-notification-canada-cadelivery-receipts"
|
|
33
|
+
delay_seconds = 0
|
|
34
|
+
max_message_size = var.sqs_max_message_size
|
|
35
|
+
#4 Days
|
|
36
|
+
message_retention_seconds = 345600
|
|
37
|
+
receive_wait_time_seconds = 0
|
|
38
|
+
visibility_timeout_seconds = var.sqs_visibility_timeout_default
|
|
39
|
+
|
|
40
|
+
tags = {
|
|
41
|
+
Environment = var.env
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Vendored for TF035 (chant #2288) from https://github.com/cds-snc/notification-terraform
|
|
2
|
+
# Path: aws/common/sqs.tf
|
|
3
|
+
# Commit: f202d882331fa2814170e4a65695291797af282d
|
|
4
|
+
# Licence: MIT, https://github.com/cds-snc/notification-terraform/blob/f202d882331fa2814170e4a65695291797af282d/LICENSE
|
|
5
|
+
# Excerpt: lines 1-26, unmodified.
|
|
6
|
+
#
|
|
7
|
+
# TF035: silent. Three queues set sqs_managed_sse_enabled = true.
|
|
8
|
+
#
|
|
9
|
+
# Copyright (c) 2020 Canadian Digital Service – Service numérique canadien
|
|
10
|
+
#
|
|
11
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
# in the Software without restriction, including without limitation the rights
|
|
14
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
# furnished to do so, subject to the following conditions:
|
|
17
|
+
#
|
|
18
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
# copies or substantial portions of the Software.
|
|
20
|
+
#
|
|
21
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
# SOFTWARE.
|
|
28
|
+
|
|
29
|
+
resource "aws_sqs_queue" "priority_db_tasks_queue" {
|
|
30
|
+
provider = aws.core_services
|
|
31
|
+
name = "${var.celery_queue_prefix}-${var.sqs_priority_db_tasks_queue_name}"
|
|
32
|
+
fifo_queue = true
|
|
33
|
+
deduplication_scope = "messageGroup"
|
|
34
|
+
fifo_throughput_limit = "perMessageGroupId"
|
|
35
|
+
sqs_managed_sse_enabled = true
|
|
36
|
+
# tfsec:ignore:AWS015 - Queues should be encrypted with customer managed KMS keys
|
|
37
|
+
# AWS managed encryption is good enough for us
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
resource "aws_sqs_queue" "normal_db_tasks_queue" {
|
|
41
|
+
provider = aws.core_services
|
|
42
|
+
name = "${var.celery_queue_prefix}-${var.sqs_normal_db_tasks_queue_name}"
|
|
43
|
+
sqs_managed_sse_enabled = true
|
|
44
|
+
# tfsec:ignore:AWS015 - Queues should be encrypted with customer managed KMS keys
|
|
45
|
+
# AWS managed encryption is good enough for us
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
resource "aws_sqs_queue" "bulk_db_tasks_queue" {
|
|
49
|
+
provider = aws.core_services
|
|
50
|
+
name = "${var.celery_queue_prefix}-${var.sqs_bulk_db_tasks_queue_name}"
|
|
51
|
+
sqs_managed_sse_enabled = true
|
|
52
|
+
# tfsec:ignore:AWS015 - Queues should be encrypted with customer managed KMS keys
|
|
53
|
+
# AWS managed encryption is good enough for us
|
|
54
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Vendored for TF035 (chant #2288) from https://github.com/cds-snc/notification-terraform
|
|
2
|
+
# Path: aws/common/sqs.tf
|
|
3
|
+
# Commit: f202d882331fa2814170e4a65695291797af282d
|
|
4
|
+
# Licence: MIT, https://github.com/cds-snc/notification-terraform/blob/f202d882331fa2814170e4a65695291797af282d/LICENSE
|
|
5
|
+
# Excerpt: lines 28-36, unmodified.
|
|
6
|
+
#
|
|
7
|
+
# TF035: one warning. sqs_managed_sse_enabled = false with no kms_master_key_id turns off the SSE-SQS default.
|
|
8
|
+
#
|
|
9
|
+
# Copyright (c) 2020 Canadian Digital Service – Service numérique canadien
|
|
10
|
+
#
|
|
11
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
# in the Software without restriction, including without limitation the rights
|
|
14
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
# furnished to do so, subject to the following conditions:
|
|
17
|
+
#
|
|
18
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
# copies or substantial portions of the Software.
|
|
20
|
+
#
|
|
21
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
# SOFTWARE.
|
|
28
|
+
|
|
29
|
+
resource "aws_sqs_queue" "notify_internal_tasks_queue" {
|
|
30
|
+
provider = aws.core_services
|
|
31
|
+
name = "${var.celery_queue_prefix}notify-internal-tasks"
|
|
32
|
+
# This queue was created outside of terraform and has this value set to false in staging and production.
|
|
33
|
+
sqs_managed_sse_enabled = false
|
|
34
|
+
max_message_size = var.sqs_max_message_size
|
|
35
|
+
# This queue was created outside of terraform and has this value set to default in staging and production.
|
|
36
|
+
visibility_timeout_seconds = var.sqs_visibility_timeout_default
|
|
37
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Vendored for TF036 (chant #2288) from https://github.com/ned1313/terraform-tuesdays
|
|
2
|
+
# Path: 2021-04-13-AWS-KMS/ebs/main.tf
|
|
3
|
+
# Commit: 7651f6028ba18f01ad0273a15169e4058025c944
|
|
4
|
+
# Licence: MIT, https://github.com/ned1313/terraform-tuesdays/blob/7651f6028ba18f01ad0273a15169e4058025c944/LICENSE
|
|
5
|
+
# The whole file, unmodified.
|
|
6
|
+
#
|
|
7
|
+
# TF036: silent. The volume sets encrypted = true with a customer managed kms_key_id.
|
|
8
|
+
#
|
|
9
|
+
# Copyright (c) 2020 Ned Bellavance
|
|
10
|
+
#
|
|
11
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
# in the Software without restriction, including without limitation the rights
|
|
14
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
# furnished to do so, subject to the following conditions:
|
|
17
|
+
#
|
|
18
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
# copies or substantial portions of the Software.
|
|
20
|
+
#
|
|
21
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
# SOFTWARE.
|
|
28
|
+
|
|
29
|
+
terraform {
|
|
30
|
+
required_providers {
|
|
31
|
+
aws = {
|
|
32
|
+
source = "hashicorp/aws"
|
|
33
|
+
version = "~> 3.0"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
# Configure the AWS Provider
|
|
39
|
+
provider "aws" {
|
|
40
|
+
region = var.region
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
variable "region" {
|
|
44
|
+
type = string
|
|
45
|
+
default = "us-east-1"
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
data "aws_availability_zones" "azs" {
|
|
49
|
+
state = "available"
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
resource "aws_kms_key" "ebs" {
|
|
53
|
+
description = "EBS key"
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
resource "aws_ebs_volume" "encrypted" {
|
|
57
|
+
availability_zone = data.aws_availability_zones.azs.names[0]
|
|
58
|
+
size = 40
|
|
59
|
+
encrypted = true
|
|
60
|
+
kms_key_id = aws_kms_key.ebs.arn
|
|
61
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Vendored for TF036 (chant #2288) from https://github.com/bridgecrewio/terragoat
|
|
2
|
+
# Path: terraform/aws/ec2.tf
|
|
3
|
+
# Commit: 729f8da62c6a85ce4af5ad3d123de97776d954c4
|
|
4
|
+
# Licence: Apache-2.0, https://github.com/bridgecrewio/terragoat/blob/729f8da62c6a85ce4af5ad3d123de97776d954c4/LICENSE
|
|
5
|
+
# Excerpt: lines 34-51, unmodified.
|
|
6
|
+
#
|
|
7
|
+
# TF036: one info, Not determined. The volume does not set encrypted, so whether it is encrypted depends on the
|
|
8
|
+
# Region's EBS encryption by default. The commented-out line in the source records why TerraGoat left
|
|
9
|
+
# encrypted = false out: "Setting this causes the volume to be recreated on apply".
|
|
10
|
+
|
|
11
|
+
resource "aws_ebs_volume" "web_host_storage" {
|
|
12
|
+
# unencrypted volume
|
|
13
|
+
availability_zone = "${var.region}a"
|
|
14
|
+
#encrypted = false # Setting this causes the volume to be recreated on apply
|
|
15
|
+
size = 1
|
|
16
|
+
tags = merge({
|
|
17
|
+
Name = "${local.resource_prefix.value}-ebs"
|
|
18
|
+
}, {
|
|
19
|
+
git_commit = "d3439f0f2af62f6fa3521e14d6c27819ef8f12e1"
|
|
20
|
+
git_file = "terraform/aws/ec2.tf"
|
|
21
|
+
git_last_modified_at = "2021-05-02 11:17:26"
|
|
22
|
+
git_last_modified_by = "nimrodkor@users.noreply.github.com"
|
|
23
|
+
git_modifiers = "nimrodkor"
|
|
24
|
+
git_org = "bridgecrewio"
|
|
25
|
+
git_repo = "terragoat"
|
|
26
|
+
yor_trace = "c5509daf-10f0-46af-9e03-41989212521d"
|
|
27
|
+
})
|
|
28
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Vendored for TF036 (chant #2288) from https://github.com/stelligent/config-lint
|
|
2
|
+
# Path: example-files/config/volumes.tf
|
|
3
|
+
# Commit: 8e87d18df9df2413a3bf3f57a3ceaf17a2140da9
|
|
4
|
+
# Licence: MIT, https://github.com/stelligent/config-lint/blob/8e87d18df9df2413a3bf3f57a3ceaf17a2140da9/LICENSE.md
|
|
5
|
+
# Excerpt: lines 9-16, unmodified.
|
|
6
|
+
#
|
|
7
|
+
# config-lint's own example files.
|
|
8
|
+
#
|
|
9
|
+
# TF036: one warning. encrypted = false.
|
|
10
|
+
#
|
|
11
|
+
# Copyright (c) 2018-2020 Stelligent
|
|
12
|
+
#
|
|
13
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
# in the Software without restriction, including without limitation the rights
|
|
16
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
# furnished to do so, subject to the following conditions:
|
|
19
|
+
#
|
|
20
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
# copies or substantial portions of the Software.
|
|
22
|
+
#
|
|
23
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
# SOFTWARE.
|
|
30
|
+
|
|
31
|
+
resource "aws_ebs_volume" "vol2" {
|
|
32
|
+
availability_zone = "us-west-2a"
|
|
33
|
+
size = 40
|
|
34
|
+
tags {
|
|
35
|
+
Name = "HelloWorld"
|
|
36
|
+
}
|
|
37
|
+
encrypted = false
|
|
38
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Vendored for TF037 (chant #2288) from https://github.com/lexicalunit/spellbot
|
|
2
|
+
# Path: infrastructure/app/ecr.tf
|
|
3
|
+
# Commit: 31ea539eff3df6da03195324f8bdd377210c54ec
|
|
4
|
+
# Licence: MIT, https://github.com/lexicalunit/spellbot/blob/31ea539eff3df6da03195324f8bdd377210c54ec/LICENSE.md
|
|
5
|
+
# Excerpt: lines 1-34, unmodified.
|
|
6
|
+
#
|
|
7
|
+
# TF037: silent. IMMUTABLE_WITH_EXCLUSION (provider v6) keeps SHA tags immutable and names the four moving
|
|
8
|
+
# tags that stay mutable.
|
|
9
|
+
#
|
|
10
|
+
# Copyright (c) 2026 spellbot@lexicalunit.com
|
|
11
|
+
#
|
|
12
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
# in the Software without restriction, including without limitation the rights
|
|
15
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
# furnished to do so, subject to the following conditions:
|
|
18
|
+
#
|
|
19
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
# copies or substantial portions of the Software.
|
|
21
|
+
#
|
|
22
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
# SOFTWARE.
|
|
29
|
+
|
|
30
|
+
# ECR repository for SpellBot application
|
|
31
|
+
resource "aws_ecr_repository" "spellbot" {
|
|
32
|
+
name = "spellbot-app"
|
|
33
|
+
|
|
34
|
+
# SHA-tagged images (the artifacts ECS actually pulls) are immutable. The
|
|
35
|
+
# moving aliases below are rewritten by the deploy workflow on every push
|
|
36
|
+
# and so must remain mutable.
|
|
37
|
+
image_tag_mutability = "IMMUTABLE_WITH_EXCLUSION"
|
|
38
|
+
|
|
39
|
+
image_tag_mutability_exclusion_filter {
|
|
40
|
+
filter = "stage"
|
|
41
|
+
filter_type = "WILDCARD"
|
|
42
|
+
}
|
|
43
|
+
image_tag_mutability_exclusion_filter {
|
|
44
|
+
filter = "prod"
|
|
45
|
+
filter_type = "WILDCARD"
|
|
46
|
+
}
|
|
47
|
+
image_tag_mutability_exclusion_filter {
|
|
48
|
+
filter = "latest"
|
|
49
|
+
filter_type = "WILDCARD"
|
|
50
|
+
}
|
|
51
|
+
image_tag_mutability_exclusion_filter {
|
|
52
|
+
filter = "pr-*"
|
|
53
|
+
filter_type = "WILDCARD"
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
image_scanning_configuration {
|
|
57
|
+
scan_on_push = true
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
tags = {
|
|
61
|
+
Name = "spellbot-ecr"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Vendored for TF037 (chant #2288) from https://github.com/aws-samples/sample-scribe-ai
|
|
2
|
+
# Path: iac/ecr.tf
|
|
3
|
+
# Commit: 384cb260f7e57797bc7275b72db5b2b262eee858
|
|
4
|
+
# Licence: MIT-0, https://github.com/aws-samples/sample-scribe-ai/blob/384cb260f7e57797bc7275b72db5b2b262eee858/LICENSE
|
|
5
|
+
# The whole file, unmodified.
|
|
6
|
+
#
|
|
7
|
+
# TF037: silent. Both repositories set image_tag_mutability = "IMMUTABLE".
|
|
8
|
+
|
|
9
|
+
resource "aws_ecr_repository" "main" {
|
|
10
|
+
name = var.name
|
|
11
|
+
image_tag_mutability = "IMMUTABLE"
|
|
12
|
+
force_delete = true
|
|
13
|
+
|
|
14
|
+
image_scanning_configuration {
|
|
15
|
+
scan_on_push = true
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
resource "aws_ecr_repository" "lambda" {
|
|
20
|
+
name = "${var.name}-events"
|
|
21
|
+
image_tag_mutability = "IMMUTABLE"
|
|
22
|
+
force_delete = true
|
|
23
|
+
|
|
24
|
+
image_scanning_configuration {
|
|
25
|
+
scan_on_push = true
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Vendored for TF037 (chant #2288) from https://github.com/turnerlabs/terraform-ecs-fargate
|
|
2
|
+
# Path: base/ecr.tf
|
|
3
|
+
# Commit: e51d5f3bafdaa7cb29527da979a006d0b7bb1dfb
|
|
4
|
+
# Licence: Apache-2.0, https://github.com/turnerlabs/terraform-ecs-fargate/blob/e51d5f3bafdaa7cb29527da979a006d0b7bb1dfb/LICENSE
|
|
5
|
+
# Excerpt: lines 1-18, unmodified.
|
|
6
|
+
#
|
|
7
|
+
# TF037: one info, Not determined. image_tag_mutability = var.image_tag_mutability. The variable's default is
|
|
8
|
+
# "IMMUTABLE", but a caller can override it, and TF037 does not evaluate variables.
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* ecr.tf
|
|
12
|
+
* Creates a Amazon Elastic Container Registry (ECR) for the application
|
|
13
|
+
* https://aws.amazon.com/ecr/
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
# The tag mutability setting for the repository (defaults to IMMUTABLE)
|
|
17
|
+
variable "image_tag_mutability" {
|
|
18
|
+
type = string
|
|
19
|
+
default = "IMMUTABLE"
|
|
20
|
+
description = "The tag mutability setting for the repository (defaults to IMMUTABLE)"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# create an ECR repo at the app/image level
|
|
24
|
+
resource "aws_ecr_repository" "app" {
|
|
25
|
+
name = var.app
|
|
26
|
+
image_tag_mutability = var.image_tag_mutability
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Vendored for TF037 (chant #2288) from https://github.com/outerbounds/terraform-aws-metaflow
|
|
2
|
+
# Path: ecr.tf
|
|
3
|
+
# Commit: b56935a87aa623bf9c9d91efe22c54338dcef5a3
|
|
4
|
+
# Licence: Apache-2.0, https://github.com/outerbounds/terraform-aws-metaflow/blob/b56935a87aa623bf9c9d91efe22c54338dcef5a3/LICENSE
|
|
5
|
+
# The whole file, unmodified.
|
|
6
|
+
#
|
|
7
|
+
# TF037: one error. The repository does not set image_tag_mutability, and the provider default is MUTABLE.
|
|
8
|
+
|
|
9
|
+
resource "aws_ecr_repository" "metaflow_batch_image" {
|
|
10
|
+
count = var.enable_custom_batch_container_registry ? 1 : 0
|
|
11
|
+
|
|
12
|
+
name = local.metaflow_batch_image_name
|
|
13
|
+
|
|
14
|
+
tags = var.tags
|
|
15
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Vendored for TF037 (chant #2288) from https://github.com/bridgecrewio/terragoat
|
|
2
|
+
# Path: terraform/aws/ecr.tf
|
|
3
|
+
# Commit: 729f8da62c6a85ce4af5ad3d123de97776d954c4
|
|
4
|
+
# Licence: Apache-2.0, https://github.com/bridgecrewio/terragoat/blob/729f8da62c6a85ce4af5ad3d123de97776d954c4/LICENSE
|
|
5
|
+
# Excerpt: lines 1-18, unmodified.
|
|
6
|
+
#
|
|
7
|
+
# TF037: one error. image_tag_mutability = "MUTABLE".
|
|
8
|
+
|
|
9
|
+
resource aws_ecr_repository "repository" {
|
|
10
|
+
name = "${local.resource_prefix.value}-repository"
|
|
11
|
+
image_tag_mutability = "MUTABLE"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
tags = merge({
|
|
15
|
+
Name = "${local.resource_prefix.value}-repository"
|
|
16
|
+
}, {
|
|
17
|
+
git_commit = "e6d83b21346fe85d4fe28b16c0b2f1e0662eb1d7"
|
|
18
|
+
git_file = "terraform/aws/ecr.tf"
|
|
19
|
+
git_last_modified_at = "2023-04-27 12:47:51"
|
|
20
|
+
git_last_modified_by = "nadler@paloaltonetworks.com"
|
|
21
|
+
git_modifiers = "nadler/nimrodkor"
|
|
22
|
+
git_org = "bridgecrewio"
|
|
23
|
+
git_repo = "terragoat"
|
|
24
|
+
yor_trace = "7a3ec657-fa54-4aa2-8467-5d08d6c90bc2"
|
|
25
|
+
})
|
|
26
|
+
}
|