Skip to content

Commit 07dc101

Browse files
K3ndunozaq
andauthored
feat: make audit log bucket access logs bucket name customizable (#303)
* Make audit log bucket access logs bucket name customizable * docs: run terraform-docs Co-authored-by: Kendi Paet <kendi@tavex.eu> Co-authored-by: nozaq <code@nozaq.com>
1 parent 99f0493 commit 07dc101

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ This module is composed of several submodules and each of which can be used inde
142142
| <a name="input_allow_users_to_change_password"></a> [allow\_users\_to\_change\_password](#input\_allow\_users\_to\_change\_password) | Whether to allow users to change their own password. | `bool` | no |
143143
| <a name="input_analyzer_baseline_enabled"></a> [analyzer\_baseline\_enabled](#input\_analyzer\_baseline\_enabled) | Boolean whether analyzer-baseline is enabled. | `bool` | no |
144144
| <a name="input_analyzer_name"></a> [analyzer\_name](#input\_analyzer\_name) | The name for the IAM Access Analyzer resource to be created. | `string` | no |
145+
| <a name="input_audit_log_bucket_access_logs_name"></a> [audit\_log\_bucket\_access\_logs\_name](#input\_audit\_log\_bucket\_access\_logs\_name) | The name of the S3 bucket to store various audit logs. | `string` | no |
145146
| <a name="input_audit_log_bucket_custom_policy_json"></a> [audit\_log\_bucket\_custom\_policy\_json](#input\_audit\_log\_bucket\_custom\_policy\_json) | Override policy for the audit log bucket. Allows addition of extra policies. | `string` | no |
146147
| <a name="input_audit_log_bucket_force_destroy"></a> [audit\_log\_bucket\_force\_destroy](#input\_audit\_log\_bucket\_force\_destroy) | A boolean that indicates all objects should be deleted from the audit log bucket so that the bucket can be destroyed without error. These objects are not recoverable. | `bool` | no |
147148
| <a name="input_audit_log_bucket_key_enabled"></a> [audit\_log\_bucket\_key\_enabled](#input\_audit\_log\_bucket\_key\_enabled) | Whether or not to use Amazon S3 Bucket Keys for encrypting the audit log bucket. | `bool` | no |

bucket.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module "audit_log_bucket" {
3636

3737
bucket_name = var.audit_log_bucket_name
3838
bucket_key_enabled = var.audit_log_bucket_key_enabled
39-
log_bucket_name = "${var.audit_log_bucket_name}-access-logs"
39+
log_bucket_name = var.audit_log_bucket_access_logs_name != "" ? var.audit_log_bucket_access_logs_name : "${var.audit_log_bucket_name}-access-logs"
4040
lifecycle_glacier_transition_days = var.audit_log_lifecycle_glacier_transition_days
4141
force_destroy = var.audit_log_bucket_force_destroy
4242

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ variable "audit_log_bucket_name" {
7979
type = string
8080
}
8181

82+
variable "audit_log_bucket_access_logs_name" {
83+
description = "The name of the S3 bucket to store various audit logs."
84+
type = string
85+
default = ""
86+
}
87+
8288
variable "audit_log_bucket_custom_policy_json" {
8389
description = "Override policy for the audit log bucket. Allows addition of extra policies."
8490
type = string

0 commit comments

Comments
 (0)