diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ee346f..8c817f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -350,3 +350,7 @@ * 2.5.5 -- 2024-02-26 - cloudtrail - add filter_path of cloudtrail/ for notification + +* 2.5.6 -- 2024-03-08 + - cloudtrail + - add variable create_cloudtrail (default: true) to be used for the org cloudtrail old setup diff --git a/cloudtrail/README.md b/cloudtrail/README.md index a56e7c4..e6fb38f 100644 --- a/cloudtrail/README.md +++ b/cloudtrail/README.md @@ -443,6 +443,7 @@ No modules. | [additional\_sqs\_names](#input\_additional\_sqs\_names) | List of additional SQS queues to create and subscribe to the SNS topic (if enabled) | `list(string)` | `[]` | no | | [cloudtrail\_bucket\_prefix](#input\_cloudtrail\_bucket\_prefix) | Access log bucket prefix, to which the bucket name will be appended to make the target\_prefix | `string` | `"cloudtrail"` | no | | [component\_tags](#input\_component\_tags) | Additional tags for Components (s3, kms, ddb) | `map(map(string))` |
{
"ddb": {},
"kms": {},
"s3": {}
} | no |
+| [create\_cloudtrail](#input\_create\_cloudtrail) | Flag to enable or disable creation of cloudtrail | `bool` | `true` | no |
| [enable\_cloudwatch\_logs](#input\_enable\_cloudwatch\_logs) | Enable CloudWatch Logs for this CloudTrail | `bool` | `true` | no |
| [enable\_organization](#input\_enable\_organization) | Enable CloudTrail as an organization trail. This will only work in the organization master account | `bool` | `false` | no |
| [enable\_s3\_sns](#input\_enable\_s3\_sns) | Flag to enable or disable the creation of SNS for the Cloudtrail S3 bucket | `bool` | `false` | no |
diff --git a/cloudtrail/cloudtrail.tf b/cloudtrail/cloudtrail.tf
index 75fea28..5c908ad 100644
--- a/cloudtrail/cloudtrail.tf
+++ b/cloudtrail/cloudtrail.tf
@@ -1,4 +1,5 @@
resource "aws_cloudtrail" "this" {
+ count = var.create_cloudtrail ? 1 : 0
name = local.name
s3_bucket_name = aws_s3_bucket.this.id
s3_key_prefix = var.cloudtrail_bucket_prefix
diff --git a/cloudtrail/variables.tf b/cloudtrail/variables.tf
index c74214f..b48fb76 100644
--- a/cloudtrail/variables.tf
+++ b/cloudtrail/variables.tf
@@ -113,3 +113,9 @@ variable "enable_cloudwatch_logs" {
type = bool
default = true
}
+
+variable "create_cloudtrail" {
+ description = "Flag to enable or disable creation of cloudtrail"
+ type = bool
+ default = true
+}
diff --git a/common/version.tf b/common/version.tf
index 241a4b7..e28e2e8 100644
--- a/common/version.tf
+++ b/common/version.tf
@@ -1,3 +1,3 @@
locals {
- _module_version = "2.5.5"
+ _module_version = "2.5.6"
}