Skip to main content

Generate Connection Interface with Workflow

generated-connection Input

To make it easier to use Connections generated by Plugins, a new input type called generated-connection was created for use in version v3 of StackSpot Plugins and Actions specifications. Like all other inputs, it can be used in your Workflow.

generated-connection input example
spec:
...
inputs:
- type: generated-connection
name: some_s3_connection
label: "Give an alias for generated S3 connection"
connection-interface-type: aws-s3-conn
...

In the Workflow, you can use a Jinja expression to access the Connection Interface generated by a Plugin within the Workflow:

steps:
- type: plugin
name: studio/optional_plugin@1
id: apply_optional_plugin
label: Apply optional plugin
when: "{{ boolean_input }}"
inputs:
some_plugin_input: "fixed_value"
other_plugin_input: "{{ text_input | lower }}"
input_from_other_job: "{{ outputs.some_job.some_action_execution.some_action_output }}"
generated-connections:
s3_alias: "{{ some_s3_connection }}"

required-connection Input

When creating an Application using a Workflow that utilizes a Plugin requiring a Connection Interface, you must pass the name of the required-connection input in the Plugin as a parameter.

For example, if you have a Plugin with a Connection Interface defined in your plugin.yaml, as shown below:

inputs:
- label: Select the connection for aws-vpc-conn
type: required-connection
name: my-vpc-conn
connection-interface-type: aws-vpc-conn

In your Workflow, you can create another identical input and pass its value, or use a fixed value, as in the example below:

inputs:
- label: Select the connection for aws-vpc-conn
type: required-connection
name: my-vpc-conn
connection-interface-type: aws-vpc-conn
jobs:
- id: apply_plugin
label: Apply Plugin
steps:
- id: plugin_with_req
type: plugin
name: "my-studio/my-plugin-req@0.0.1"
label: Applying plugin with req
inputs:
my-vpc-conn: "{{ inputs['my-vpc-conn'] }}"