How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • import * as dynamodb from '@aws-cdk/aws-dynamodb';
    
    // create a table
    const table = new dynamodb.Table(this, 'montable', {
      partitionKey: {
        name: 'id',
        type: dynamodb.AttributeType.STRING,
      },
    });
    
    const finalStatus = new sfn.Pass(this, 'final step');
    
    // States language JSON to put an item into DynamoDB
    // snippet generated from https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-code-snippet.html#tutorial-code-snippet-1
    const stateJson = {
      Type: 'Task',
      Resource: 'arn:aws:states:::dynamodb:putItem',
      Parameters: {
        TableName: table.tableName,
        Item: {
          id: {
            S: 'MyEntry',
          },
        },
      },
      ResultPath: null,
    };
    
    // custom state which represents a task to insert data into DynamoDB
    const custom = new sfn.CustomState(this, 'my custom task', {
      stateJson,
    });
    
    const chain = sfn.Chain.start(custom)
      .next(finalStatus);
    
    const sm = new sfn.StateMachine(this, 'StateMachine', {
      definition: chain,
      timeout: Duration.seconds(30),
    });
    
    // don't forget permissions. You need to assign them
    table.grantWriteData(sm);
    
    Docs
    0
  • // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import * as stepfunctions from '@aws-cdk/aws-stepfunctions';
    
    declare const state: stepfunctions.State;
    
    const stateGraph = new stepfunctions.StateGraph(state, 'graphDescription');
    
    Docs
    0
  • // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import * as stepfunctions from '@aws-cdk/aws-stepfunctions';
    
    const errors = new stepfunctions.Errors();
    
    Docs
    0
  • // Makes the current JSON state { ..., "subObject": { "hello": "world" } }
    const pass = new sfn.Pass(this, 'Add Hello World', {
      result: sfn.Result.fromObject({ hello: 'world' }),
      resultPath: '$.subObject',
    });
    
    // Set the next state
    const nextState = new sfn.Pass(this, 'NextState');
    pass.next(nextState);
    
    Docs
    0
  • const map = new sfn.Map(this, 'Map State', {
      maxConcurrency: 1,
      itemsPath: sfn.JsonPath.stringAt('$.inputForMap'),
    });
    map.iterator(new sfn.Pass(this, 'Pass State'));
    
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples