Skip to content

Commit 97a1af1

Browse files
Jordan-Williams2Jordan-Williams2
authored andcommitted
fix: hooks
1 parent 92f58a7 commit 97a1af1

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ statement instead the previous block.
136136
|------|-------------|------|---------|:--------:|
137137
| <a name="input_access_tags"></a> [access\_tags](#input\_access\_tags) | A list of access tags to apply to the SCC WP instance created by the module. For more information, see https://cloud.ibm.com/docs/account?topic=account-access-tags-tutorial. | `list(string)` | `[]` | no |
138138
| <a name="input_app_config_crn"></a> [app\_config\_crn](#input\_app\_config\_crn) | The CRN of an existing App Config instance to use with the SCC Workload Protection instance. Required if `cspm_enabled` is true. NOTE: Ensure the App Config instance has configuration aggregator enabled. | `string` | `null` | no |
139-
| <a name="input_cbr_rules"></a> [cbr\_rules](#input\_cbr\_rules) | The context-based restrictions rule to create. Only one rule is allowed. | <pre>list(object({<br/> description = string<br/> account_id = string<br/> tags = optional(list(object({<br/> name = string<br/> value = string<br/> })), [])<br/> rule_contexts = list(object({<br/> attributes = optional(list(object({<br/> name = string<br/> value = string<br/> }))) }))<br/> enforcement_mode = string<br/> }))</pre> | `[]` | no |
139+
| <a name="input_cbr_rules"></a> [cbr\_rules](#input\_cbr\_rules) | The context-based restrictions rule to create. Only one rule is allowed. | <pre>list(object({<br> description = string<br> account_id = string<br> tags = optional(list(object({<br> name = string<br> value = string<br> })), [])<br> rule_contexts = list(object({<br> attributes = optional(list(object({<br> name = string<br> value = string<br> }))) }))<br> enforcement_mode = string<br> }))</pre> | `[]` | no |
140140
| <a name="input_cloud_monitoring_instance_crn"></a> [cloud\_monitoring\_instance\_crn](#input\_cloud\_monitoring\_instance\_crn) | To collect and analyze metrics and security data on hosts using both Monitoring and Workload Protection, pass the CRN of an existing IBM Cloud Monitoring instance to create a connection between instances. Both instances must be in the same region. | `string` | `null` | no |
141141
| <a name="input_cspm_enabled"></a> [cspm\_enabled](#input\_cspm\_enabled) | Enable Cloud Security Posture Management (CSPM) for the Workload Protection instance. This will create a trusted profile associated with the SCC Workload Protection instance that has viewer / reader access to the App Config service and viewer access to the Enterprise service. [Learn more](https://cloud.ibm.com/docs/workload-protection?topic=workload-protection-about). | `bool` | `true` | no |
142142
| <a name="input_name"></a> [name](#input\_name) | The name to give the SCC Workload Protection instance that will be provisioned by this module. | `string` | n/a | yes |

tests/pr_test.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
package test
33

44
import (
5+
"crypto/rand"
56
"fmt"
67
"log"
7-
"math/rand"
8+
"math/big"
89
"os"
910
"strings"
1011
"testing"
@@ -57,10 +58,18 @@ func TestMain(m *testing.M) {
5758
os.Exit(m.Run())
5859
}
5960

61+
func randomRegion() string {
62+
randNum, err := rand.Int(rand.Reader, big.NewInt(int64(len(validRegions))))
63+
if err != nil {
64+
log.Fatal("Failed to generate random region:", err)
65+
}
66+
return validRegions[randNum.Int64()]
67+
}
68+
6069
func TestFullyConfigurable(t *testing.T) {
6170
t.Parallel()
6271

63-
var region = validRegions[rand.Intn(len(validRegions))]
72+
var region = randomRegion()
6473

6574
// ------------------------------------------------------------------------------------
6675
// Provision App Config first
@@ -151,7 +160,7 @@ func TestFullyConfigurable(t *testing.T) {
151160
func TestFullyConfigurableUpgrade(t *testing.T) {
152161
t.Parallel()
153162

154-
var region = validRegions[rand.Intn(len(validRegions))]
163+
var region = randomRegion()
155164

156165
// ------------------------------------------------------------------------------------
157166
// Provision App Config first
@@ -257,7 +266,7 @@ func TestAddonDefaultConfiguration(t *testing.T) {
257266
"deploy-arch-ibm-scc-workload-protection",
258267
"fully-configurable",
259268
map[string]interface{}{
260-
"region": validRegions[rand.Intn(len(validRegions))],
269+
"region": randomRegion(),
261270
},
262271
)
263272

0 commit comments

Comments
 (0)