Templates
In the Composition tab, Templates has a list of Terraform templates categorized based on the template provider. The number in parenthesis next to the provider name indicates the number of templates available for that provider.
Procedure
-
Browse through the list of Terraform templates or use the Filter to search for a particular template.
-
Drag a template into your flow. After the template has loaded you can set its parameter values.
Note:
- If you want to use IBM Business Process Manager (BPM) templates, you must have activated them during installation. For information about activating these templates after installation see Enabling or disabling IBM Business Process Manager.
- This list contains templates that are globally accessible and templates that belong to the services namespace.
-
Check Editable if you want to edit these parameters while editing the service instance.
-
Select or enter the following values for Basic information:
-
Title - Enter title for the template activity.
-
Activity ID - The ID is automatically generated and is read-only.
-
Template name - The name of the template. This field is read-only.
-
Template provider - The name of the provider. This field is read-only.
-
Version - Select the version of the template. The templates default version is preselected.
Note: If you switch versions, the service parameters are overwritten with the values from the selected version.
-
Terraform version - Select the Terraform version used to deploy the template.
-
Use compatible version - By default, this is checked. During deployment, if the selected Terraform version is not found, then the first compatible Terraform version is used based on the constraints that are defined in the template. You can uncheck this option if you want to use a specific Terraform version.
-
Instance name - Enter the instance name of the template activity.
-
Connection - Connections that are globally accessible or in the same namespace as the service are available for selection. There are different ways to enter values for the connection:
-
Select an existing connection from the drop-down list. Support is extended for IBM Cloud Pak for AIOps connections and connections to an external IBM Cloud Kubernetes Service.
-
You can create dynamic connections where the connection details are fetched at runtime. The output of a previous activity in the flow can be mapped to the connection field as follows:
${activity.id.output.paramname}
-
To link the connection to an existing parameter:
-
Click Link parameter in the Activity details pane to map a new parameter.
-
In the Link parameter dialog, click Link.
-
Click Input Parameters to see a list of parameters available in the Input parameters section of the main Parameters tab.
-
Click Templates to see a list of parameters from all template activities in the flow before this template.
The values displayed change based on what options you select and which activities you have used in your service workflow.
Note: For example, if there are two templates A and B placed in sequence in the Provision action of the Composition tab, then parameters of both templates are shown in the Activity parameters section of the Parameters tab. If you want to link a parameter of template B, then the parameters of template A and shared parameters are available for linking. If your service includes Business Process Manager activities or Helm charts, then they are also available for linking. For the first activity, template A, you can only link to service level parameters and shared parameters.
-
You can use Search parameter to filter and find parameters.
-
Hover over a parameter to see a plus icon.
-
Click the plus icon to select it. A green tick mark indicates your selection and the Value is refreshed.
-
Click Save.
-
-
To create a parameter and link it at the same time:
- In the Link parameter dialog, click Create.
- Enter a value for the Parameter key.
- The End-user permission is set based on the permission of the parameter being linked.
- Enter the parameter values:
- Editable - Check the box if you want to edit these parameters while editing the service instance.
- Parameter type - Set to
connection
and is read-only. - Display name - The label or display name for the parameter.
- Default value - Optionally, select a cloud connection. If you do not select a value during creation time, you must specify it during deployment.
- Cloud provider - Set to the cloud provider for the template and is read-only.
- Description - The description appears as a tooltip for this parameter when the customer orders this service.
- Click Save to save the new parameter and link it to your connection.
-
Note: For an IBM Business Process Manager (BPM) connection, you do not have create a connection explicitly in the Manage > Cloud connections page. You can directly select the "BPM Connection" value from the Connection drop-down list. You do not have to provide any credentials for the connection as the service deployment gets the IBM BPM connection details from environment variables.
-
-
Content runtime - For middleware templates, you must enter values for content runtime. It is a required value.
Note: For middleware templates, you can select an Automated Content Runtime that is not deployed on the same cloud provided proper network connectivity exists.
Click Link parameter in the Activity details pane to link the value to a parameter:
-
To link to an existing parameter:
-
In the Link parameter dialog, click Link.
-
Select a linking option. You can link parameter values using the Input parameters and Templates menu options in the Link Parameter dialog:
-
Input parameters - The list of parameters available in the Input parameters section of the main Parameters tab
-
Templates - The list of parameters from all template activities in the flow before this template.
The values displayed change based on what options you select and which activities you have used in your service workflow.
Note: For example, if there are two templates A and B placed in sequence in the Provision action of the Composition tab, then parameters of both the templates are available in the Activity parameters section of the Parameters tab. If you want to link a parameter of template B, then a list of all parameters of the template A and shared parameters are available for association. If your service involves Business Process Manager activities and Helm charts, then they are also available for linking. For the first activity, template A, you can only link input parameters and shared parameters.
-
-
Expand the parameter menu and hover over a parameter to see a plus icon.
-
Click the plus icon to select it. A green tick mark indicates your selection and the Value is refreshed.
-
Click Save.
-
You can also click Remove link in the Link parameter dialog box to remove a mapping.
-
-
To create a parameter and link it at the same time:
- In the Link parameter dialog, click Create.
- Enter a value for the Parameter key.
- The End-user permission is set based on the permission of the parameter being linked.
- Enter the parameter values:
- Parameter type - Set to
sharedparameter
and is read-only. - Display name - The label or display name for the parameter.
- Data type - Set to
Advanced content runtime
and is read-only. - Description - The description appears as a tooltip for this parameter when the customer orders this service.
- Value - Select a Data Object.
- Parameter type - Set to
- Click Save to create and save the new parameter.
-
-
If any of the Terraform templates have shared parameters in their definition, then the Data Types are displayed in the Basic information tab. You must select values for the Data Objects that are associated with the Data Types.
Instead of hard coding the value of a Data Object, link shared parameter values to parameters. To create a parameter:
-
Create a parameter in the Parameters tab with type
String
. -
In the Source code tab, change the type to
sharedparameter
and provide a value fordatatype
. For example, this parameter has typesharedparameter
and is associated to thebastionhost
Data Type."input_parameters": [ { "name": "shared", "label": "shared", "customtype": "string", "type": "sharedparameter", "datatype": "bastionhost", "immutable": false, "hidden": false, "required": false, "secured": false } ],
-
For the Data Object value in the Parameters section of the Composition tab, you can enter a dynamic expression:
The format of the expression is as follows:
${input_parameters.shared}
For the behavior of this dynamic Data Object, see Creating a service instance. You must define a default Data Object whenever the Data Type has multiple Data Objects.
Click Link parameter in the Activity details pane to link the value to a parameter:
-
To link to an existing parameter:
-
In the Link parameter dialog, click Link.
-
Select a linking option. You can link parameter values using the Input parameters and Templates menu options in the Link Parameter dialog:
- Input parameters - The list of parameters available in the Input parameters section of the main Parameters tab
- Templates - The list of parameters from all template activities in the flow before this template.
The values displayed change based on what options you select and which activities you have used in your service workflow.
Note: For example, if there are two templates A and B placed in sequence in the Provision action of the Composition tab, then parameters of both the templates are available in the Activity parameters section of the Parameters tab. If you want to link a parameter of template B, then a list of all parameters of the template A and shared parameters are available for association. If your service involves Business Process Manager activities and helm charts, then they are also available for linking. For the very first activity, template A, you can only link input parameters and shared parameters.
-
Expand the parameter menu and hover over a parameter to see a plus icon.
-
Click the plus icon to select it. A green tick mark indicates your selection and the Value is refreshed.
-
Click Save.
-
You can also click Remove Link in the Link parameter dialog to remove a mapping.
-
-
To create a parameter and link it at the same time:
- In the Link parameter dialog, click Create.
- Enter a value for the Parameter key.
- The End-user permission is set based on the permission of the parameter being linked.
- Enter the parameter values:
- Parameter type - Set to
sharedparameter
and is read-only. - Display name - The label or display name of the parameter.
- Data type - The Data Type value is preselected. You cannot change the value.
- Description - The description appears as a tooltip for this parameter when the customer orders this service.
- Value - Select a Data Object.
- Parameter type - Set to
- Click Save to create and save the new parameter.
-
-
For information about shared parameters in interpolation expressions, see Using shared parameters in service interpolations and Data Types in Service Composition Language.
For information about Data Types and Data Objects, see Shared parameters.
For managing shared parameters from Managed services, see Managing Data Objects from the user interface.
-
-
Update the details in Parameters tab. For more information, see Parameters tab of an activity.
Notes:
-
If you use a long running BPM template in your service that requires claim and approvals by the administrator of Business Process Manager, include the following parameters in the source code tab as follows:
"async_req": true "long_running_delay": "<time in minutes>", "long_running_timeout": "<time in hour>"
The async_req field is not shown in the Parameters tab. To change its value use the Source code tab.
For more details, see Example of a Business Process Manager template in Service Composition Language Structure topic.
-
If a variable in a Business Process Manager template is not Boolean or String, then Managed services considers it as a String. For complex type input parameters, provide the JSON as string. For example:
-
Template input parameters in Business Process Manager:
{ "inputString": { "type": "String", "isList": false }, "inputInteger": { "type": "Integer", "isList": false }, "inputBoolean": { "type": "Boolean", "isList": false }, "parent": { "type": "ParentData", "isList": false } }
-
Template input parameter values in Managed services:
inputString = Bob inputInteger = 555 inputBoolean = false parent = {"Name": "David", "Child": {"id": 21, "Name":"John"}}
-