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

  • // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import * as ecs from '@aws-cdk/aws-ecs';
    import * as stepfunctions from '@aws-cdk/aws-stepfunctions';
    import * as stepfunctions_tasks from '@aws-cdk/aws-stepfunctions-tasks';
    
    declare const cluster: ecs.Cluster;
    declare const containerDefinition: ecs.ContainerDefinition;
    declare const parameters: any;
    declare const taskDefinition: ecs.TaskDefinition;
    const ecsRunTaskBase = new stepfunctions_tasks.EcsRunTaskBase({
      cluster: cluster,
      taskDefinition: taskDefinition,
    
      // the properties below are optional
      containerOverrides: [{
        containerDefinition: containerDefinition,
    
        // the properties below are optional
        command: ['command'],
        cpu: 123,
        environment: [{
          name: 'name',
          value: 'value',
        }],
        memoryLimit: 123,
        memoryReservation: 123,
      }],
      integrationPattern: stepfunctions.ServiceIntegrationPattern.FIRE_AND_FORGET,
      parameters: {
        parametersKey: parameters,
      },
    });
    
    Docs
  • // 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';
    import * as stepfunctions_tasks from '@aws-cdk/aws-stepfunctions-tasks';
    import * as cdk from '@aws-cdk/core';
    
    declare const activity: stepfunctions.Activity;
    const invokeActivity = new stepfunctions_tasks.InvokeActivity(activity, /* all optional props */ {
      heartbeat: cdk.Duration.minutes(30),
    });
    
    Docs
  • const vpc = ec2.Vpc.fromLookup(this, 'Vpc', {
      isDefault: true,
    });
    
    const cluster = new ecs.Cluster(this, 'Ec2Cluster', { vpc });
    cluster.addCapacity('DefaultAutoScalingGroup', {
      instanceType: new ec2.InstanceType('t2.micro'),
      vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC },
    });
    
    const taskDefinition = new ecs.TaskDefinition(this, 'TD', {
      compatibility: ecs.Compatibility.EC2,
    });
    
    taskDefinition.addContainer('TheContainer', {
      image: ecs.ContainerImage.fromRegistry('foo/bar'),
      memoryLimitMiB: 256,
    });
    
    const runTask = new tasks.EcsRunTask(this, 'Run', {
      integrationPattern: sfn.IntegrationPattern.RUN_JOB,
      cluster,
      taskDefinition,
      launchTarget: new tasks.EcsEc2LaunchTarget({
        placementStrategies: [
          ecs.PlacementStrategy.spreadAcrossInstances(),
          ecs.PlacementStrategy.packedByCpu(),
          ecs.PlacementStrategy.randomly(),
        ],
        placementConstraints: [
          ecs.PlacementConstraint.memberOf('blieptuut'),
        ],
      }),
    });
    
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples