Skip to content

Commit 9df2e8b

Browse files
datadog-lambda-forwarder: if s3_buckets not set, module fails (cloudposse/terraform-aws-components#581)
Co-authored-by: cloudpossebot <[email protected]>
1 parent 3d47065 commit 9df2e8b

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ components:
6464
|------|--------|---------|
6565
| <a name="module_datadog-integration"></a> [datadog-integration](#module\_datadog-integration) | cloudposse/stack-config/yaml//modules/remote-state | 1.3.1 |
6666
| <a name="module_datadog_configuration"></a> [datadog\_configuration](#module\_datadog\_configuration) | ../datadog-configuration/modules/datadog_keys | n/a |
67-
| <a name="module_datadog_lambda_forwarder"></a> [datadog\_lambda\_forwarder](#module\_datadog\_lambda\_forwarder) | cloudposse/datadog-lambda-forwarder/aws | 1.1.0 |
67+
| <a name="module_datadog_lambda_forwarder"></a> [datadog\_lambda\_forwarder](#module\_datadog\_lambda\_forwarder) | cloudposse/datadog-lambda-forwarder/aws | 1.2.0 |
6868
| <a name="module_iam_roles"></a> [iam\_roles](#module\_iam\_roles) | ../account-map/modules/iam-roles | n/a |
6969
| <a name="module_log_group_prefix"></a> [log\_group\_prefix](#module\_log\_group\_prefix) | cloudposse/label/null | 0.25.0 |
7070
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |
@@ -129,7 +129,8 @@ components:
129129
| <a name="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
130130
| <a name="input_region"></a> [region](#input\_region) | AWS Region | `string` | n/a | yes |
131131
| <a name="input_s3_bucket_kms_arns"></a> [s3\_bucket\_kms\_arns](#input\_s3\_bucket\_kms\_arns) | List of KMS key ARNs for s3 bucket encryption | `list(string)` | `[]` | no |
132-
| <a name="input_s3_buckets"></a> [s3\_buckets](#input\_s3\_buckets) | The names and ARNs of S3 buckets to forward logs to Datadog | `list(string)` | `null` | no |
132+
| <a name="input_s3_buckets"></a> [s3\_buckets](#input\_s3\_buckets) | The names of S3 buckets to forward logs to Datadog | `list(string)` | `[]` | no |
133+
| <a name="input_s3_buckets_with_prefixes"></a> [s3\_buckets\_with\_prefixes](#input\_s3\_buckets\_with\_prefixes) | The names S3 buckets and prefix to forward logs to Datadog | `map(object({ bucket_name : string, bucket_prefix : string }))` | `{}` | no |
133134
| <a name="input_security_group_ids"></a> [security\_group\_ids](#input\_security\_group\_ids) | List of security group IDs to use when the Lambda Function runs in a VPC | `list(string)` | `null` | no |
134135
| <a name="input_stage"></a> [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
135136
| <a name="input_subnet_ids"></a> [subnet\_ids](#input\_subnet\_ids) | List of subnet IDs to use when deploying the Lambda Function in a VPC | `list(string)` | `null` | no |

src/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module "log_group_prefix" {
4040

4141
module "datadog_lambda_forwarder" {
4242
source = "cloudposse/datadog-lambda-forwarder/aws"
43-
version = "1.1.0"
43+
version = "1.2.0"
4444

4545
cloudwatch_forwarder_log_groups = local.cloudwatch_forwarder_log_groups
4646
dd_api_key_kms_ciphertext_blob = var.dd_api_key_kms_ciphertext_blob
@@ -72,6 +72,7 @@ module "datadog_lambda_forwarder" {
7272
lambda_runtime = var.lambda_runtime
7373
s3_bucket_kms_arns = var.s3_bucket_kms_arns
7474
s3_buckets = var.s3_buckets
75+
s3_buckets_with_prefixes = var.s3_buckets_with_prefixes
7576
security_group_ids = var.security_group_ids
7677
subnet_ids = var.subnet_ids
7778
tracing_config_mode = var.tracing_config_mode

src/variables.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,14 @@ variable "kms_key_id" {
9090

9191
variable "s3_buckets" {
9292
type = list(string)
93-
description = "The names and ARNs of S3 buckets to forward logs to Datadog"
94-
default = null
93+
description = "The names of S3 buckets to forward logs to Datadog"
94+
default = []
95+
}
96+
97+
variable "s3_buckets_with_prefixes" {
98+
type = map(object({ bucket_name : string, bucket_prefix : string }))
99+
description = "The names S3 buckets and prefix to forward logs to Datadog"
100+
default = {}
95101
}
96102

97103
variable "s3_bucket_kms_arns" {

0 commit comments

Comments
 (0)