Skip to content

Commit cc3fbb5

Browse files
committed
CCM-8585: use shared s3 module
1 parent f0b0eb7 commit cc3fbb5

File tree

2 files changed

+68
-77
lines changed

2 files changed

+68
-77
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
module "s3bucket_pdf_template_scan" {
2+
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket?ref=v1.0.8"
3+
4+
name = "scan"
5+
6+
aws_account_id = var.aws_account_id
7+
region = var.region
8+
project = var.project
9+
environment = var.environment
10+
component = var.component
11+
12+
kms_key_arn = aws_kms_key.s3.arn
13+
14+
# lifecycle_rules = [
15+
# {
16+
# enabled = true
17+
18+
# noncurrent_version_transition = [
19+
# {
20+
# noncurrent_days = "30"
21+
# storage_class = "STANDARD_IA"
22+
# }
23+
# ]
24+
25+
# noncurrent_version_expiration = {
26+
# noncurrent_days = "90"
27+
# }
28+
29+
# abort_incomplete_multipart_upload = {
30+
# days = "1"
31+
# }
32+
# }
33+
# ]
34+
35+
notification_events = {
36+
eventbridge = true
37+
}
38+
39+
policy_documents = [
40+
data.aws_iam_policy_document.s3bucket_pdf_template_scan.json
41+
]
42+
43+
default_tags = {
44+
Name = "Quarantine for files pending virus scan"
45+
}
46+
}
47+
48+
data "aws_iam_policy_document" "s3bucket_pdf_template_scan" {
49+
statement {
50+
effect = "Deny"
51+
actions = ["s3:*"]
52+
resources = [
53+
aws_s3_bucket.pdf_template_scan.arn,
54+
"${aws_s3_bucket.pdf_template_scan.arn}/*",
55+
]
56+
principals {
57+
type = "AWS"
58+
identifiers = ["*"]
59+
}
60+
condition {
61+
test = "Bool"
62+
variable = "aws:SecureTransport"
63+
values = [
64+
false
65+
]
66+
}
67+
}
68+
}

infrastructure/terraform/modules/backend-api/s3_bucket_pdf_template_scan.tf

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)