Skip to content

Commit 5ac0c67

Browse files
v1.0.0 Corelight Config and Fleet Now Required (#16)
1 parent e33a42b commit 5ac0c67

File tree

5 files changed

+24
-55
lines changed

5 files changed

+24
-55
lines changed

README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[#](#) terraform-aws-sensor
1+
# terraform-aws-sensor
22

33
Terraform for Corelight's AWS Cloud Sensor Deployment.
44

@@ -36,16 +36,10 @@ module "sensor" {
3636
community_string = "<password for the sensor api>"
3737
vpc_id = "<vpc where the sensor autoscaling group is deployed>"
3838
asg_lambda_iam_role_arn = module.asg_lambda_role.role_arn
39-
40-
# (Optional) ASG should have an instance profile when using
41-
# the cloud enrichment feature
42-
enrichment_bucket_name = "<cloud enrichment s3 bucket name>"
43-
enrichment_bucket_region = "<cloud enrichment s3 bucket region>"
44-
enrichment_instance_profile_arn = aws_iam_instance_profile.corelight_sensor.arn
45-
46-
# Optional - Fleet Manager
39+
4740
fleet_token = "<the pairing token from the Fleet UI>"
4841
fleet_url = "<the URL of the fleet instance from the Fleet UI>"
42+
fleet_server_sslname = "<the ssl name provided by Fleet>"
4943
}
5044
5145

data.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,4 @@ data "aws_vpc" "provided" {
44

55
data "aws_subnet" "monitoring_subnet" {
66
id = var.monitoring_subnet_id
7-
}
8-
9-
data "aws_subnet" "management_subnet" {
10-
id = var.management_subnet_id
117
}

launch_template.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ resource "aws_launch_template" "sensor_launch_template" {
77
ebs_optimized = false
88

99
dynamic "iam_instance_profile" {
10-
for_each = var.enrichment_instance_profile_arn == "" ? toset([]) : toset([1])
10+
for_each = var.instance_profile_arn == "" ? toset([]) : toset([1])
1111

1212
content {
13-
arn = var.enrichment_instance_profile_arn
13+
arn = var.instance_profile_arn
1414
}
1515
}
1616

sensor_config.tf

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "sensor_config" {
2-
source = "github.com/corelight/terraform-config-sensor?ref=v0.3.0"
2+
source = "github.com/corelight/terraform-config-sensor?ref=v1.0.0"
33

44
sensor_license = var.license_key
55
fleet_community_string = var.community_string
@@ -13,9 +13,4 @@ module "sensor_config" {
1313
sensor_monitoring_interface_name = "eth0"
1414
base64_encode_config = true
1515
sensor_health_check_http_port = "41080"
16-
17-
enrichment_enabled = var.enrichment_bucket_name != "" && var.enrichment_bucket_region != ""
18-
enrichment_bucket_name = var.enrichment_bucket_name
19-
enrichment_bucket_region = var.enrichment_bucket_region
20-
enrichment_cloud_provider_name = "aws"
2116
}

variables.tf

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,22 @@ variable "community_string" {
3434
sensitive = true
3535
}
3636

37+
variable "fleet_token" {
38+
type = string
39+
sensitive = true
40+
description = "Pairing token from the Fleet UI. Must be set if 'fleet_url' is provided"
41+
}
42+
43+
variable "fleet_url" {
44+
type = string
45+
description = "URL of the fleet instance from the Fleet UI. Must be set if 'fleet_token' is provided"
46+
}
47+
48+
variable "fleet_server_sslname" {
49+
type = string
50+
description = "SSL hostname for the fleet server"
51+
}
52+
3753
variable "license_key" {
3854
description = "Your Corelight sensor license key. Optional if fleet_url is configured."
3955
sensitive = true
@@ -125,20 +141,8 @@ variable "sensor_management_security_group_description" {
125141
default = "Security group for the sensor which allows ssh from the DMZ / Bastion"
126142
}
127143

128-
variable "enrichment_bucket_name" {
129-
description = "(optional) The name of the s3 bucket where cloud enrichment data is being stored"
130-
type = string
131-
default = ""
132-
}
133-
134-
variable "enrichment_bucket_region" {
135-
description = "(optional) The region of the cloud enrichment s3 bucket"
136-
type = string
137-
default = ""
138-
}
139-
140-
variable "enrichment_instance_profile_arn" {
141-
description = "(optional) When configuring enrichment, an instance profile must be added granting the ASG EC2 nodes access to read from the bucket"
144+
variable "instance_profile_arn" {
145+
description = "(optional) Instance profile must be added granting cloud features access to AWS APIs"
142146
type = string
143147
default = ""
144148
}
@@ -179,26 +183,6 @@ variable "tags" {
179183
default = {}
180184
}
181185

182-
variable "fleet_token" {
183-
type = string
184-
default = ""
185-
sensitive = true
186-
description = "(optional) the pairing token from the Fleet UI. Must be set if 'fleet_url' is provided"
187-
}
188-
189-
variable "fleet_url" {
190-
type = string
191-
default = ""
192-
description = "(optional) the URL of the fleet instance from the Fleet UI. Must be set if 'fleet_token' is provided"
193-
}
194-
195-
variable "fleet_server_sslname" {
196-
type = string
197-
default = "1.broala.fleet.product.corelight.io"
198-
description = "(optional) the SSL hostname for the fleet server"
199-
200-
}
201-
202186
variable "fleet_http_proxy" {
203187
type = string
204188
default = ""

0 commit comments

Comments
 (0)