When you create a cloud template in Automation Assembler, the resource type palette includes resource types for the supported cloud account and integration endpoints. You might have use cases where you want to create cloud templates based on an expanded list of resource types. You can create custom resource types, add them to the design canvas, and create cloud templates that support your design and deployment needs.
Custom resource name and resource type
The custom resource name identifies your custom resource inside the cloud template resource type palette.
The resource type of a custom resource must begin with Custom. and each resource type must be unique. For example, you might set Custom.ADUser
as a resource type for a custom resource that adds Active Directory users. Although the inclusion of Custom. is not validated in the text box, the string is automatically added if you remove it.
Extensibility action custom resources
With custom resource types, you can use extensibility actions in cloud templates to build complex applications. For example, you can use the native integration of extensibility actions with Amazon Web Services and Microsoft Azure to easily integrate with their respective services. You can create extensibility action custom resources by clicking on the Based on option in the custom resource editor and selecting ABX user-defined schema.
Lifecycle actions for extensibility action custom resources
When using a extensibility action for your custom resource, you can define the following lifecycle actions:
- Create: this extensibility action is called when a deployment is started.
- Read: this extensibility action is used to retrieve the latest state of the deployed resource.
- Update: this extensibility action is called when a cloud template property is updated. This action is triggered only when a property is not marked with
recreateOnUpdate
. - Destroy: this extensibility action is called when a deployment is deleted.
These lifecycle actions can either be selected manually from your existing extensibility actions or generated automatically by selecting Generate Actions. When you select Generate Actions you must specify the project in which the new extensibility action will be generated in.
Automation Orchestrator custom resources
Properties
,
Date
,
string
, and
number
are not supported for the creation of custom resource types.
AD:UserGroup
is an SDK object type used to manage Active Directory user groups.
Automation Orchestrator custom resource external type
The external type property defines the type of your Automation Orchestrator custom resource. When you select a Create workflow in your custom resource type in Automation Assembler, the external type drop-down appears underneath it. The drop-down includes external type properties, that are selected from the output parameters of the Automation Orchestrator workflow. The selected workflow output properties included in the drop-down must be non-array SDK object types such as VC:VirtualMachine
or AD:UserGroup
.
DynamicTypesManager.getObject()
method.
When you define your custom resource types, you also define the scope of the availability of the select external type. The selected external type can be:
- Shared across projects.
- Available only for the selected project.
You can only have one custom resource type with a specific external type value per defined scope. For example, if you create a custom resource in your project that uses VC:VirtualMachine
as an external type, you cannot create another custom resource for the same project that uses the same external type. You also cannot create two shared custom resources that use the same external type.
Automation Orchestrator lifecycle action validation
When you add Create, Delete, and Update workflows as lifecycle actions to your custom resource, Automation Assembler validates that the selected workflows have correct input and output property definitions.
- The Create workflow must have an output parameter that is an SDK object type, such as
SSH:Host
orSQL:Database
. If the selected workflow does not pass the validation, you cannot add Update or Delete workflows, or save your changes to the custom resource. - The Delete workflow must have an input parameter that is an SDK object type that matches the external type of the custom resource.
- The Update workflow must have both an input and output parameter that is an SDK object type that matches the external type of the custom resource.
Custom resource property schema
domain
and
location
, the
Read action must also return the same properties with the same names.
You can edit the property schema for custom resources by navigating to the Properties tab and using either the Code or Form tab.
- Code: Edit the property schema by using YAML content. When selecting this option, the property schema is defined by using the JSON Schema.
- Form: For extensibility action custom resources, by clicking New Property, you create a new property by configuring its name, display name, description, property type, and default value. For Automation Orchestrator custom resources, you can also hide non-required and non-computed properties from the schema by clicking Remove Property.
Day 2 Operation Custom Request Forms
You can streamline the request form of the day 2 operations included in your custom resource by adding and modifying different types of resource properties.
For example, you can bind the value of an input parameter in your request form to an external source, such as a Automation Orchestrator action that retrieves a deployment name or project name. You can also bind the value of a specific input parameter to the computed value of two other text boxes included in the same request form.
Day 2 Operation Request Form Validation
You can validate the request form of your day 2 operations by adding an external validation. By using an external validation, you prevent the user from submitting the request form until the validation parameters are satisfied. You can add external validation from the Validations tab of the Request Parameters page of the custom resource or resource action editor. After selecting the tab, you can drag a Orchestrator validation element to the canvas and add a Automation Orchestrator action that you want to use for validation.
For example, you can create a custom resource that includes a day 2 operation for changing a user password. For such a use case, you can add a Automation Orchestrator action with newPassword
and confirmPassword
input parameters that use the SecureString
type.
if (newPassword != confirmPassword) { return 'passwords are different'; } if (newPassword.lenght < 7) { return 'password must be at least 10 symbols'; } return null;