IBM Cloud Docs
How can I provide value for the schematics_resource_crn variable?

How can I provide value for the schematics_resource_crn variable?

When you run an IBM Cloud Schematics plan or apply action during Schematics infrastructure workspace setup, the resource group that you try to retrieve by using the Schematics_resource_crn cannot be found. Following error are received.

 2022/05/31 09:02:30 Terraform plan | Error: No value for required variable
 2022/05/31 09:02:30 Terraform plan | 
 2022/05/31 09:02:30 Terraform plan |   on variables.tf line 48:
 2022/05/31 09:02:30 Terraform plan |   48: variable "schematics_resource_crn" 
 2022/05/31 09:02:30 Terraform plan | 
 2022/05/31 09:02:30 Terraform plan | The root module input variable "schematics_resource_crn" is not set, and has
 2022/05/31 09:02:30 Terraform plan | no default value. Use a -var or -var-file command line argument to provide a
 2022/05/31 09:02:30 Terraform plan | value for this variable.
 2022/05/31 09:02:30 1m 31mTerraform PLAN error: Terraform PLAN errorexit status 1 39m 0m
 2022/05/31 09:02:30  1m 31mCould not execute job: Error : Terraform PLAN errorexit status 139m 0m

You do not have the needed permissions to use the resource group in IBM Cloud® Identity and Access Management, and provide the value for the schematics_resource_crn variable.

Check whether you have access for the Default or job-runner resource group for creating Schematics workspace for the Schematics Agent infrastructure setup. Then, you need to provide the schematics_resource_crn value to create a VPE for Schematics service by using Terraform. When the VPE is created, the Agent running in your cluster, communicates to the Schematics service over IBM Cloud private endpoint. To fetch the IBM Cloud service instance value, run ibmcloud resource service-instance schematics command.

Example : To retrieve the service instance in all resource groups from your account.

ibmcloud resource service-instance schematics

Output : From the listed output, you need to fetch the ID value for the schematics_resource_crn variable.

Retrieving service instance schematics in all resource groups under account ...
Multiple service instances found
OK
                          
Name:                  schematics   
ID:                    crn:v1:bluemix:public:schematics:eu-de:a/1f7277194bb748cdbxxxxxxcb:ffc6dd7e-f129-4b04-aa5b-8xxxxx4b61d::   
GUID:                  crn:v1:bluemix:public:schematics:eu-de:a/1f7277194bb74xxxxxxx5a7cb:ffc6dd7e-f129-4b04-aa5b-895cxxxxx61d::   
Location:              eu-de   
Service Name:          schematics   
Service Plan Name:     lite   
Resource Group Name:      
State:                 active   
Type:                  service_instance   
Sub Type:                 
Created at:            2021-09-29T08:19:35Z   
Created by:            iam-ServiceId-69153c99-6bc5-4246-a497-16bxxxxx272   
Updated at:            2021-09-29T08:19:35Z   
Last Operation:                        
                       Status    create succeeded      
                       Message   Instance provisioning is completed.