Skip to content

Commit 9098688

Browse files
committed
updated elasticloadbalancing example
1 parent 329923f commit 9098688

File tree

4 files changed

+25
-20
lines changed

4 files changed

+25
-20
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
data "aws_region" "current" {}
2+
3+
data "aws_caller_identity" "current" {}
4+
5+
data "sumologic_caller_identity" "current" {}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
locals {
2+
# AWS account details
3+
aws_account_id = data.aws_caller_identity.current.account_id
4+
aws_region = data.aws_region.current.name
5+
6+
# S3 bucket inputs
7+
bucket_name = "aws-observability-random-${random_string.aws_random.id}"
8+
path_expression = "AWSLogs/${local.aws_account_id}/clb/${local.aws_region}/*"
9+
}

aws/elasticloadbalancing/examples/default/main.tf

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
resource "random_string" "aws_random" {
2+
length = 10
3+
upper = false
4+
special = false
5+
}
6+
17
module "lb_module" {
28
source = "SumoLogic/sumo-logic-integrations/sumologic//aws/elasticloadbalancing"
39

@@ -6,14 +12,14 @@ module "lb_module" {
612
wait_for_seconds = 20
713

814
source_details = {
9-
source_name = "<Source-Name>"
10-
source_category = "<Source-Category>"
11-
description = "<Source-Description>"
15+
source_name = "Classic Load Balancer Logs (Region)"
16+
source_category = "aws/observability/clb/logs"
17+
description = "This source is created using Sumo Logic terraform AWS Observability module to collect AWS Classic Load Balancer logs."
1218
collector_id = null
1319
bucket_details = {
1420
create_bucket = true
15-
bucket_name = "<AWS-S3-bucket>"
16-
path_expression = "path"
21+
bucket_name = local.bucket_name
22+
path_expression = local.path_expression
1723
force_destroy_bucket = false
1824
}
1925
paused = false

aws/elasticloadbalancing/examples/default/provider.tf

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,4 @@ provider "sumologic" {
22
environment = var.sumologic_environment
33
access_id = var.sumologic_access_id
44
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>
205
}

0 commit comments

Comments
 (0)