Skip to content

Commit d731d8b

Browse files
committed
feat: Add short-lived instance scanning option to agentless terraform
1 parent dda9292 commit d731d8b

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

examples/resource_lacework_integration_aws_agentless_scanning/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ resource "lacework_integration_aws_agentless_scanning" "example" {
1414
scan_host_vulnerabilities = true
1515
scan_multi_volume = false
1616
scan_stopped_instances = true
17+
scan_short_lived_instances = false
1718
account_id = var.account_id
1819
bucket_arn = var.bucket_arn
1920
credentials {

examples/resource_lacework_integration_aws_org_agentless_scanning/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ resource "lacework_integration_aws_org_agentless_scanning" "example" {
1818
scan_host_vulnerabilities = true
1919
scan_multi_volume = false
2020
scan_stopped_instances = true
21+
scan_short_lived_instances = false
2122
account_id = var.account_id
2223
bucket_arn = var.bucket_arn
2324
scanning_account = var.scanning_account

lacework/resource_lacework_integration_aws_agentless_scanning.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ var awsAgentlessScanningIntegrationSchema = map[string]*schema.Schema{
6666
Default: true,
6767
Description: "Whether to scan stopped instances (true)",
6868
},
69+
"scan_short_lived_instances": {
70+
Type: schema.TypeBool,
71+
Optional: true,
72+
Default: false,
73+
Description: "Whether to scan short-lived (ephemeral) instances",
74+
},
6975
"account_id": {
7076
Type: schema.TypeString,
7177
Optional: true,
@@ -146,6 +152,7 @@ func resourceLaceworkIntegrationAwsAgentlessScanningCreate(d *schema.ResourceDat
146152
ScanHostVulnerabilities: d.Get("scan_host_vulnerabilities").(bool),
147153
ScanMultiVolume: d.Get("scan_multi_volume").(bool),
148154
ScanStoppedInstances: d.Get("scan_stopped_instances").(bool),
155+
ScanShortLivedInstances: d.Get("scan_short_lived_instances").(bool),
149156
AccountID: d.Get("account_id").(string),
150157
BucketArn: d.Get("bucket_arn").(string),
151158
CrossAccountCreds: api.AwsSidekickCrossAccountCredentials{
@@ -253,6 +260,7 @@ func resourceLaceworkIntegrationAwsAgentlessScanningUpdate(d *schema.ResourceDat
253260
ScanHostVulnerabilities: d.Get("scan_host_vulnerabilities").(bool),
254261
ScanMultiVolume: d.Get("scan_multi_volume").(bool),
255262
ScanStoppedInstances: d.Get("scan_stopped_instances").(bool),
263+
ScanShortLivedInstances: d.Get("scan_short_lived_instances").(bool),
256264
AccountID: d.Get("account_id").(string),
257265
BucketArn: d.Get("bucket_arn").(string),
258266
CrossAccountCreds: api.AwsSidekickCrossAccountCredentials{

lacework/resource_lacework_integration_aws_org_agentless_scanning.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ var awsOrgAgentlessScanningIntegrationSchema = map[string]*schema.Schema{
6868
Default: true,
6969
Description: "Whether to scan stopped instances (true)",
7070
},
71+
"scan_short_lived_instances": {
72+
Type: schema.TypeBool,
73+
Optional: true,
74+
Default: false,
75+
Description: "Whether to scan short-lived (ephemeral) instances",
76+
},
7177
"account_id": {
7278
Type: schema.TypeString,
7379
Optional: true,
@@ -202,6 +208,9 @@ func resourceLaceworkIntegrationAwsOrgAgentlessScanningCreate(d *schema.Resource
202208
ScanFrequency: d.Get("scan_frequency").(int),
203209
ScanContainers: d.Get("scan_containers").(bool),
204210
ScanHostVulnerabilities: d.Get("scan_host_vulnerabilities").(bool),
211+
ScanMultiVolume: d.Get("scan_multi_volume").(bool),
212+
ScanStoppedInstances: d.Get("scan_stopped_instances").(bool),
213+
ScanShortLivedInstances: d.Get("scan_short_lived_instances").(bool),
205214
AccountID: d.Get("account_id").(string),
206215
BucketArn: d.Get("bucket_arn").(string),
207216
ScanningAccount: d.Get("scanning_account").(string),
@@ -342,6 +351,9 @@ func resourceLaceworkIntegrationAwsOrgAgentlessScanningUpdate(d *schema.Resource
342351
ScanFrequency: d.Get("scan_frequency").(int),
343352
ScanContainers: d.Get("scan_containers").(bool),
344353
ScanHostVulnerabilities: d.Get("scan_host_vulnerabilities").(bool),
354+
ScanMultiVolume: d.Get("scan_multi_volume").(bool),
355+
ScanStoppedInstances: d.Get("scan_stopped_instances").(bool),
356+
ScanShortLivedInstances: d.Get("scan_short_lived_instances").(bool),
345357
AccountID: d.Get("account_id").(string),
346358
BucketArn: d.Get("bucket_arn").(string),
347359
ScanningAccount: d.Get("scanning_account").(string),

0 commit comments

Comments
 (0)