aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

Add path options to args in EmrAddStepProps

Open rubenjgarcia opened this issue 6 years ago • 1 comments

Add path options to EmrAddStepProps to be able to add step like this:

"My step": {
  "Type": "Task",
  "Resource": "arn:aws:states:::elasticmapreduce:addStep.sync",
  "Parameters": {
    "ClusterId.$": "$.clusterId",
    "Step": {
      "Name.$": "$.name",
      "ActionOnFailure": "CONTINUE",
      "HadoopJarStep": {
        "Jar": "command-runner.jar",
        "Args.$": "$.emrArgs"
      }
    }
  },
  "ResultPath": "$.stepResult",
  "End": true
}

Use Case

I can't pass args from the input parameters

Proposed Solution

Create new arguments in EmrAddStepProps to support this option

Other

  • [X] :wave: I may be able to implement this feature request
  • [ ] :warning: This feature might incur a breaking change

This is a :rocket: Feature Request

rubenjgarcia avatar Feb 23 '20 16:02 rubenjgarcia

Never mind. I was looking at the source code and I found this:

sf.Task(
  self,
  "My step",
  task=sf_tasks.EmrAddStep(
    cluster_id=sf.Data.string_at('$.clusterId'),
    name=sf.Data.string_at('$.name'),
    action_on_failure=sf_tasks.ActionOnFailure.CONTINUE,
    jar="command-runner.jar",
    args=sf.Data.list_at('$.emrArgs'),
  ),
)

rubenjgarcia avatar Feb 23 '20 16:02 rubenjgarcia