Skip to content

Commit 36bbc98

Browse files
authored
feat: support "graduated-tier-sysdig-secure-plus-monitor" plan (#61)
1 parent 95477b5 commit 36bbc98

File tree

5 files changed

+31
-9
lines changed

5 files changed

+31
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ You need the following permissions to run this module.
172172
| <a name="input_instance_name"></a> [instance\_name](#input\_instance\_name) | The name of the IBM Cloud Monitoring instance to create. Defaults to 'cloud-monitoring-<region>' | `string` | `null` | no |
173173
| <a name="input_manager_key_name"></a> [manager\_key\_name](#input\_manager\_key\_name) | The name to give the IBM Cloud Monitoring manager key. | `string` | `"SysdigManagerKey"` | no |
174174
| <a name="input_manager_key_tags"></a> [manager\_key\_tags](#input\_manager\_key\_tags) | Tags associated with the IBM Cloud Monitoring manager key. | `list(string)` | `[]` | no |
175-
| <a name="input_plan"></a> [plan](#input\_plan) | The IBM Cloud Monitoring plan to provision. Available: lite, graduated-tier | `string` | `"lite"` | no |
175+
| <a name="input_plan"></a> [plan](#input\_plan) | The IBM Cloud Monitoring plan to provision. Available: lite, graduated-tier and graduated-tier-sysdig-secure-plus-monitor (available in region eu-fr2 only) | `string` | `"lite"` | no |
176176
| <a name="input_region"></a> [region](#input\_region) | The IBM Cloud region where Cloud Monitoring instance will be created. | `string` | `"us-south"` | no |
177177
| <a name="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id) | The id of the IBM Cloud resource group where the Cloud Monitoring instance will be created. | `string` | n/a | yes |
178178
| <a name="input_resource_tags"></a> [resource\_tags](#input\_resource\_tags) | Tags associated with the IBM Cloud Monitoring instance (Optional, array of strings). | `list(string)` | `[]` | no |

ibm_catalog.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,16 @@
134134
"required": true,
135135
"options": [
136136
{
137-
"displayname": "graduated-tier",
137+
"displayname": "Graduated tier",
138138
"value": "graduated-tier"
139139
},
140140
{
141-
"displayname": "lite",
141+
"displayname": "Lite",
142142
"value": "lite"
143+
},
144+
{
145+
"displayname": "Graduated tier Sysdig Secure plus Monitor",
146+
"value": "graduated-tier-sysdig-secure-plus-monitor"
143147
}
144148
]
145149
},

solutions/fully-configurable/variables.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,17 @@ variable "cloud_monitoring_access_tags" {
7979

8080
variable "cloud_monitoring_plan" {
8181
type = string
82-
description = "The IBM Cloud Monitoring plan to provision. Available values are `lite` and `graduated-tier`."
82+
description = "The IBM Cloud Monitoring plan to provision. Available values are `lite` and `graduated-tier` and graduated-tier-sysdig-secure-plus-monitor (available in region eu-fr2 only)."
8383
default = "graduated-tier"
8484

8585
validation {
86-
condition = can(regex("^lite$|^graduated-tier$", var.cloud_monitoring_plan))
87-
error_message = "Specify one of the following values for the `cloud_monitoring_plan`: `lite` or `graduated-tier`."
86+
condition = can(regex("^lite$|^graduated-tier$|^graduated-tier-sysdig-secure-plus-monitor$", var.cloud_monitoring_plan))
87+
error_message = "The plan value must be one of the following: lite, graduated-tier and graduated-tier-sysdig-secure-plus-monitor (available in region eu-fr2 only)."
88+
}
89+
90+
validation {
91+
condition = (var.cloud_monitoring_plan != "graduated-tier-sysdig-secure-plus-monitor") || var.region == "eu-fr2"
92+
error_message = "When cloud_monitoring_plan is graduated-tier-sysdig-secure-plus-monitor region should be set to eu-fr2."
8893
}
8994
}
9095

tests/pr_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var validRegions = []string{
2929
"ca-tor",
3030
"eu-de",
3131
"eu-gb",
32+
"eu-fr2",
3233
"jp-osa",
3334
"jp-tok",
3435
"us-south",
@@ -40,6 +41,12 @@ func TestRunFullyConfigurable(t *testing.T) {
4041

4142
region := validRegions[rand.Intn(len(validRegions))]
4243
prefix := "icm-da"
44+
plan := "lite"
45+
46+
// when region is 'eu-fr2' take opportunity to test 'graduated-tier-sysdig-secure-plus-monitor' plan
47+
if region == "eu-fr2" {
48+
plan = "graduated-tier-sysdig-secure-plus-monitor"
49+
}
4350

4451
// Verify ibmcloud_api_key variable is set
4552
checkVariable := "TF_VAR_ibmcloud_api_key"
@@ -68,6 +75,7 @@ func TestRunFullyConfigurable(t *testing.T) {
6875
{Name: "region", Value: region, DataType: "string"},
6976
{Name: "cloud_monitoring_resource_tags", Value: options.Tags, DataType: "list(string)"},
7077
{Name: "prefix", Value: options.Prefix, DataType: "string"},
78+
{Name: "cloud_monitoring_plan", Value: plan, DataType: "string"},
7179
}
7280

7381
err := options.RunSchematicTest()

variables.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,17 @@ variable "instance_name" {
1717

1818
variable "plan" {
1919
type = string
20-
description = "The IBM Cloud Monitoring plan to provision. Available: lite, graduated-tier"
20+
description = "The IBM Cloud Monitoring plan to provision. Available: lite, graduated-tier and graduated-tier-sysdig-secure-plus-monitor (available in region eu-fr2 only)"
2121
default = "lite"
2222

2323
validation {
24-
condition = can(regex("^lite$|^graduated-tier$", var.plan))
25-
error_message = "The plan value must be one of the following: lite, graduated-tier."
24+
condition = can(regex("^lite$|^graduated-tier$|^graduated-tier-sysdig-secure-plus-monitor$", var.plan))
25+
error_message = "The plan value must be one of the following: lite, graduated-tier and graduated-tier-sysdig-secure-plus-monitor (available in region eu-fr2 only)."
26+
}
27+
28+
validation {
29+
condition = (var.plan != "graduated-tier-sysdig-secure-plus-monitor") || var.region == "eu-fr2"
30+
error_message = "When plan is graduated-tier-sysdig-secure-plus-monitor region should be set to eu-fr2."
2631
}
2732
}
2833

0 commit comments

Comments
 (0)