Skip to content

Commit

Permalink
updating example and removing unnecessary locals
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Haney committed Jun 6, 2024
1 parent ab01a48 commit 2ce7650
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
12 changes: 0 additions & 12 deletions data.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
locals {
enrichment_payload = {
"cloud_enrichment.enable" : "true"
"cloud_enrichment.cloud_provider" : var.enrichment_cloud_provider_name
"cloud_enrichment.bucket_name" : var.enrichment_bucket_name
"cloud_enrichment.bucket_region" : var.enrichment_bucket_region
}

full_enrichment_payload = var.enrichment_storage_account_name == "" ? local.enrichment_payload : merge(local.enrichment_payload, { "cloud_enrichment.azure_storage_account" : var.enrichment_storage_account_name })

}

data "cloudinit_config" "config" {
gzip = var.gzip_config
base64_encode = var.base64_encode_config
Expand Down
20 changes: 14 additions & 6 deletions examples/deployment/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ locals {
mon_cidr = "10.3.0.0/24"
mon_gateway = "10.3.0.1"

enrichment_cloud_provider = "azure"
enrichment_storage_account_name = "account-foo"
enrichment_storage_container_name = "bucket-bar"

# Enrichment
enrichment_enabled = "<true | false>"
enrichment_cloud_provider = "<aws | azure | gcp>"
enrichment_storage_account_name = "account-foo"
enrichment_bucket_name = "bucket-bar"
enrichment_s3_bucket_region = "us-east-1"
}

module "sensor_config" {
Expand All @@ -24,9 +28,13 @@ module "sensor_config" {
subnetwork_monitoring_gateway = local.mon_gateway

# Optional - Enrichment Service
enrichment_cloud_provider_name = local.enrichment_cloud_provider
enrichment_storage_container_name = local.enrichment_storage_container_name
enrichment_enabled = local.enrichment_enabled
enrichment_cloud_provider_name = local.enrichment_cloud_provider
enrichment_bucket_name = local.enrichment_bucket_name

# Optional - Enrichment Service Azure
# Optional - Enrichment Service Azure Only
enrichment_storage_account_name = local.enrichment_storage_account_name

# Optional - Enrichment Service AWS Only
enrichment_bucket_region = local.enrichment_s3_bucket_region
}
1 change: 0 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ variable "enrichment_storage_account_name" {
default = ""
}


# Enrichment Service -- AWS
variable "enrichment_bucket_region" {
description = "(optional) the region for the s3 enrichment bucket"
Expand Down

0 comments on commit 2ce7650

Please sign in to comment.