Inputs

inputs are parameters passed to a service template when it is instantiated. These parameters can be referenced by using the get_input TOSCA function.

Inputs are useful when there’s a need to inject parameters to the service template which were unknown when the service template was created and can vary across different deployments of the same service template.

See Topology Inputs on how to pass inputs to a service template.

Declaration

topology_template:
  inputs:

    input1:
      type:
      ...
    input2:
      type:
      ...

Definition

Keyname

Required

Type

Description

description

no

string

An optional description for the input.

type

no

string

Represents the required data type of the input. Not specifying a data type means the type can be anything.

default

no

<any>

An optional default value for the input.

See also

For the full specification, see the TOSCA Input section.

Example

tosca_definitions_version: tosca_simple_unfurl_1_0_0
topology_template:
  inputs:

    image_name:
      description: The image name of the server
      type: string
      default: "Ubuntu 12.04"

  node_templates:

    vm:
      type: MyVM
      properties:
          image_name: { get_input: image_name }
from tosca import TopologyInputs

class Inputs(TopologyInputs):
    image_name: str = "Ubuntu 12.04"

vm = MyVM(image_name=Inputs.image_name)