@@ -345,13 +345,12 @@ func TestRunExistingResourcesInstances(t *testing.T) {
345
345
346
346
options := testschematic .TestSchematicOptionsDefault (& testschematic.TestSchematicOptions {
347
347
Testing : t ,
348
- Prefix : "en-ex-res " ,
348
+ Prefix : "enexres " ,
349
349
TarIncludePatterns : []string {
350
350
"*.tf" ,
351
351
fullyConfigurableDADir + "/*.tf" ,
352
- secEnforcedDir + "/*.tf" ,
353
352
},
354
- TemplateFolder : secEnforcedDir ,
353
+ TemplateFolder : fullyConfigurableDADir ,
355
354
Tags : []string {"test-schematic" },
356
355
DeleteWorkspaceOnFail : false ,
357
356
WaitJobCompleteMinutes : 60 ,
@@ -375,13 +374,12 @@ func TestRunExistingResourcesInstances(t *testing.T) {
375
374
376
375
options2 := testschematic .TestSchematicOptionsDefault (& testschematic.TestSchematicOptions {
377
376
Testing : t ,
378
- Prefix : "en-ex-res2 " ,
377
+ Prefix : "enexres2 " ,
379
378
TarIncludePatterns : []string {
380
379
"*.tf" ,
381
380
fullyConfigurableDADir + "/*.tf" ,
382
- secEnforcedDir + "/*.tf" ,
383
381
},
384
- TemplateFolder : secEnforcedDir ,
382
+ TemplateFolder : fullyConfigurableDADir ,
385
383
Tags : []string {"test-schematic" },
386
384
DeleteWorkspaceOnFail : false ,
387
385
WaitJobCompleteMinutes : 60 ,
@@ -395,11 +393,39 @@ func TestRunExistingResourcesInstances(t *testing.T) {
395
393
{Name : "existing_kms_root_key_crn" , Value : terraform .Output (t , existingTerraformOptions , "key_crn" ), DataType : "string" },
396
394
{Name : "kms_endpoint_url" , Value : permanentResources ["hpcs_south_private_endpoint" ], DataType : "string" },
397
395
{Name : "existing_cos_instance_crn" , Value : terraform .Output (t , existingTerraformOptions , "cos_crn" ), DataType : "string" },
396
+ {Name : "kms_encryption_enabled_bucket" , Value : false , DataType : "bool" },
398
397
}
399
398
err2 := options2 .RunSchematicTest ()
400
399
assert .NoError (t , err2 , "TestRunExistingResourcesInstances using existing RG, COS instance, and KMS key Failed" )
401
- }
402
400
401
+ // ------------------------------------------------------------------------------------
402
+ // Deploy EN DA passing in existing RG, COS instance and KMS instance
403
+ // ------------------------------------------------------------------------------------
404
+ options3 := testschematic .TestSchematicOptionsDefault (& testschematic.TestSchematicOptions {
405
+ Testing : t ,
406
+ Prefix : "enexsres3" ,
407
+ TarIncludePatterns : []string {
408
+ "*.tf" ,
409
+ fullyConfigurableDADir + "/*.tf" ,
410
+ },
411
+ TemplateFolder : fullyConfigurableDADir ,
412
+ Tags : []string {"test-schematic" },
413
+ DeleteWorkspaceOnFail : false ,
414
+ WaitJobCompleteMinutes : 60 ,
415
+ })
416
+ options3 .TerraformVars = []testschematic.TestSchematicTerraformVar {
417
+ {Name : "prefix" , Value : options3 .Prefix , DataType : "string" },
418
+ {Name : "ibmcloud_api_key" , Value : options .RequiredEnvironmentVars ["TF_VAR_ibmcloud_api_key" ], DataType : "string" , Secure : true },
419
+ {Name : "region" , Value : region , DataType : "string" },
420
+ {Name : "existing_resource_group_name" , Value : permanentResources ["general_test_storage_cos_instance_resource_group" ], DataType : "string" },
421
+ {Name : "existing_kms_instance_crn" , Value : permanentResources ["hpcs_south_crn" ], DataType : "string" },
422
+ {Name : "kms_endpoint_url" , Value : permanentResources ["hpcs_south_private_endpoint" ], DataType : "string" },
423
+ {Name : "existing_cos_instance_crn" , Value : terraform .Output (t , existingTerraformOptions , "cos_crn" ), DataType : "string" },
424
+ {Name : "cos_bucket_name" , Value : terraform .Output (t , existingTerraformOptions , "bucket_name" ), DataType : "string" },
425
+ }
426
+ err3 := options3 .RunSchematicTest ()
427
+ assert .NoError (t , err3 , "TestRunExistingResourcesInstances using existing RG, COS instance and KMS instance Failed" )
428
+ }
403
429
// Check if "DO_NOT_DESTROY_ON_FAILURE" is set
404
430
envVal , _ := os .LookupEnv ("DO_NOT_DESTROY_ON_FAILURE" )
405
431
// Destroy the temporary existing resources if required
0 commit comments