Skip to content

Commit e0fe4b5

Browse files
[PRMP-579] add logging config block
1 parent 997135d commit e0fe4b5

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

infrastructure/modules/cloudfront/main.tf

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ resource "aws_cloudfront_distribution" "distribution" {
4848
}
4949
}
5050
web_acl_id = var.web_acl_id
51+
52+
dynamic "logging_config" {
53+
for_each = var.log_bucket_id != "" ? [1] : []
54+
content {
55+
bucket = var.log_bucket_id
56+
prefix = "cloudfront"
57+
}
58+
}
5159
}
5260

5361
resource "aws_cloudfront_distribution" "distribution_with_secondary_bucket" {
@@ -102,8 +110,7 @@ resource "aws_cloudfront_distribution" "distribution_with_secondary_bucket" {
102110
for_each = var.log_bucket_id != "" ? [1] : []
103111
content {
104112
bucket = var.log_bucket_id
105-
# this might break it as path pattern is in format /pattern/
106-
prefix = var.secondary_bucket_path_pattern
113+
prefix = "cloudfront"
107114
}
108115
}
109116

infrastructure/modules/gateway/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ module "api_gateway_resource" {
7676
| <a name="input_http_methods"></a> [http\_methods](#input\_http\_methods) | List of allowed HTTP methods for the resource (e.g., ["GET", "POST"]). | `list(string)` | n/a | yes |
7777
| <a name="input_origin"></a> [origin](#input\_origin) | Allowed origin for CORS requests (e.g., '*', or specific domain). | `string` | `"'*'"` | no |
7878
| <a name="input_parent_id"></a> [parent\_id](#input\_parent\_id) | ID of the parent API Gateway resource (e.g., root path or another nested resource). | `string` | n/a | yes |
79+
| <a name="input_request_parameters"></a> [request\_parameters](#input\_request\_parameters) | Request parameters for the API Gateway method. | `map(string)` | `{}` | no |
7980
| <a name="input_require_credentials"></a> [require\_credentials](#input\_require\_credentials) | Sets the value of 'Access-Control-Allow-Credentials' which controls whether auth cookies are needed. | `bool` | n/a | yes |
8081
## Outputs
8182

infrastructure/modules/lambda_edge/README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,21 @@ module "s3_proxy_lambda" {
5656

5757
| Name | Type |
5858
|------|------|
59-
| [aws_iam_policy.combined_policies](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
6059
| [aws_iam_role.lambda_exec_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
6160
| [aws_iam_role_policy.lambda_exec_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |
62-
| [aws_iam_role_policy_attachment.default_policies](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
6361
| [aws_iam_role_policy_attachment.lambda_execution_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
6462
| [aws_lambda_function.lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) | resource |
6563
| [archive_file.lambda](https://registry.terraform.io/providers/hashicorp/archive/latest/docs/data-sources/file) | data source |
6664
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
6765
| [aws_iam_policy_document.assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
6866
| [aws_iam_policy_document.lambda_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
69-
| [aws_iam_policy_document.merged_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
7067
## Inputs
7168

7269
| Name | Description | Type | Default | Required |
7370
|------|-------------|------|---------|:--------:|
74-
| <a name="input_bucket_name"></a> [bucket\_name](#input\_bucket\_name) | The name of the S3 bucket the Lambda will proxy requests to. | `string` | n/a | yes |
75-
| <a name="input_default_policies"></a> [default\_policies](#input\_default\_policies) | List of default IAM policy ARNs to attach to the Lambda execution role. | `list(string)` | <pre>[<br/> "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"<br/>]</pre> | no |
71+
| <a name="input_bucket_names"></a> [bucket\_names](#input\_bucket\_names) | The name of the S3 buckets the Lambda will proxy requests to. | `list(string)` | n/a | yes |
7672
| <a name="input_handler"></a> [handler](#input\_handler) | Handler function in the code package (e.g., 'index.handler'). | `string` | n/a | yes |
77-
| <a name="input_iam_role_policy_documents"></a> [iam\_role\_policy\_documents](#input\_iam\_role\_policy\_documents) | List of IAM policy document ARNs to attach to the Lambda execution role. | `list(string)` | `[]` | no |
73+
| <a name="input_iam_role_policies"></a> [iam\_role\_policies](#input\_iam\_role\_policies) | List of IAM policy ARNs or JSON documents to attach to the Lambda execution role. | `list(string)` | n/a | yes |
7874
| <a name="input_lambda_ephemeral_storage"></a> [lambda\_ephemeral\_storage](#input\_lambda\_ephemeral\_storage) | Amount of ephemeral storage (in MB) allocated to the Lambda function. | `number` | `512` | no |
7975
| <a name="input_memory_size"></a> [memory\_size](#input\_memory\_size) | Amount of memory (in MB) to allocate to the Lambda function. | `number` | `128` | no |
8076
| <a name="input_name"></a> [name](#input\_name) | Unique name for the Lambda function. | `string` | n/a | yes |

0 commit comments

Comments
 (0)