SHARE
TWEET

Untitled

a guest Oct 21st, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import core = require('@aws-cdk/core');
  2. import sfn  = require('@aws-cdk/aws-stepfunctions');
  3.  
  4. export interface ParameterizedPassProps extends sfn.PassProps {
  5.   parameters: { [name: string]: any };
  6. }
  7.  
  8. export class ParameterizedPass extends sfn.Pass {
  9.   private parameterizedProps: ParameterizedPassProps;
  10.  
  11.   constructor(parentConstruct: core.Construct, id: string, parameterizedProps: ParameterizedPassProps) {
  12.     super(parentConstruct, id, parameterizedProps);
  13.     this.parameterizedProps = parameterizedProps;
  14.   }
  15.  
  16.   public toStateJson(): object {
  17.     const stateJson = {
  18.       ...super.toStateJson(),
  19.       Parameters: this.parameterizedProps.parameters
  20.     };
  21.     return stateJson;
  22.   }
  23. }
  24.  
  25. const passSfnTask = new ParameterizedPass(
  26.   this,
  27.   'pass',
  28.   {
  29.     parameters: {
  30.       'x.$': '$.foo.a',
  31.       'y.$': '$.foo.b'
  32.     },
  33.     resultPath: '$.bar'
  34.   }
  35. );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top