diff --git a/examples/resource_lacework_integration_azure_agentless_scanning/main.tf b/examples/resource_lacework_integration_azure_agentless_scanning/main.tf index 9f129139..13ae406f 100644 --- a/examples/resource_lacework_integration_azure_agentless_scanning/main.tf +++ b/examples/resource_lacework_integration_azure_agentless_scanning/main.tf @@ -27,7 +27,7 @@ variable "integration_level" { variable "blob_container_name" { type = string - default = "blob-container-name" + default = "terraform-provider-test" } variable "scanning_subscription_id" { @@ -37,12 +37,12 @@ variable "scanning_subscription_id" { variable "scanning_resource_group_name" { type = string - default = "AWLS-kilby-test" + default = "agentless-canary-scanned-group" } variable "storage_account_url" { type = string - default = "https://aoztest.blob.core.windows.net/" + default = "https://asidekicktest3954.blob.core.windows.net/" } variable "tenant_id" { diff --git a/integration/resource_lacework_integration_azure_agentless_scanning_test.go b/integration/resource_lacework_integration_azure_agentless_scanning_test.go index 7b74d189..8667a5d6 100644 --- a/integration/resource_lacework_integration_azure_agentless_scanning_test.go +++ b/integration/resource_lacework_integration_azure_agentless_scanning_test.go @@ -1,46 +1,46 @@ package integration -//import ( -// "fmt" -// "testing" -// -// "github.com/gruntwork-io/terratest/modules/terraform" -// "github.com/stretchr/testify/assert" -//) +import ( + "fmt" + "testing" + + "github.com/gruntwork-io/terratest/modules/terraform" + "github.com/stretchr/testify/assert" +) // TestIntegrationAzureAgentlessScanningCreate applies integration terraform: // => '../examples/resource_lacework_integration_azure_agentless_scanning' // // It uses the go-sdk to verify the created integration, // applies an update with new integration name and destroys it -//func TestIntegrationAzureAgentlessScanningCreate(t *testing.T) { -// credential, err := azureLoadDefaultCredentials() -// integration_name := "Azure Agentless Scanning Example Integration Test" -// update_integration_name := fmt.Sprintf("%s Updated", integration_name) -// if assert.Nil(t, err, "this test requires you to set AZURE_CREDENTIALS environment variable") { -// terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ -// TerraformDir: "../examples/resource_lacework_integration_azure_agentless_scanning", -// Vars: map[string]interface{}{ -// "integration_name": integration_name, -// "client_id": credential.ClientID, -// "client_secret": credential.ClientSecret, -// }, -// EnvVars: map[string]string{ -// "LW_API_TOKEN": LwApiToken, -// }, -// }) -// defer terraform.Destroy(t, terraformOptions) -// -// // Create new Azure Agentless Scanning integration -// create := terraform.InitAndApplyAndIdempotent(t, terraformOptions) -// createData := GetAzureAgentlessScanningResponse(create) -// assert.Equal(t, integration_name, createData.Data.Name) -// -// // Update Azure integration -// terraformOptions.Vars["integration_name"] = update_integration_name -// -// update := terraform.InitAndApplyAndIdempotent(t, terraformOptions) -// updateData := GetAzureAgentlessScanningResponse(update) -// assert.Equal(t, update_integration_name, updateData.Data.Name) -// } -//} +func TestIntegrationAzureAgentlessScanningCreate(t *testing.T) { + credential, err := azureLoadDefaultCredentials() + integration_name := "Azure Agentless Scanning Example Integration Test" + update_integration_name := fmt.Sprintf("%s Updated", integration_name) + if assert.Nil(t, err, "this test requires you to set AZURE_CREDENTIALS environment variable") { + terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ + TerraformDir: "../examples/resource_lacework_integration_azure_agentless_scanning", + Vars: map[string]interface{}{ + "integration_name": integration_name, + "client_id": credential.ClientID, + "client_secret": credential.ClientSecret, + }, + EnvVars: map[string]string{ + "LW_API_TOKEN": LwApiToken, + }, + }) + defer terraform.Destroy(t, terraformOptions) + + // Create new Azure Agentless Scanning integration + create := terraform.InitAndApplyAndIdempotent(t, terraformOptions) + createData := GetAzureAgentlessScanningResponse(create) + assert.Equal(t, integration_name, createData.Data.Name) + + // Update Azure integration + terraformOptions.Vars["integration_name"] = update_integration_name + + update := terraform.InitAndApplyAndIdempotent(t, terraformOptions) + updateData := GetAzureAgentlessScanningResponse(update) + assert.Equal(t, update_integration_name, updateData.Data.Name) + } +}