Skip to content

Commit d212774

Browse files
[PRMP-579] change pathing for secondary bucket
1 parent cef8935 commit d212774

File tree

5 files changed

+7
-19
lines changed

5 files changed

+7
-19
lines changed

infrastructure/cloudfront.tf

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ module "cloudfront_firewall_waf_v2" {
1010

1111
module "cloudfront-distribution-lg" {
1212
has_secondary_bucket = true
13-
secondary_bucket_domain_name = module.ndr-document-pending-review-store.bucket_domain_name
13+
secondary_bucket_domain_name = module.ndr-document-pending-review-store.bucket_regional_domain_name
1414
secondary_bucket_id = module.ndr-document-pending-review-store.bucket_id
15-
secondary_bucket_path_pattern = "/test/*"
15+
secondary_bucket_path_pattern = "/review/*"
1616
source = "./modules/cloudfront"
17-
bucket_domain_name = "${terraform.workspace}-${var.lloyd_george_bucket_name}.s3.eu-west-2.amazonaws.com"
17+
bucket_domain_name = module.ndr-lloyd-george-store.bucket_regional_domain_name
1818
bucket_id = module.ndr-lloyd-george-store.bucket_id
1919
qualifed_arn = module.edge-presign-lambda.qualified_arn
2020
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]
2121
web_acl_id = try(module.cloudfront_firewall_waf_v2[0].arn, "")
22-
# access_log_bucket = local.is_production ? "${aws_s3_bucket.access_logs[0].bucket}.s3.eu-west-2.amazonaws.com" : null
23-
# log_prefix = "cloudfront/"
2422
}

infrastructure/modules/cloudfront/main.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,6 @@ resource "aws_cloudfront_distribution" "distribution_with_secondary_bucket" {
107107
}
108108
web_acl_id = var.web_acl_id
109109

110-
# logging_config {
111-
# bucket = var.access_log_bucket
112-
# prefix = var.log_prefix
113-
# }
114110
}
115111

116112

infrastructure/modules/cloudfront/variable.tf

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,3 @@ variable "secondary_bucket_path_pattern" {
3939
type = string
4040
}
4141

42-
# variable "access_log_bucket" {
43-
# description = "Bucket to store access logs"
44-
# type = string
45-
# }
46-
#
47-
# variable "log_prefix" {
48-
# description = "Prefix to store access logs under"
49-
# type = string
50-
# }

infrastructure/modules/lambda_edge/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ module "s3_proxy_lambda" {
5858
|------|------|
5959
| [aws_iam_policy.combined_policies](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
6060
| [aws_iam_role.lambda_exec_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
61-
| [aws_iam_role.lambda_execution_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
6261
| [aws_iam_role_policy.lambda_exec_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |
6362
| [aws_iam_role_policy_attachment.default_policies](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
6463
| [aws_iam_role_policy_attachment.lambda_execution_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |

infrastructure/modules/s3/output.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@ output "s3_read_policy_document" {
2424

2525
output "s3_write_policy_document" {
2626
value = data.aws_iam_policy_document.s3_write_policy.json
27+
}
28+
29+
output "bucket_regional_domain_name" {
30+
value = aws_s3_bucket.bucket.bucket_regional_domain_name
2731
}

0 commit comments

Comments
 (0)