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

  • new tasks.EmrCreateCluster(this, 'Create Cluster', {
      instances: {},
      name: sfn.TaskInput.fromJsonPathAt('$.ClusterName').value,
      stepConcurrencyLevel: 10,
    });
    
    Docs
    0
  • declare const fn: lambda.Function;
    const submitJob = new tasks.LambdaInvoke(this, 'Invoke Handler', {
      lambdaFunction: fn,
      payload: sfn.TaskInput.fromJsonPathAt('$.input'),
      invocationType: tasks.LambdaInvocationType.EVENT,
    });
    
    Docs
    0
  • declare const fn: lambda.Function;
    new tasks.LambdaInvoke(this, 'Invoke with empty object as payload', {
      lambdaFunction: fn,
      payload: sfn.TaskInput.fromObject({}),
    });
    
    // use the output of fn as input
    new tasks.LambdaInvoke(this, 'Invoke with payload field in the state input', {
      lambdaFunction: fn,
      payload: sfn.TaskInput.fromJsonPathAt('$.Payload'),
    });
    
    Docs
    0
  • const queue = new sqs.Queue(this, 'Queue');
    
    // Use a field from the execution data as message.
    const task1 = new tasks.SqsSendMessage(this, 'Send1', {
      queue,
      messageBody: sfn.TaskInput.fromJsonPathAt('$.message'),
    });
    
    // Combine a field from the execution data with
    // a literal object.
    const task2 = new tasks.SqsSendMessage(this, 'Send2', {
      queue,
      messageBody: sfn.TaskInput.fromObject({
        field1: 'somedata',
        field2: sfn.JsonPath.stringAt('$.field2'),
      }),
    });
    
    Docs
    0
  • const clusterRole = new iam.Role(this, 'ClusterRole', {
      assumedBy: new iam.ServicePrincipal('ec2.amazonaws.com'),
    });
    
    const serviceRole = new iam.Role(this, 'ServiceRole', {
      assumedBy: new iam.ServicePrincipal('elasticmapreduce.amazonaws.com'),
    });
    
    const autoScalingRole = new iam.Role(this, 'AutoScalingRole', {
      assumedBy: new iam.ServicePrincipal('elasticmapreduce.amazonaws.com'),
    });
    
    autoScalingRole.assumeRolePolicy?.addStatements(
      new iam.PolicyStatement({
        effect: iam.Effect.ALLOW,
        principals: [
          new iam.ServicePrincipal('application-autoscaling.amazonaws.com'),
        ],
        actions: [
          'sts:AssumeRole',
        ],
      }));
    )
    
    new tasks.EmrCreateCluster(this, 'Create Cluster', {
      instances: {},
      clusterRole,
      name: sfn.TaskInput.fromJsonPathAt('$.ClusterName').value,
      serviceRole,
      autoScalingRole,
    });
    
    Docs
    0
  • import * as apigateway from '@aws-cdk/aws-apigateway';
    const restApi = new apigateway.RestApi(this, 'MyRestApi');
    
    const invokeTask = new tasks.CallApiGatewayRestApiEndpoint(this, 'Call REST API', {
      api: restApi,
      stageName: 'prod',
      method: tasks.HttpMethod.GET,
    });
    
    Docs
    0
  • import * as apigatewayv2 from '@aws-cdk/aws-apigatewayv2';
    const httpApi = new apigatewayv2.HttpApi(this, 'MyHttpApi');
    
    const invokeTask = new tasks.CallApiGatewayHttpApiEndpoint(this, 'Call HTTP API', {
      apiId: httpApi.apiId,
      apiStack: Stack.of(httpApi),
      method: tasks.HttpMethod.GET,
    });
    
    Docs
    0
  • import * as eks from '@aws-cdk/aws-eks';
    
    const myEksCluster = new eks.Cluster(this, 'my sample cluster', {
      version: eks.KubernetesVersion.V1_18,
      clusterName: 'myEksCluster',
    });
    
    new tasks.EksCall(this, 'Call a EKS Endpoint', {
      cluster: myEksCluster,
      httpMethod: tasks.HttpMethods.GET,
      httpPath: '/api/v1/namespaces/default/pods',
    });
    
    Docs
    0
  • const listBuckets = new tasks.CallAwsService(this, 'ListBuckets', {
      service: 's3',
      action: 'listBuckets',
      iamResources: ['*'],
      iamAction: 's3:ListAllMyBuckets',
    });
    
    Docs
    0
  • declare const myBucket: s3.Bucket;
    const getObject = new tasks.CallAwsService(this, 'GetObject', {
      service: 's3',
      action: 'getObject',
      parameters: {
        Bucket: myBucket.bucketName,
        Key: sfn.JsonPath.stringAt('$.key')
      },
      iamResources: [myBucket.arnForObjects('*')],
    });
    
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples