Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion infrastructure/terraform/modules/lambda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ output "processor_lambda_error_rate_alarm_arn" {
| Name | Description | Type | Default | Required |
| ---- | ----------- | ---- | ------- | :------: |
| <a name="input_application_log_level"></a> [application\_log\_level](#input\_application\_log\_level) | The detail level of the logs the application sends to CloudWatch | `string` | `"INFO"` | no |
| <a name="input_architecture"></a> [architecture](#input\_architecture) | The architecture of the Lambda function (e.g., x86\_64 or arm64 Graviton) | `string` | `"arm64"` | no |
| <a name="input_aws_account_id"></a> [aws\_account\_id](#input\_aws\_account\_id) | The AWS Account ID (numeric) | `string` | n/a | yes |
| <a name="input_component"></a> [component](#input\_component) | The name of the tfscaffold component | `string` | n/a | yes |
| <a name="input_default_tags"></a> [default\_tags](#input\_default\_tags) | A map of default tags to apply to all taggable resources within the component | `map(string)` | `{}` | no |
Expand Down Expand Up @@ -66,12 +67,13 @@ output "processor_lambda_error_rate_alarm_arn" {
| <a name="input_lambda_error_rate_alarm_config"></a> [lambda\_error\_rate\_alarm\_config](#input\_lambda\_error\_rate\_alarm\_config) | Object of optional CloudWatch alarm settings for the Lambda error rate alarm | <pre>object({<br/> comparison_operator = optional(string, "GreaterThanThreshold")<br/> evaluation_periods = optional(number, 1)<br/> period = optional(number, 300)<br/> threshold = optional(number, 1)<br/> actions_enabled = optional(bool, true)<br/> treat_missing_data = optional(string, "notBreaching")<br/> })</pre> | `{}` | no |
| <a name="input_lambda_throttles_alarm_config"></a> [lambda\_throttles\_alarm\_config](#input\_lambda\_throttles\_alarm\_config) | Object of optional CloudWatch alarm settings for the Lambda throttles alarm | <pre>object({<br/> comparison_operator = optional(string, "GreaterThanThreshold")<br/> evaluation_periods = optional(number, 1)<br/> period = optional(number, 300)<br/> statistic = optional(string, "Sum")<br/> threshold = optional(number, 0)<br/> actions_enabled = optional(bool, true)<br/> treat_missing_data = optional(string, "notBreaching")<br/> })</pre> | `{}` | no |
| <a name="input_layers"></a> [layers](#input\_layers) | Lambda layer arns to include | `list(any)` | `[]` | no |
| <a name="input_log_destination_arn"></a> [log\_destination\_arn](#input\_log\_destination\_arn) | Destination ARN to use for the log subscription filter | `string` | `""` | no |
| <a name="input_log_destination_arn"></a> [log\_destination\_arn](#input\_log\_destination\_arn) | Destination ARN to use for the log subscription filter to send logs to Splunk | `string` | `""` | no |
| <a name="input_log_level"></a> [log\_level](#input\_log\_level) | The log level to be used in lambda functions within the component. Any log with a lower severity than the configured value will not be logged: https://docs.python.org/3/library/logging.html#levels | `string` | `"INFO"` | no |
| <a name="input_log_retention_in_days"></a> [log\_retention\_in\_days](#input\_log\_retention\_in\_days) | The retention period in days for the Cloudwatch Logs events generated by the lambda function | `number` | n/a | yes |
| <a name="input_log_subscription_lambda_create_permission"></a> [log\_subscription\_lambda\_create\_permission](#input\_log\_subscription\_lambda\_create\_permission) | Whether to create a permission for the log forwarder. Set to false if using a generic one. | `bool` | `true` | no |
| <a name="input_log_subscription_role_arn"></a> [log\_subscription\_role\_arn](#input\_log\_subscription\_role\_arn) | The ARN of the IAM role to use for the log subscription filter | `string` | `""` | no |
| <a name="input_memory"></a> [memory](#input\_memory) | The amount of memory to apply to the created Lambda | `number` | n/a | yes |
| <a name="input_odin_log_destination_arn"></a> [odin\_log\_destination\_arn](#input\_odin\_log\_destination\_arn) | Destination ARN to use for the log subscription filter to send logs to Odin | `string` | `""` | no |
| <a name="input_package_type"></a> [package\_type](#input\_package\_type) | Lambda package type: Zip or Image | `string` | `"Zip"` | no |
| <a name="input_permission_statements"></a> [permission\_statements](#input\_permission\_statements) | Statements giving an external source permission to invoke the Lambda function | <pre>list(object({<br/> action = optional(string)<br/> principal = string<br/> source_arn = optional(string)<br/> source_account = optional(string)<br/> statement_id = string<br/> }))</pre> | `[]` | no |
| <a name="input_project"></a> [project](#input\_project) | The name of the tfscaffold project | `string` | n/a | yes |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "aws_cloudwatch_log_subscription_filter" "firehose_odin" {
count = var.send_to_firehose && var.odin_log_destination_arn != "" ? 1 : 0
name = trim(replace(aws_cloudwatch_log_group.main.name, "/", "-"), "-")
log_group_name = aws_cloudwatch_log_group.main.name
filter_pattern = var.filter_pattern
destination_arn = var.odin_log_destination_arn
role_arn = var.log_subscription_role_arn
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ resource "aws_lambda_function" "main" {
publish = true
memory_size = var.memory
timeout = var.timeout
architectures = [var.architecture]

reserved_concurrent_executions = var.reserved_concurrent_executions

Expand Down
14 changes: 13 additions & 1 deletion infrastructure/terraform/modules/lambda/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ variable "runtime" {
}
}

variable "architecture" {
type = string
description = "The architecture of the Lambda function (e.g., x86_64 or arm64 Graviton)"
default = "arm64"
}

variable "package_type" {
type = string
description = "Lambda package type: Zip or Image"
Expand Down Expand Up @@ -390,7 +396,13 @@ variable "filter_pattern" {

variable "log_destination_arn" {
type = string
description = "Destination ARN to use for the log subscription filter"
description = "Destination ARN to use for the log subscription filter to send logs to Splunk"
default = ""
}

variable "odin_log_destination_arn" {
type = string
description = "Destination ARN to use for the log subscription filter to send logs to Odin"
default = ""
}

Expand Down
23 changes: 3 additions & 20 deletions infrastructure/terraform/modules/obs-datasource/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,15 @@

## Requirements

| Name | Version |
| ---- | ------- |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9.0 |
No requirements.

## Inputs

| Name | Description | Type | Default | Required |
| ---- | ----------- | ---- | ------- | :------: |
| <a name="input_aws_account_id"></a> [aws\_account\_id](#input\_aws\_account\_id) | The AWS Account ID (numeric) | `string` | n/a | yes |
| <a name="input_component"></a> [component](#input\_component) | The name of the terraformscaffold component calling this module | `string` | n/a | yes |
| <a name="input_default_tags"></a> [default\_tags](#input\_default\_tags) | Default tag map for application to all taggable resources in the module | `map(string)` | `{}` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the terraformscaffold environment the module is called for | `string` | n/a | yes |
| <a name="input_log_group_configuration"></a> [log\_group\_configuration](#input\_log\_group\_configuration) | Configuration for filtering log groups in the link configuration. | <pre>object({<br/> filter = string<br/> })</pre> | `null` | no |
| <a name="input_metric_configuration"></a> [metric\_configuration](#input\_metric\_configuration) | Configuration for filtering metrics in the link configuration. | <pre>object({<br/> filter = string<br/> })</pre> | `null` | no |
| <a name="input_name"></a> [name](#input\_name) | A unique name to distinguish this module invocation from others within the same CSI scope | `string` | n/a | yes |
| <a name="input_oam_sink_id"></a> [oam\_sink\_id](#input\_oam\_sink\_id) | The ID of the Cloudwatch OAM sink in the appropriate observability account. | `string` | `""` | no |
| <a name="input_observability_account_id"></a> [observability\_account\_id](#input\_observability\_account\_id) | The Observability Account ID that needs access | `string` | n/a | yes |
| <a name="input_project"></a> [project](#input\_project) | The name of the terraformscaffold project calling the module | `string` | n/a | yes |
| <a name="input_region"></a> [region](#input\_region) | The AWS Region | `string` | n/a | yes |
| <a name="input_resource_types"></a> [resource\_types](#input\_resource\_types) | The resource types to include in the OAM link. | `list(string)` | <pre>[<br/> "AWS::CloudWatch::Metric",<br/> "AWS::Logs::LogGroup"<br/>]</pre> | no |
No inputs.

## Outputs

| Name | Description |
| ---- | ----------- |
| <a name="output_log_subscription_role_arn"></a> [log\_subscription\_role\_arn](#output\_log\_subscription\_role\_arn) | The ARN of the log subscription IAM role. |
No outputs.

<!-- vale on -->
<!-- markdownlint-enable -->
Expand Down

This file was deleted.

23 changes: 0 additions & 23 deletions infrastructure/terraform/modules/obs-datasource/locals.tf

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions infrastructure/terraform/modules/obs-datasource/outputs.tf

This file was deleted.

82 changes: 0 additions & 82 deletions infrastructure/terraform/modules/obs-datasource/variables.tf

This file was deleted.

9 changes: 0 additions & 9 deletions infrastructure/terraform/modules/obs-datasource/versions.tf

This file was deleted.

Loading