Skip to content

Commit ea93819

Browse files
committed
adding example and updating readme
1 parent 1d4d219 commit ea93819

File tree

8 files changed

+142
-18
lines changed

8 files changed

+142
-18
lines changed

aws/cloudwatchmetrics/README.md

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,54 @@ This module is used to create the SumoLogic AWS CloudWatch metrics source. Featu
99

1010
| Name | Version |
1111
|------|---------|
12-
| terraform | >= 0.13.0 |
13-
| aws | >= 3.42.0 |
14-
| random | >=3.1.0 |
15-
| sumologic | >= 2.9.0 |
16-
| time | >=0.7.1 |
12+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
13+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.42.0 |
14+
| <a name="requirement_random"></a> [random](#requirement\_random) | >=3.1.0 |
15+
| <a name="requirement_sumologic"></a> [sumologic](#requirement\_sumologic) | >= 2.9.0 |
16+
| <a name="requirement_time"></a> [time](#requirement\_time) | >=0.7.1 |
1717

1818
## Providers
1919

2020
| Name | Version |
2121
|------|---------|
22-
| aws | >= 3.42.0 |
23-
| random | >=3.1.0 |
24-
| sumologic | >= 2.9.0 |
25-
| time | >=0.7.1 |
22+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.42.0 |
23+
| <a name="provider_random"></a> [random](#provider\_random) | >=3.1.0 |
24+
| <a name="provider_sumologic"></a> [sumologic](#provider\_sumologic) | >= 2.9.0 |
25+
| <a name="provider_time"></a> [time](#provider\_time) | >=0.7.1 |
26+
27+
## Modules
28+
29+
No modules.
30+
31+
## Resources
32+
33+
| Name | Type |
34+
|------|------|
35+
| [aws_iam_policy.iam_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
36+
| [aws_iam_role.source_iam_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
37+
| [random_string.aws_random](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |
38+
| [sumologic_cloudwatch_source.cloudwatch_metrics_sources](https://registry.terraform.io/providers/SumoLogic/sumologic/latest/docs/resources/cloudwatch_source) | resource |
39+
| [sumologic_collector.collector](https://registry.terraform.io/providers/SumoLogic/sumologic/latest/docs/resources/collector) | resource |
40+
| [time_sleep.wait_for_seconds](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
41+
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
42+
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |
43+
| [sumologic_caller_identity.current](https://registry.terraform.io/providers/SumoLogic/sumologic/latest/docs/data-sources/caller_identity) | data source |
2644

2745
## Inputs
2846

2947
| Name | Description | Type | Default | Required |
3048
|------|-------------|------|---------|:--------:|
31-
| 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 CloudWatch Metrics Collector <Random ID>",<br> "description": "This collector is created using Sumo Logic terraform AWS Cloudwatch metrics module to collect AWS cloudwatch metrics.",<br> "fields": {}<br>}</pre> | no |
32-
| create\_collector | Provide "true" if you would like to create the Sumo Logic Collector. | `bool` | n/a | yes |
33-
| source\_details | Provide details for the Sumo Logic Cloudwatch Metrics 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> limit_to_regions = list(string)<br> limit_to_namespaces = list(string)<br> paused = bool<br> scan_interval = number<br> sumo_account_id = number<br> fields = map(string)<br> iam_details = object({<br> create_iam_role = bool<br> iam_role_arn = string<br> })<br> })</pre> | <pre>{<br> "collector_id": "",<br> "description": "This source is created using Sumo Logic terraform AWS CloudWatch Metrics module to collect AWS Cloudwatch metrics.",<br> "fields": {},<br> "iam_details": {<br> "create_iam_role": true,<br> "iam_role_arn": null<br> },<br> "limit_to_namespaces": [],<br> "limit_to_regions": [],<br> "paused": false,<br> "scan_interval": 300000,<br> "source_category": "Labs/aws/cloudwatch/metrics",<br> "source_name": "CloudWatch Metrics Source",<br> "sumo_account_id": 926226587429<br>}</pre> | no |
34-
| sumologic\_organization\_id | Appears on the Account Overview page that displays information about your Sumo Logic organization. Used for IAM Role in Sumo Logic AWS Sources. | `string` | n/a | yes |
35-
| wait\_for\_seconds | wait\_for\_seconds is used to delay sumo logic source creation. This helps persisting IAM role in AWS system.<br> Default value is 180 seconds.<br> If the AWS IAM role is created outside the module, the value can be decreased to 1 second. | `number` | `180` | no |
49+
| <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 CloudWatch Metrics Collector <Random ID>",<br> "description": "This collector is created using Sumo Logic terraform AWS Cloudwatch metrics module to collect AWS cloudwatch metrics.",<br> "fields": {}<br>}</pre> | no |
50+
| <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 |
51+
| <a name="input_source_details"></a> [source\_details](#input\_source\_details) | Provide details for the Sumo Logic Cloudwatch Metrics 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> limit_to_regions = list(string)<br> limit_to_namespaces = list(string)<br> paused = bool<br> scan_interval = number<br> sumo_account_id = number<br> fields = map(string)<br> iam_details = object({<br> create_iam_role = bool<br> iam_role_arn = string<br> })<br> })</pre> | <pre>{<br> "collector_id": "",<br> "description": "This source is created using Sumo Logic terraform AWS CloudWatch Metrics module to collect AWS Cloudwatch metrics.",<br> "fields": {},<br> "iam_details": {<br> "create_iam_role": true,<br> "iam_role_arn": null<br> },<br> "limit_to_namespaces": [<br> "AWS/ApplicationELB",<br> "AWS/ApiGateway",<br> "AWS/DynamoDB",<br> "AWS/Lambda",<br> "AWS/RDS",<br> "AWS/ECS",<br> "AWS/ElastiCache",<br> "AWS/ELB",<br> "AWS/NetworkELB",<br> "AWS/SQS",<br> "AWS/SNS"<br> ],<br> "limit_to_regions": [<br> "us-east-1"<br> ],<br> "paused": false,<br> "scan_interval": 300000,<br> "source_category": "Labs/aws/cloudwatch/metrics",<br> "source_name": "CloudWatch Metrics Source",<br> "sumo_account_id": 926226587429<br>}</pre> | no |
52+
| <a name="input_sumologic_organization_id"></a> [sumologic\_organization\_id](#input\_sumologic\_organization\_id) | Appears on the Account Overview page that displays information about your Sumo Logic organization. Used for IAM Role in Sumo Logic AWS Sources. | `string` | n/a | yes |
53+
| <a name="input_wait_for_seconds"></a> [wait\_for\_seconds](#input\_wait\_for\_seconds) | wait\_for\_seconds is used to delay sumo logic source creation. This helps persisting IAM role in AWS system.<br> Default value is 180 seconds.<br> If the AWS IAM role is created outside the module, the value can be decreased to 1 second. | `number` | `180` | no |
3654

3755
## Outputs
3856

3957
| Name | Description |
4058
|------|-------------|
41-
| aws\_iam\_role | AWS IAM role with permission to allow Sumo Logic to read logs from S3 Bucket. |
42-
| random\_string | Random String value created. |
43-
| sumologic\_collector | Sumo Logic hosted collector. |
44-
| sumologic\_source | Sumo Logic AWS Cloudwatch metrics source. |
59+
| <a name="output_aws_iam_role"></a> [aws\_iam\_role](#output\_aws\_iam\_role) | AWS IAM role with permission to allow Sumo Logic to read logs from S3 Bucket. |
60+
| <a name="output_random_string"></a> [random\_string](#output\_random\_string) | Random String value created. |
61+
| <a name="output_sumologic_collector"></a> [sumologic\_collector](#output\_sumologic\_collector) | Sumo Logic hosted collector. |
62+
| <a name="output_sumologic_source"></a> [sumologic\_source](#output\_sumologic\_source) | Sumo Logic AWS Cloudwatch metrics source. |
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Requirements
2+
3+
| Name | Version |
4+
|------|---------|
5+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
6+
| <a name="requirement_sumologic"></a> [sumologic](#requirement\_sumologic) | >= 2.10.0 |
7+
8+
## Providers
9+
10+
No providers.
11+
12+
## Modules
13+
14+
| Name | Source | Version |
15+
|------|--------|---------|
16+
| <a name="module_cloudwatch_metrics"></a> [cloudwatch\_metrics](#module\_cloudwatch\_metrics) | git::https://github.com/SumoLogic/terraform-sumologic-sumo-logic-integrations.git//aws/cloudwatchmetrics | n/a |
17+
18+
## Resources
19+
20+
No resources.
21+
22+
## Inputs
23+
24+
| Name | Description | Type | Default | Required |
25+
|------|-------------|------|---------|:--------:|
26+
| <a name="input_sumologic_access_id"></a> [sumologic\_access\_id](#input\_sumologic\_access\_id) | Please provide access ID for your Sumo Account | `string` | n/a | yes |
27+
| <a name="input_sumologic_access_key"></a> [sumologic\_access\_key](#input\_sumologic\_access\_key) | Please provide access key for your Sumo Account | `string` | n/a | yes |
28+
| <a name="input_sumologic_environment"></a> [sumologic\_environment](#input\_sumologic\_environment) | Please provide SumoLogic deployment environment | `string` | n/a | yes |
29+
| <a name="input_sumologic_organization_id"></a> [sumologic\_organization\_id](#input\_sumologic\_organization\_id) | Appears on the Account Overview page that displays information about your Sumo Logic organization. Used for IAM Role in Sumo Logic AWS Sources. | `string` | n/a | yes |
30+
31+
## Outputs
32+
33+
| Name | Description |
34+
|------|-------------|
35+
| <a name="output_cloudwatch_metrics"></a> [cloudwatch\_metrics](#output\_cloudwatch\_metrics) | All outputs related to CloudWatch metrics. |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
####### BELOW ARE REQUIRED PARAMETERS FOR TERRAFORM SCRIPT #######
2+
sumologic_environment = "<YOUR SUMO DEPLOYMENT>" # Please replace <YOUR SUMO DEPLOYMENT> (including brackets) with au, ca, de, eu, jp, us2, in, fed or us1.
3+
sumologic_organization_id = "<YOUR SUMO ORG ID>" # Please replace <YOUR SUMO ORG ID> (including brackets) with your Sumo Logic Organization ID.
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.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module "cloudwatch_metrics" {
2+
source = "git::https://github.com/SumoLogic/terraform-sumologic-sumo-logic-integrations.git//aws/cloudwatchmetrics"
3+
4+
create_collector = true
5+
sumologic_organization_id = var.sumologic_organization_id
6+
wait_for_seconds = 180 # tried increasing this from the default of 180 with no luck
7+
source_details = {
8+
"collector_id": module.cloudwatch_metrics.sumologic_collector.collector.id ,
9+
"description": "This source is created using Sumo Logic terraform AWS CloudWatch Metrics module to collect AWS Cloudwatch metrics.",
10+
"fields": {},
11+
"iam_details": {
12+
"create_iam_role": true,
13+
"iam_role_arn": null
14+
},
15+
"limit_to_namespaces": ["aws/ec2"],
16+
"limit_to_regions": ["eu-central-1"],
17+
"paused": false,
18+
"scan_interval": 300000,
19+
"source_category": "Labs/aws/cloudwatch/metrics",
20+
"source_name": "CloudWatch Metrics Source",
21+
"sumo_account_id": 926226587429
22+
}
23+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
output "cloudwatch_metrics" {
2+
value = module.cloudwatch_metrics
3+
description = "All outputs related to CloudWatch metrics."
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
provider "sumologic" {
2+
environment = var.sumologic_environment
3+
access_id = var.sumologic_access_id
4+
access_key = var.sumologic_access_key
5+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
variable "sumologic_access_id" {
2+
type = string
3+
description = "Please provide access ID for your Sumo Account"
4+
}
5+
6+
variable "sumologic_access_key" {
7+
type = string
8+
description = "Please provide access key for your Sumo Account"
9+
}
10+
11+
variable "sumologic_environment" {
12+
type = string
13+
description = "Please provide SumoLogic deployment environment"
14+
}
15+
16+
variable "sumologic_organization_id" {
17+
type = string
18+
description = "Appears on the Account Overview page that displays information about your Sumo Logic organization. Used for IAM Role in Sumo Logic AWS Sources."
19+
20+
validation {
21+
condition = can(regex("\\w+", var.sumologic_organization_id))
22+
error_message = "The organization ID must contain valid characters."
23+
}
24+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
terraform {
2+
required_version = ">= 0.13.0"
3+
4+
required_providers {
5+
sumologic = {
6+
version = ">= 2.10.0"
7+
source = "SumoLogic/sumologic"
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)