0

I have a Lambda function that activates a datapipeline:

client.activate_pipeline(
    pipelineId='df-0680373LNPNFF73UDDD',
    parameterValues=[{'id':'myVariable','stringValue':'ok'}])

How do I configure the datapipeline to receive the parameterValues at activation. I want to pass the parameter value 'ok' to a ShellCommandActivity via Script Argument for example.

mike65535
  • 483
  • 2
  • 10
  • 21
Med Acc
  • 3
  • 2

1 Answers1

2

In AWS Datapipeline you create parameters/variables & define its usage at time of putting pipeline definition.
Then parameter values can be either provided at same time put-pipeline-defintion or can be overridden at time of pipeline-activation.

If parameter is declared as myVariable, it can be referred inside pipeline object as #{myVariable}

client.put_pipeline_definition(
        pipelineId='myPipeline',
        pipelineObjects=[
            {
                'id': 'CreateDirectory',
                "type" : "ShellCommandActivity",
                'name': 'CreateDirectory',
                'fields': [
                    {
                        'key': 'command',
                        'stringValue': 'mkdir #{myVariable}'
                    }
                ]
            }
        ],
        parameterObjects=[
            {
                'id': 'myVariable',
                'attributes': [
                    {
                        'key': 'description',
                        'stringValue': 'The directory to be created'
                    }
                ]
            }
        ],


client.activate_pipeline(
    pipelineId='df-0680373LNPNFF73UDDD',
    parameterValues=[{'id':'myVariable','stringValue':'ok'}])
Amith Kumar
  • 4,400
  • 1
  • 21
  • 28