Skip to content

Commit 6e6ae93

Browse files
[PRMP-876] Create a new S3 bucket for the Review feature (#511)
1 parent 36cc5e8 commit 6e6ae93

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

infrastructure/backups.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ resource "aws_backup_selection" "s3_continuous_backup" {
2626
resources = [
2727
module.ndr-document-store.bucket_arn,
2828
module.ndr-lloyd-george-store.bucket_arn,
29-
module.statistical-reports-store.bucket_arn
29+
module.statistical-reports-store.bucket_arn,
30+
module.ndr-document-pending-review-store.bucket_arn
3031
]
3132
}
3233

infrastructure/buckets.tf

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,24 @@ data "aws_s3_object" "truststore_ext_cert" {
157157
key = var.ca_pem_filename
158158
}
159159

160+
module "ndr-document-pending-review-store" {
161+
source = "./modules/s3"
162+
access_logs_enabled = local.is_production
163+
access_logs_bucket_id = local.access_logs_bucket_id
164+
bucket_name = var.document_pending_review_bucket_name
165+
environment = var.environment
166+
owner = var.owner
167+
enable_bucket_versioning = true
168+
force_destroy = local.is_force_destroy
169+
enable_cors_configuration = true
170+
cors_rules = [
171+
{
172+
allowed_methods = ["GET"]
173+
allowed_origins = [contains(["prod"], terraform.workspace) ? "https://${var.domain}" : "https://${terraform.workspace}.${var.domain}"]
174+
}
175+
]
176+
}
177+
160178
# Lifecycle Rules
161179
resource "aws_s3_bucket_lifecycle_configuration" "lg-lifecycle-rules" {
162180
bucket = module.ndr-lloyd-george-store.bucket_id
@@ -250,6 +268,19 @@ resource "aws_s3_bucket_lifecycle_configuration" "pdm_document_store" {
250268
}
251269
}
252270

271+
resource "aws_s3_bucket_lifecycle_configuration" "ndr_document_pending_review_store" {
272+
bucket = module.ndr-document-pending-review-store.bucket_id
273+
rule {
274+
id = "default-to-intelligent-tiering"
275+
status = "Enabled"
276+
transition {
277+
storage_class = "INTELLIGENT_TIERING"
278+
days = 0
279+
}
280+
filter {}
281+
}
282+
}
283+
253284
# Logging Buckets
254285
resource "aws_s3_bucket" "access_logs" {
255286
count = local.access_logs_count

infrastructure/variable.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ variable "ca_pem_filename" {
8686
default = "ndr-truststore.pem"
8787
}
8888

89+
variable "document_pending_review_bucket_name" {
90+
type = string
91+
description = "The S3 bucket name to store documents pending review"
92+
default = "document-pending-review-store"
93+
}
94+
95+
8996
# DynamoDB Table Variables
9097

9198
variable "pdm_dynamodb_table_name" {

0 commit comments

Comments
 (0)