Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 49 additions & 15 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,42 +134,76 @@
"on_by_default": true
},
{
"name": "deploy-arch-ibm-observability",
"description": "Enable to provision and configure IBM Cloud Logs, Cloud Monitoring, Metrics routing and Activity Tracker event routing for analysing logs and metrics generated by the SCC Workload Protection instance.",
"name": "deploy-arch-ibm-cloud-logs",
"description": "Provision and configure IBM Cloud Logs (ICL) instance which can be used for analysing logs generated by SCC Workload Protection instance. ",
"catalog_id": "7a4d68b4-cf8b-40cd-a3d1-f49aff526eb3",
"flavors": [
"instances"
"fully-configurable"
],
"id": "a3137d28-79e0-479d-8a24-758ebd5a0eab-global",
"catalog_id": "7a4d68b4-cf8b-40cd-a3d1-f49aff526eb3",
"id": "63d8ae58-fbf3-41ce-b844-0fb5b85882ab-global",
"version": "v1.6.11",
"optional": true,
"on_by_default": true,
"input_mapping": [
{
"dependency_output": "cloud_monitoring_crn",
"version_input": "existing_monitoring_crn"
},
{
"dependency_input": "prefix",
"version_input": "prefix",
"reference_version": true
},
{
"dependency_input": "region",
"version_input": "region",
"dependency_input": "existing_resource_group_name",
"version_input": "existing_resource_group_name",
"reference_version": true
},
{
"dependency_input": "enable_platform_metrics",
"version_input": "enable_platform_metrics",
"dependency_input": "region",
"version_input": "region",
"reference_version": true
},
{
"dependency_input": "logs_routing_tenant_regions",
"version_input": "logs_routing_tenant_regions",
"reference_version": true
}
]
},
{
"name": "deploy-arch-ibm-cloud-monitoring",
"description": "Provision and configure IBM Cloud Monitoring for metrics generated by the SCC Workload Protection instance.",
"id": "73debdbf-894f-4c14-81c7-5ece3a70b67d-global",
"version": "v1.6.4",
"flavors": [
"fully-configurable"
],
"catalog_id": "7a4d68b4-cf8b-40cd-a3d1-f49aff526eb3",
"optional": true,
"on_by_default": true,
"version": "v3.0.3"
"on_by_default": false,
"input_mapping": [
{
"dependency_output": "cloud_monitoring_crn",
"version_input": "existing_monitoring_crn"
},
{
"dependency_input": "enable_platform_metrics",
"version_input": "enable_platform_metrics",
"reference_version": true
},
{
"dependency_input": "prefix",
"version_input": "prefix",
"reference_version": true
},
{
"dependency_input": "region",
"version_input": "region",
"reference_version": true
},
{
"dependency_input": "existing_resource_group_name",
"version_input": "existing_resource_group_name",
"reference_version": true
}
]
}
],
"configuration": [
Expand Down
2 changes: 1 addition & 1 deletion tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toolchain go1.25.0
require (
github.com/gruntwork-io/terratest v0.50.0
github.com/stretchr/testify v1.10.0
github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.58.11
github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.59.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.58.11 h1:f8qp4xvv2ySGSadmd0xJw/3r5equ9eOLKj2J0Ux9CyE=
github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.58.11/go.mod h1:2uu21nGEK+6saiBO6MVJNystf2Wm0BUIyiQmxTLM72U=
github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.59.0 h1:h+CvNQyeiieMXBSNESrHNVPJXj388T+sa4paV48nfl8=
github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.59.0/go.mod h1:6Wz8vnBelmRZxD5qjm5K4MpvPPWpoCWRPzG76j0B36g=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tmccombs/hcl2json v0.6.4 h1:/FWnzS9JCuyZ4MNwrG4vMrFrzRgsWEOVi+1AyYUVLGw=
github.com/tmccombs/hcl2json v0.6.4/go.mod h1:+ppKlIW3H5nsAsZddXPy2iMyvld3SHxyjswOZhavRDk=
Expand Down
52 changes: 48 additions & 4 deletions tests/pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ package test
import (
"fmt"
"log"
"math/rand"
"os"
"strings"
"testing"

"math/rand/v2"

"github.com/gruntwork-io/terratest/modules/files"
"github.com/gruntwork-io/terratest/modules/logger"
"github.com/gruntwork-io/terratest/modules/random"
"github.com/gruntwork-io/terratest/modules/terraform"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/cloudinfo"
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/common"
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testaddons"
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testhelper"
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testschematic"
)
Expand Down Expand Up @@ -59,7 +60,7 @@ func TestMain(m *testing.M) {
func TestFullyConfigurable(t *testing.T) {
t.Parallel()

var region = validRegions[rand.IntN(len(validRegions))]
var region = validRegions[rand.Intn(len(validRegions))]

// ------------------------------------------------------------------------------------
// Provision App Config first
Expand Down Expand Up @@ -146,7 +147,7 @@ func TestFullyConfigurable(t *testing.T) {
func TestFullyConfigurableUpgrade(t *testing.T) {
t.Parallel()

var region = validRegions[rand.IntN(len(validRegions))]
var region = validRegions[rand.Intn(len(validRegions))]

// ------------------------------------------------------------------------------------
// Provision App Config first
Expand Down Expand Up @@ -231,3 +232,46 @@ func TestFullyConfigurableUpgrade(t *testing.T) {
logger.Log(t, "END: Destroy (prereq resources)")
}
}

func TestSccWpAddonDefaultConfiguration(t *testing.T) {
t.Parallel()

options := testaddons.TestAddonsOptionsDefault(&testaddons.TestAddonOptions{
Testing: t,
Prefix: "scc-def",
ResourceGroup: resourceGroup,
QuietMode: false, // Suppress logs except on failure
})

options.AddonConfig = cloudinfo.NewAddonConfigTerraform(
options.Prefix,
"deploy-arch-ibm-scc-workload-protection",
"fully-configurable",
map[string]interface{}{
"prefix": options.Prefix,
"region": validRegions[rand.Intn(len(validRegions))],
},
)

err := options.RunAddonTest()
require.NoError(t, err)
}

// TestDependencyPermutations runs dependency permutations for SCC WP and all its dependencies
func TestSccWpDependencyPermutations(t *testing.T) {
options := testaddons.TestAddonsOptionsDefault(&testaddons.TestAddonOptions{
Testing: t,
Prefix: "scc-per",
AddonConfig: cloudinfo.AddonConfig{
OfferingName: "deploy-arch-ibm-scc-workload-protection",
OfferingFlavor: "fully-configurable",
Inputs: map[string]interface{}{
"prefix": "vpc-per",
"region": validRegions[rand.Intn(len(validRegions))],
},
},
})

err := options.RunAddonPermutationTest()
assert.NoError(t, err, "Dependency permutation test should not fail")
}