Skip to content

Commit

Permalink
fix integration test for org acct
Browse files Browse the repository at this point in the history
  • Loading branch information
wl-smith committed May 25, 2023
1 parent c4f1626 commit cb40e0d
Show file tree
Hide file tree
Showing 6 changed files with 209 additions and 389 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ provider "lacework" {
}

resource "lacework_integration_aws_org_agentless_scanning" "example" {

name = var.name
query_text = var.query_text
scan_frequency = 24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ variable "filter_list" {
default = ["proj1", "proj2"]
}

variable "org_account_mappings" {

}

resource "lacework_integration_gcp_agentless_scanning" "example" {
name = var.integration_name
credentials {
Expand All @@ -88,20 +84,6 @@ resource "lacework_integration_gcp_agentless_scanning" "example" {
scan_host_vulnerabilities = true
query_text = var.query_text
filter_list = var.filter_list

org_account_mappings {
default_lacework_account = "lw_account_1"

mapping {
lacework_account = "lw_account_2"
gcp_projects = ["234556677", "774564564"]
}

mapping {
lacework_account = "lw_account_3"
gcp_projects = ["553453453", "934534535"]
}
}
}

output "name" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ import (
// nolint

func TestIntegrationAwsOrgAgentlessScanningLog(t *testing.T) {
// awsCreds, err := awsLoadDefaultCredentials()
// if err != nil {
// println("Error when getting awscreds: ", err)
// }
terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../examples/resource_lacework_integration_aws_org_agentless_scanning",
Vars: map[string]interface{}{
Expand All @@ -27,6 +23,8 @@ func TestIntegrationAwsOrgAgentlessScanningLog(t *testing.T) {
"scanning_account": "259832199722",
"management_account": "259832199722",
"monitored_accounts": []string{"327958430571", "460445523461"},
"role_arn": "arn:aws:iam::249446771485:role/lacework-iam-example-role",
"external_id": "12345",
"org_account_mappings": []map[string]interface{}{
{
"default_lacework_account": "agentless",
Expand All @@ -38,7 +36,8 @@ func TestIntegrationAwsOrgAgentlessScanningLog(t *testing.T) {
},
},
},
}})
},
})

defer terraform.Destroy(t, terraformOptions)

Expand All @@ -62,12 +61,14 @@ func TestIntegrationAwsOrgAgentlessScanningLog(t *testing.T) {
"scanning_account": "259832199722",
"management_account": "259832199722",
"monitored_accounts": []string{"327958430571", "460445523461"},
"role_arn": "arn:aws:iam::249446771485:role/lacework-iam-example-role",
"external_id": "12345678",
"org_account_mappings": []map[string]interface{}{
{
"default_lacework_account": "agentless",
"integration_mappings": []map[string]interface{}{
{
"lacework_account": "sub1",
"lacework_account": "sub2",
"aws_accounts": []string{"327958430571"},
},
},
Expand Down
Loading

0 comments on commit cb40e0d

Please sign in to comment.