Skip to content

Commit 116915d

Browse files
committed
SKIP UPGRADE TEST add sec enforced to catalog, fix unit tests
1 parent f895078 commit 116915d

File tree

3 files changed

+238
-18
lines changed

3 files changed

+238
-18
lines changed

ibm_catalog.json

Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,237 @@
318318
"key": "service_endpoints"
319319
}
320320
]
321+
},
322+
{
323+
"label": "Security enforced",
324+
"name": "security-enforced",
325+
"install_type": "fullstack",
326+
"working_directory": "solutions/security-enforced",
327+
"compliance": {
328+
"authority": "scc-v3",
329+
"profiles": [
330+
{
331+
"profile_name": "IBM Cloud Framework for Financial Services",
332+
"profile_version": "1.7.0"
333+
}
334+
]
335+
},
336+
"iam_permissions": [
337+
{
338+
"role_crns": [
339+
"crn:v1:bluemix:public:iam::::role:Administrator"
340+
],
341+
"service_name": "all-account-management-services"
342+
},
343+
{
344+
"role_crns": [
345+
"crn:v1:bluemix:public:iam::::role:Editor"
346+
],
347+
"service_name": "databases-for-postgresql"
348+
},
349+
{
350+
"role_crns": [
351+
"crn:v1:bluemix:public:iam::::serviceRole:Manager",
352+
"crn:v1:bluemix:public:iam::::role:Editor"
353+
],
354+
"service_name": "kms"
355+
}
356+
],
357+
"architecture": {
358+
"descriptions": "This architecture creates an instance of IBM Cloud Databases for PostgreSQL instance with KMS encryption. Supports autoscaling.",
359+
"features": [
360+
{
361+
"title": " Creates an instance of Databases for PostgreSQL",
362+
"description": "This architecture creates an instance of IBM Cloud Databases for PostgreSQL with KMS encryption. It accepts or creates a resource group, and provides autoscaling rules."
363+
}
364+
],
365+
"diagrams": [
366+
{
367+
"diagram": {
368+
"caption": "Databases for PostgreSQL instance on IBM Cloud",
369+
"url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-icd-postgresql/main/reference-architecture/deployable-architecture-postgresql.svg",
370+
"type": "image/svg+xml"
371+
},
372+
"description": "This architecture supports creating and configuring an instance of Databases for PostgreSQL instance with KMS encryption."
373+
}
374+
]
375+
},
376+
"configuration": [
377+
{
378+
"key": "ibmcloud_api_key"
379+
},
380+
{
381+
"key": "existing_resource_group_name",
382+
"required": true,
383+
"custom_config": {
384+
"type": "resource_group",
385+
"grouping": "deployment",
386+
"original_grouping": "deployment",
387+
"config_constraints": {
388+
"identifier": "rg_name"
389+
}
390+
}
391+
},
392+
{
393+
"key": "prefix",
394+
"required": true
395+
},
396+
{
397+
"key": "region",
398+
"required": true,
399+
"default_value": "us-south",
400+
"options": [
401+
{
402+
"displayname": "Chennai (che01)",
403+
"value": "che01"
404+
},
405+
{
406+
"displayname": "Dallas (us-south)",
407+
"value": "us-south"
408+
},
409+
{
410+
"displayname": "Frankfurt (eu-de)",
411+
"value": "eu-de"
412+
},
413+
{
414+
"displayname": "London (eu-gb)",
415+
"value": "eu-gb"
416+
},
417+
{
418+
"displayname": "Madrid (eu-es)",
419+
"value": "eu-es"
420+
},
421+
{
422+
"displayname": "Osaka (jp-osa)",
423+
"value": "jp-osa"
424+
},
425+
{
426+
"displayname": "Paris (par01)",
427+
"value": "par01"
428+
},
429+
{
430+
"displayname": "Sao Paulo (br-sao)",
431+
"value": "br-sao"
432+
},
433+
{
434+
"displayname": "Sydney (au-syd)",
435+
"value": "au-syd"
436+
},
437+
{
438+
"displayname": "Toronto (ca-tor)",
439+
"value": "ca-tor"
440+
},
441+
{
442+
"displayname": "Tokyo (jp-tok)",
443+
"value": "jp-tok"
444+
},
445+
{
446+
"displayname": "Washington (us-east)",
447+
"value": "us-east"
448+
}
449+
]
450+
},
451+
{
452+
"key": "postgresql_name"
453+
},
454+
{
455+
"key": "postgresql_version",
456+
"required": false,
457+
"default_value": "__NULL__",
458+
"options": [
459+
{
460+
"displayname": "preferred",
461+
"value": "__NULL__"
462+
},
463+
{
464+
"displayname": "13",
465+
"value": "13"
466+
},
467+
{
468+
"displayname": "14",
469+
"value": "14"
470+
},
471+
{
472+
"displayname": "15",
473+
"value": "15"
474+
},
475+
{
476+
"displayname": "16",
477+
"value": "16"
478+
},
479+
{
480+
"displayname": "17",
481+
"value": "17"
482+
}
483+
]
484+
},
485+
{
486+
"key": "members"
487+
},
488+
{
489+
"key": "member_memory_mb"
490+
},
491+
{
492+
"key": "member_cpu_count"
493+
},
494+
{
495+
"key": "member_disk_mb"
496+
},
497+
{
498+
"key": "member_host_flavor"
499+
},
500+
{
501+
"key": "configuration"
502+
},
503+
{
504+
"key": "service_credential_names"
505+
},
506+
{
507+
"key": "admin_pass"
508+
},
509+
{
510+
"key": "users"
511+
},
512+
{
513+
"key": "postgresql_resource_tags"
514+
},
515+
{
516+
"key": "postgresql_access_tags"
517+
},
518+
{
519+
"key": "ibmcloud_kms_api_key"
520+
},
521+
{
522+
"key": "existing_kms_instance_crn"
523+
},
524+
{
525+
"key": "existing_kms_key_crn"
526+
},
527+
{
528+
"key": "skip_postgresql_kms_auth_policy"
529+
},
530+
{
531+
"key": "key_ring_name"
532+
},
533+
{
534+
"key": "key_name"
535+
},
536+
{
537+
"key": "auto_scaling"
538+
},
539+
{
540+
"key": "backup_crn"
541+
},
542+
{
543+
"key": "existing_backup_kms_key_crn"
544+
},
545+
{
546+
"key": "remote_leader_crn"
547+
},
548+
{
549+
"key": "existing_postgresql_instance_crn"
550+
}
551+
]
321552
}
322553
]
323554
}
Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
11
terraform {
22
required_version = ">= 1.3.0"
3-
43
# Lock DA into an exact provider version - renovate automation will keep it updated
5-
required_providers {
6-
ibm = {
7-
source = "IBM-Cloud/ibm"
8-
version = "1.78.0"
9-
}
10-
time = {
11-
source = "hashicorp/time"
12-
version = "0.13.1"
13-
}
14-
random = {
15-
source = "hashicorp/random"
16-
version = "3.7.2"
17-
}
18-
}
4+
required_providers {}
195
}

tests/pr_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ func TestRunFullyConfigurableSolutionSchematics(t *testing.T) {
7979
})
8080

8181
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
82+
{Name: "prefix", Value: options.Prefix, DataType: "string"},
8283
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
8384
{Name: "access_tags", Value: permanentResources["accessTags"], DataType: "list(string)"},
8485
{Name: "kms_encryption_enabled", Value: true, DataType: "bool"},
@@ -88,7 +89,7 @@ func TestRunFullyConfigurableSolutionSchematics(t *testing.T) {
8889
{Name: "existing_backup_kms_key_crn", Value: permanentResources["hpcs_south_root_key_crn"], DataType: "string"},
8990
{Name: "kms_endpoint_type", Value: "private", DataType: "string"},
9091
{Name: "postgresql_version", Value: "16", DataType: "string"}, // Always lock this test into the latest supported PostgresSQL version
91-
{Name: "existing_resource_group_name", Value: options.Prefix, DataType: "string"},
92+
{Name: "existing_resource_group_name", Value: resourceGroup, DataType: "string"},
9293
{Name: "admin_pass", Value: GetRandomAdminPassword(t), DataType: "string"},
9394
}
9495
err := options.RunSchematicTest()
@@ -147,12 +148,13 @@ func TestRunSecurityEnforcedSolutionSchematics(t *testing.T) {
147148
})
148149

149150
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
151+
{Name: "prefix", Value: options.Prefix, DataType: "string", Secure: true},
150152
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
151153
{Name: "postgresql_access_tags", Value: permanentResources["accessTags"], DataType: "list(string)"},
152154
{Name: "existing_kms_instance_crn", Value: permanentResources["hpcs_south_crn"], DataType: "string"},
153155
{Name: "existing_backup_kms_key_crn", Value: permanentResources["hpcs_south_root_key_crn"], DataType: "string"},
154156
{Name: "postgresql_version", Value: "16", DataType: "string"}, // Always lock this test into the latest supported PostgresSQL version
155-
{Name: "existing_resource_group_name", Value: options.Prefix, DataType: "string"},
157+
{Name: "existing_resource_group_name", Value: "geretain-test-postgres-security-enforced", DataType: "string"},
156158
{Name: "admin_pass", Value: GetRandomAdminPassword(t), DataType: "string"},
157159
}
158160
err := options.RunSchematicTest()
@@ -314,9 +316,10 @@ func TestRunExistingInstance(t *testing.T) {
314316
})
315317

316318
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
319+
{Name: "prefix", Value: options.Prefix, DataType: "string"},
317320
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
318321
{Name: "existing_postgresql_instance_crn", Value: terraform.Output(t, existingTerraformOptions, "postgresql_crn"), DataType: "string"},
319-
{Name: "existing_resource_group_name", Value: fmt.Sprintf("%s-resource-group", prefix), DataType: "string"},
322+
{Name: "existing_resource_group_name", Value: resourceGroup, DataType: "string"},
320323
{Name: "region", Value: region, DataType: "string"},
321324
{Name: "provider_visibility", Value: "public", DataType: "string"},
322325
}

0 commit comments

Comments
 (0)