Skip to content

Commit 040d9b2

Browse files
[PRMP-579] address PR comments
1 parent d212774 commit 040d9b2

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
lines changed

infrastructure/buckets.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ module "ndr-document-pending-review-store" {
149149
source = "./modules/s3"
150150
access_logs_enabled = local.is_production
151151
access_logs_bucket_id = local.access_logs_bucket_id
152-
bucket_name = var.document_review_bucket_name
152+
bucket_name = var.document_pending_review_bucket_name
153153
environment = var.environment
154154
owner = var.owner
155155
enable_bucket_versioning = true
@@ -265,7 +265,7 @@ resource "aws_s3_bucket_lifecycle_configuration" "pdm_document_store" {
265265
}
266266
}
267267

268-
resource "aws_s3_bucket_lifecycle_configuration" "ndr-document_pending_review" {
268+
resource "aws_s3_bucket_lifecycle_configuration" "ndr_document_pending_review-store" {
269269
bucket = module.ndr-document-pending-review-store.bucket_id
270270
rule {
271271
id = "default-to-intelligent-tiering"

infrastructure/cloudfront.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ module "cloudfront_firewall_waf_v2" {
99
}
1010

1111
module "cloudfront-distribution-lg" {
12-
has_secondary_bucket = true
13-
secondary_bucket_domain_name = module.ndr-document-pending-review-store.bucket_regional_domain_name
14-
secondary_bucket_id = module.ndr-document-pending-review-store.bucket_id
15-
secondary_bucket_path_pattern = "/review/*"
1612
source = "./modules/cloudfront"
1713
bucket_domain_name = module.ndr-lloyd-george-store.bucket_regional_domain_name
1814
bucket_id = module.ndr-lloyd-george-store.bucket_id
1915
qualifed_arn = module.edge-presign-lambda.qualified_arn
2016
depends_on = [module.edge-presign-lambda.qualified_arn, module.ndr-lloyd-george-store.bucket_id, module.ndr-lloyd-george-store.bucket_domain_name, module.ndr-document-pending-review-store.bucket_id, module.ndr-document-pending-review-store.bucket_domain_name]
2117
web_acl_id = try(module.cloudfront_firewall_waf_v2[0].arn, "")
18+
has_secondary_bucket = true
19+
secondary_bucket_domain_name = module.ndr-document-pending-review-store.bucket_regional_domain_name
20+
secondary_bucket_id = module.ndr-document-pending-review-store.bucket_id
21+
secondary_bucket_path_pattern = "/review/*"
2222
}

infrastructure/modules/cloudfront/main.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ resource "aws_cloudfront_origin_access_control" "cloudfront_s3_oac" {
1212
}
1313

1414
resource "aws_cloudfront_distribution" "distribution" {
15-
count = var.has_secondary_bucket ? 0 : 1
15+
count = var.has_secondary_bucket ? 0 : 1
16+
price_class = "PriceClass_100"
17+
1618
origin {
1719
domain_name = var.bucket_domain_name
1820
origin_id = var.bucket_id
@@ -52,6 +54,7 @@ resource "aws_cloudfront_distribution" "distribution_with_secondary_bucket" {
5254
count = var.has_secondary_bucket ? 1 : 0
5355
enabled = true
5456
is_ipv6_enabled = true
57+
price_class = "PriceClass_100"
5558

5659
origin {
5760
domain_name = var.bucket_domain_name

infrastructure/modules/cloudfront/variable.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ variable "web_acl_id" {
2020
}
2121

2222
variable "has_secondary_bucket" {
23-
description = "Whether distribution is associated with a secondary buckets"
23+
description = "Whether distribution is associated with a secondary bucket"
2424
type = bool
2525
}
2626

2727
variable "secondary_bucket_id" {
28-
description = "Secondary bucket IDs"
28+
description = "Secondary bucket ID"
2929
type = string
3030
}
3131

3232
variable "secondary_bucket_domain_name" {
33-
description = "Secondary bucket domain names"
33+
description = "Secondary bucket domain name"
3434
type = string
3535
}
3636

3737
variable "secondary_bucket_path_pattern" {
38-
description = "Path patter for secondary bucket"
38+
description = "Path pattern for secondary bucket"
3939
type = string
4040
}
4141

infrastructure/modules/s3/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ module "s3_bucket" {
101101
| <a name="output_bucket_arn"></a> [bucket\_arn](#output\_bucket\_arn) | n/a |
102102
| <a name="output_bucket_domain_name"></a> [bucket\_domain\_name](#output\_bucket\_domain\_name) | n/a |
103103
| <a name="output_bucket_id"></a> [bucket\_id](#output\_bucket\_id) | n/a |
104+
| <a name="output_bucket_regional_domain_name"></a> [bucket\_regional\_domain\_name](#output\_bucket\_regional\_domain\_name) | n/a |
104105
| <a name="output_s3_list_object_policy"></a> [s3\_list\_object\_policy](#output\_s3\_list\_object\_policy) | n/a |
105106
| <a name="output_s3_object_access_policy"></a> [s3\_object\_access\_policy](#output\_s3\_object\_access\_policy) | n/a |
106107
| <a name="output_s3_read_policy_document"></a> [s3\_read\_policy\_document](#output\_s3\_read\_policy\_document) | n/a |

infrastructure/variable.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ variable "ca_pem_filename" {
8181
default = "ndr-truststore.pem"
8282
}
8383

84-
variable "document_review_bucket_name" {
84+
variable "document_pending_review_bucket_name" {
8585
type = string
8686
description = "The S3 bucket name to store documents pending review"
8787
default = "document-pending-review-store"

0 commit comments

Comments
 (0)