Skip to content

Commit fae9031

Browse files
committed
Updated sumo and aws tf provider for kinesis firehose for logs
1 parent fec629b commit fae9031

File tree

8 files changed

+217
-24
lines changed

8 files changed

+217
-24
lines changed

aws/kinesisfirehoseforlogs/README.md

Lines changed: 56 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,74 @@ This module is used to create the SumoLogic AWS Kinesis Firehose for Logs source
1111

1212
| Name | Version |
1313
|------|---------|
14-
| terraform | >= 0.13.0 |
15-
| aws | >= 3.42.0 |
16-
| random | >= 3.1.0 |
17-
| sumologic | >= 2.9.0 |
14+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
15+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.16.2, < 6.0.0 |
16+
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.1.0 |
17+
| <a name="requirement_sumologic"></a> [sumologic](#requirement\_sumologic) | >= 2.28.3, < 3.0.0 |
1818

1919
## Providers
2020

2121
| Name | Version |
2222
|------|---------|
23-
| aws | >= 3.42.0 |
24-
| random | >= 3.1.0 |
25-
| sumologic | >= 2.9.0 |
23+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.16.2, < 6.0.0 |
24+
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.1.0 |
25+
| <a name="provider_sumologic"></a> [sumologic](#provider\_sumologic) | >= 2.28.3, < 3.0.0 |
26+
27+
## Modules
28+
29+
No modules.
30+
31+
## Resources
32+
33+
| Name | Type |
34+
|------|------|
35+
| [aws_cloudwatch_log_group.log_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |
36+
| [aws_cloudwatch_log_stream.http_log_stream](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_stream) | resource |
37+
| [aws_cloudwatch_log_stream.s3_log_stream](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_stream) | resource |
38+
| [aws_cloudwatch_log_subscription_filter.delivery_stream_subscription](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_subscription_filter) | resource |
39+
| [aws_iam_policy.firehose_delivery_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
40+
| [aws_iam_policy.firehose_s3_upload_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
41+
| [aws_iam_policy.logs_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
42+
| [aws_iam_role.firehose_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
43+
| [aws_iam_role.logs_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
44+
| [aws_iam_role_policy_attachment.firehose_policy_attach](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
45+
| [aws_iam_role_policy_attachment.firehose_s3_policy_attach](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
46+
| [aws_iam_role_policy_attachment.logs_policy_attach](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
47+
| [aws_kinesis_firehose_delivery_stream.logs_delivery_stream](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kinesis_firehose_delivery_stream) | resource |
48+
| [aws_s3_bucket.s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |
49+
| [aws_s3_bucket_public_access_block.s3_bucket_access_block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_public_access_block) | resource |
50+
| [aws_serverlessapplicationrepository_cloudformation_stack.auto_enable_logs_subscription](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/serverlessapplicationrepository_cloudformation_stack) | resource |
51+
| [random_string.aws_random](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |
52+
| [sumologic_collector.collector](https://registry.terraform.io/providers/SumoLogic/sumologic/latest/docs/resources/collector) | resource |
53+
| [sumologic_http_source.source](https://registry.terraform.io/providers/SumoLogic/sumologic/latest/docs/resources/http_source) | resource |
54+
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
55+
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |
56+
| [aws_serverlessapplicationrepository_application.app](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/serverlessapplicationrepository_application) | data source |
57+
| [sumologic_caller_identity.current](https://registry.terraform.io/providers/SumoLogic/sumologic/latest/docs/data-sources/caller_identity) | data source |
2658

2759
## Inputs
2860

2961
| Name | Description | Type | Default | Required |
3062
|------|-------------|------|---------|:--------:|
31-
| auto\_enable\_logs\_subscription | New - Automatically subscribes new log groups to send logs to Sumo Logic.<br> Existing - Automatically subscribes existing log groups to send logs to Sumo Logic.<br> Both - Automatically subscribes new and existing log groups.<br> None - Skips Automatic subscription. | `string` | `"Both"` | no |
32-
| auto\_enable\_logs\_subscription\_options | filter - Enter regex for matching logGroups. Regex will check for the name. Visit https://help.sumologic.com/03Send-Data/Collect-from-Other-Data-Sources/Auto-Subscribe_AWS_Log_Groups_to_a_Lambda_Function#Configuring_parameters | <pre>object({<br> filter = string<br> })</pre> | <pre>{<br> "filter": "lambda"<br>}</pre> | no |
33-
| bucket\_details | Provide details for the AWS S3 bucket. If not provided, existing will be used. | <pre>object({<br> bucket_name = string<br> force_destroy_bucket = bool<br> })</pre> | <pre>{<br> "bucket_name": "sumologic-kinesis-firehose-logs-random-id",<br> "force_destroy_bucket": true<br>}</pre> | no |
34-
| collector\_details | Provide details for the Sumo Logic collector. If not provided, then defaults will be used. | <pre>object({<br> collector_name = string<br> description = string<br> fields = map(string)<br> })</pre> | <pre>{<br> "collector_name": "SumoLogic Kinesis Firehose for Logs Collector <Random ID>",<br> "description": "This collector is created using Sumo Logic terraform AWS Kinesis Firehose for logs module to collect AWS cloudwatch logs.",<br> "fields": {}<br>}</pre> | no |
35-
| create\_bucket | Provide "true" if you would like to create AWS S3 bucket to store logs. Provide "bucket\_details" if set to "false". | `bool` | `true` | no |
36-
| create\_collector | Provide "true" if you would like to create the Sumo Logic Collector. | `bool` | n/a | yes |
37-
| source\_details | Provide details for the Sumo Logic Kinesis Firehose for Logs source. If not provided, then defaults will be used. | <pre>object({<br> source_name = string<br> source_category = string<br> collector_id = string<br> description = string<br> fields = map(string)<br> })</pre> | <pre>{<br> "collector_id": "",<br> "description": "This source is created using Sumo Logic terraform AWS Kinesis Firehose for logs module to collect AWS Cloudwatch logs.",<br> "fields": {},<br> "source_category": "Labs/aws/cloudwatch/logs",<br> "source_name": "Kinesis Firehose for Logs Source"<br>}</pre> | no |
63+
| <a name="input_app_semantic_version"></a> [app\_semantic\_version](#input\_app\_semantic\_version) | Provide the latest version of Serverless Application Repository 'sumologic-loggroup-connector'. | `string` | `"1.0.7"` | no |
64+
| <a name="input_auto_enable_logs_subscription"></a> [auto\_enable\_logs\_subscription](#input\_auto\_enable\_logs\_subscription) | New - Automatically subscribes new log groups to send logs to Sumo Logic.<br> Existing - Automatically subscribes existing log groups to send logs to Sumo Logic.<br> Both - Automatically subscribes new and existing log groups.<br> None - Skips Automatic subscription. | `string` | `"Both"` | no |
65+
| <a name="input_auto_enable_logs_subscription_options"></a> [auto\_enable\_logs\_subscription\_options](#input\_auto\_enable\_logs\_subscription\_options) | filter - Enter regex for matching logGroups. Regex will check for the name. Visit https://help.sumologic.com/03Send-Data/Collect-from-Other-Data-Sources/Auto-Subscribe_AWS_Log_Groups_to_a_Lambda_Function#Configuring_parameters | <pre>object({<br> filter = string<br> })</pre> | <pre>{<br> "filter": "lambda"<br>}</pre> | no |
66+
| <a name="input_bucket_details"></a> [bucket\_details](#input\_bucket\_details) | Provide details for the AWS S3 bucket. If not provided, existing will be used. | <pre>object({<br> bucket_name = string<br> force_destroy_bucket = bool<br> })</pre> | <pre>{<br> "bucket_name": "sumologic-kinesis-firehose-logs-random-id",<br> "force_destroy_bucket": true<br>}</pre> | no |
67+
| <a name="input_collector_details"></a> [collector\_details](#input\_collector\_details) | Provide details for the Sumo Logic collector. If not provided, then defaults will be used. | <pre>object({<br> collector_name = string<br> description = string<br> fields = map(string)<br> })</pre> | <pre>{<br> "collector_name": "SumoLogic Kinesis Firehose for Logs Collector <Random ID>",<br> "description": "This collector is created using Sumo Logic terraform AWS Kinesis Firehose for logs module to collect AWS cloudwatch logs.",<br> "fields": {}<br>}</pre> | no |
68+
| <a name="input_create_bucket"></a> [create\_bucket](#input\_create\_bucket) | Provide "true" if you would like to create AWS S3 bucket to store logs. Provide "bucket\_details" if set to "false". | `bool` | `true` | no |
69+
| <a name="input_create_collector"></a> [create\_collector](#input\_create\_collector) | Provide "true" if you would like to create the Sumo Logic Collector. | `bool` | n/a | yes |
70+
| <a name="input_source_details"></a> [source\_details](#input\_source\_details) | Provide details for the Sumo Logic Kinesis Firehose for Logs source. If not provided, then defaults will be used. | <pre>object({<br> source_name = string<br> source_category = string<br> collector_id = string<br> description = string<br> fields = map(string)<br> })</pre> | <pre>{<br> "collector_id": "",<br> "description": "This source is created using Sumo Logic terraform AWS Kinesis Firehose for logs module to collect AWS Cloudwatch logs.",<br> "fields": {},<br> "source_category": "Labs/aws/cloudwatch/logs",<br> "source_name": "Kinesis Firehose for Logs Source"<br>}</pre> | no |
3871

3972
## Outputs
4073

4174
| Name | Description |
4275
|------|-------------|
43-
| aws\_cloudwatch\_log\_group | AWS Log group created to attach to delivery stream. |
44-
| aws\_cloudwatch\_log\_stream | AWS Log stream created to attach to log group. |
45-
| aws\_iam\_role | AWS IAM role with permission to setup kinesis firehose logs. |
46-
| aws\_kinesis\_firehose\_delivery\_stream | AWS Kinesis firehose delivery stream to send logs to Sumo Logic. |
47-
| aws\_s3\_bucket | AWS S3 Bucket name created to Store the Failed data. |
48-
| aws\_serverlessapplicationrepository\_cloudformation\_stack | AWS CloudFormation stack for Auto Enable logs subscription. |
49-
| random\_string | Random String value created. |
50-
| sumologic\_collector | Sumo Logic hosted collector. |
51-
| sumologic\_source | Sumo Logic AWS Kinesis Firehose for Logs source. |
76+
| <a name="output_aws_cloudwatch_log_group"></a> [aws\_cloudwatch\_log\_group](#output\_aws\_cloudwatch\_log\_group) | AWS Log group created to attach to delivery stream. |
77+
| <a name="output_aws_cloudwatch_log_stream"></a> [aws\_cloudwatch\_log\_stream](#output\_aws\_cloudwatch\_log\_stream) | AWS Log stream created to attach to log group. |
78+
| <a name="output_aws_iam_role"></a> [aws\_iam\_role](#output\_aws\_iam\_role) | AWS IAM role with permission to setup kinesis firehose logs. |
79+
| <a name="output_aws_kinesis_firehose_delivery_stream"></a> [aws\_kinesis\_firehose\_delivery\_stream](#output\_aws\_kinesis\_firehose\_delivery\_stream) | AWS Kinesis firehose delivery stream to send logs to Sumo Logic. |
80+
| <a name="output_aws_s3_bucket"></a> [aws\_s3\_bucket](#output\_aws\_s3\_bucket) | AWS S3 Bucket name created to Store the Failed data. |
81+
| <a name="output_aws_serverlessapplicationrepository_cloudformation_stack"></a> [aws\_serverlessapplicationrepository\_cloudformation\_stack](#output\_aws\_serverlessapplicationrepository\_cloudformation\_stack) | AWS CloudFormation stack for Auto Enable logs subscription. |
82+
| <a name="output_random_string"></a> [random\_string](#output\_random\_string) | Random String value created. |
83+
| <a name="output_sumologic_collector"></a> [sumologic\_collector](#output\_sumologic\_collector) | Sumo Logic hosted collector. |
84+
| <a name="output_sumologic_source"></a> [sumologic\_source](#output\_sumologic\_source) | Sumo Logic AWS Kinesis Firehose for Logs source. |
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Requirements
2+
3+
| Name | Version |
4+
|------|---------|
5+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
6+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.16.2, < 6.0.0 |
7+
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.1.0 |
8+
| <a name="requirement_sumologic"></a> [sumologic](#requirement\_sumologic) | >= 2.28.3, < 3.0.0 |
9+
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.11.1 |
10+
11+
## Providers
12+
13+
No providers.
14+
15+
## Modules
16+
17+
| Name | Source | Version |
18+
|------|--------|---------|
19+
| <a name="module_kinesis_firehose_for_logs_module"></a> [kinesis\_firehose\_for\_logs\_module](#module\_kinesis\_firehose\_for\_logs\_module) | SumoLogic/sumo-logic-integrations/sumologic//aws/kinesisfirehoseforlogs | n/a |
20+
21+
## Resources
22+
23+
No resources.
24+
25+
## Inputs
26+
27+
| Name | Description | Type | Default | Required |
28+
|------|-------------|------|---------|:--------:|
29+
| <a name="input_sumologic_access_id"></a> [sumologic\_access\_id](#input\_sumologic\_access\_id) | Sumo Logic Access ID. Visit https://help.sumologic.com/Manage/Security/Access-Keys#Create_an_access_key | `string` | n/a | yes |
30+
| <a name="input_sumologic_access_key"></a> [sumologic\_access\_key](#input\_sumologic\_access\_key) | Sumo Logic Access Key. Visit https://help.sumologic.com/Manage/Security/Access-Keys#Create_an_access_key | `string` | n/a | yes |
31+
| <a name="input_sumologic_environment"></a> [sumologic\_environment](#input\_sumologic\_environment) | Enter au, ca, de, eu, jp, us2, in, fed or us1. For more information on Sumo Logic deployments visit https://help.sumologic.com/APIs/General-API-Information/Sumo-Logic-Endpoints-and-Firewall-Security | `string` | n/a | yes |
32+
| <a name="input_sumologic_organization_id"></a> [sumologic\_organization\_id](#input\_sumologic\_organization\_id) | You can find your org on the Preferences page in the Sumo Logic UI. For more information, see the Preferences Page topic. Your org ID will be used to configure the IAM Role for Sumo Logic AWS Sources."<br> For more details, visit https://help.sumologic.com/01Start-Here/05Customize-Your-Sumo-Logic-Experience/Preferences-Page | `string` | n/a | yes |
33+
34+
## Outputs
35+
36+
No outputs.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
####### BELOW ARE REQUIRED PARAMETERS FOR TERRAFORM SCRIPT #######
2+
# Visit - https://help.sumologic.com/Solutions/AWS_Observability_Solution/03_Set_Up_the_AWS_Observability_Solution#sumo-logic-access-configuration-required
3+
sumologic_environment = "<YOUR SUMO DEPLOYMENT>" # Please replace <YOUR SUMO DEPLOYMENT> (including brackets) with au, ca, de, eu, jp, us2, in, fed or us1.
4+
sumologic_access_id = "<YOUR SUMO ACCESS ID>" # Please replace <YOUR SUMO ACCESS ID> (including brackets) with your Sumo Logic Access ID.
5+
sumologic_access_key = "<YOUR SUMO ACCESS KEY>" # Please replace <YOUR SUMO ACCESS KEY> (including brackets) with your Sumo Logic Access KEY.
6+
sumologic_organization_id = "<YOUR SUMO ORG ID>" # Please replace <YOUR SUMO ORG ID> (including brackets) with your Sumo Logic Organization ID.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module "kinesis_firehose_for_logs_module" {
2+
source = "SumoLogic/sumo-logic-integrations/sumologic//aws/kinesisfirehoseforlogs"
3+
4+
create_collector = true
5+
6+
source_details = {
7+
source_name = "<Source-Name>"
8+
source_category = "<Source-Category>"
9+
description = "<Source-Description>"
10+
collector_id = null
11+
fields = {}
12+
}
13+
14+
create_bucket = true
15+
bucket_details = {
16+
bucket_name = "<AWS-S3-bucket>"
17+
force_destroy_bucket = false
18+
}
19+
20+
auto_enable_logs_subscription = "Both"
21+
app_semantic_version = "1.0.9"
22+
auto_enable_logs_subscription_options = {
23+
filter = "lambda|rds"
24+
}
25+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
provider "sumologic" {
2+
environment = var.sumologic_environment
3+
access_id = var.sumologic_access_id
4+
access_key = var.sumologic_access_key
5+
}
6+
7+
provider "aws" {
8+
region = "us-east-1"
9+
#
10+
# Below properties should be added when you would like to onboard more than one region and account
11+
# More Information regarding AWS Profile can be found at -
12+
#
13+
# Access configuration
14+
#
15+
# profile = <Provide a profile as setup in AWS CLI>
16+
#
17+
# Terraform alias
18+
#
19+
# alias = <Provide a terraform alias for the aws provider. For eg :- production-us-east-1>
20+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
variable "sumologic_environment" {
2+
type = string
3+
description = "Enter au, ca, de, eu, jp, us2, in, fed or us1. For more information on Sumo Logic deployments visit https://help.sumologic.com/APIs/General-API-Information/Sumo-Logic-Endpoints-and-Firewall-Security"
4+
5+
validation {
6+
condition = contains([
7+
"au",
8+
"ca",
9+
"de",
10+
"eu",
11+
"jp",
12+
"us1",
13+
"us2",
14+
"in",
15+
"fed"], var.sumologic_environment)
16+
error_message = "The value must be one of au, ca, de, eu, jp, us1, us2, in, or fed."
17+
}
18+
}
19+
20+
variable "sumologic_access_id" {
21+
type = string
22+
description = "Sumo Logic Access ID. Visit https://help.sumologic.com/Manage/Security/Access-Keys#Create_an_access_key"
23+
24+
validation {
25+
condition = can(regex("\\w+", var.sumologic_access_id))
26+
error_message = "The SumoLogic access ID must contain valid characters."
27+
}
28+
}
29+
30+
variable "sumologic_access_key" {
31+
type = string
32+
description = "Sumo Logic Access Key. Visit https://help.sumologic.com/Manage/Security/Access-Keys#Create_an_access_key"
33+
sensitive = true
34+
35+
validation {
36+
condition = can(regex("\\w+", var.sumologic_access_key))
37+
error_message = "The SumoLogic access key must contain valid characters."
38+
}
39+
}
40+
41+
variable "sumologic_organization_id" {
42+
type = string
43+
description = <<EOT
44+
You can find your org on the Preferences page in the Sumo Logic UI. For more information, see the Preferences Page topic. Your org ID will be used to configure the IAM Role for Sumo Logic AWS Sources."
45+
For more details, visit https://help.sumologic.com/01Start-Here/05Customize-Your-Sumo-Logic-Experience/Preferences-Page
46+
EOT
47+
validation {
48+
condition = can(regex("\\w+", var.sumologic_organization_id))
49+
error_message = "The organization ID must contain valid characters."
50+
}
51+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
terraform {
2+
required_version = ">= 0.13.0"
3+
4+
required_providers {
5+
aws = {
6+
source = "hashicorp/aws"
7+
version = ">= 5.16.2, < 6.0.0"
8+
}
9+
sumologic = {
10+
version = ">= 2.28.3, < 3.0.0"
11+
source = "SumoLogic/sumologic"
12+
}
13+
time = {
14+
source = "hashicorp/time"
15+
version = ">= 0.11.1"
16+
}
17+
random = {
18+
source = "hashicorp/random"
19+
version = ">= 3.1.0"
20+
}
21+
}
22+
}

aws/kinesisfirehoseforlogs/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ terraform {
77
version = ">= 5.16.2, < 6.0.0"
88
}
99
sumologic = {
10-
version = ">= 2.9.0"
1110
source = "SumoLogic/sumologic"
11+
version = ">= 2.28.3, < 3.0.0"
1212
}
1313
random = {
1414
source = "hashicorp/random"

0 commit comments

Comments
 (0)