Skip to content

Commit

Permalink
fix(cloudwatch_metrics): add output_format variable
Browse files Browse the repository at this point in the history
This can be useful for testing alternate formats.
  • Loading branch information
jta committed Aug 17, 2023
1 parent ac005f4 commit d4e1aee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/cloudwatch_metrics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ No modules.
| <a name="input_include_filters"></a> [include\_filters](#input\_include\_filters) | Namespaces to include. Mutually exclusive with exclude\_filters. | `set(string)` | `[]` | no |
| <a name="input_kinesis_firehose"></a> [kinesis\_firehose](#input\_kinesis\_firehose) | Observe Kinesis Firehose module | <pre>object({<br> firehose_delivery_stream = object({ arn = string })<br> firehose_iam_policy = object({ arn = string })<br> })</pre> | n/a | yes |
| <a name="input_name"></a> [name](#input\_name) | Name of Cloudwatch Metrics Stream and CloudFormation stack | `string` | `"observe-cwmetricsstream"` | no |
| <a name="input_output_format"></a> [output\_format](#input\_output\_format) | Output format for the stream | `string` | `"json"` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |

## Outputs
Expand Down
2 changes: 1 addition & 1 deletion modules/cloudwatch_metrics/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ resource "aws_cloudwatch_metric_stream" "main" {
name = var.name
role_arn = local.iam_role_arn
firehose_arn = var.kinesis_firehose.firehose_delivery_stream.arn
output_format = "json"
output_format = var.output_format
tags = var.tags

dynamic "include_filter" {
Expand Down
7 changes: 7 additions & 0 deletions modules/cloudwatch_metrics/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,10 @@ variable "tags" {
nullable = false
default = {}
}

variable "output_format" {
description = "Output format for the stream"
type = string
nullable = false
default = "json"
}

0 comments on commit d4e1aee

Please sign in to comment.