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 { App, Stack } from '@aws-cdk/core';
    import * as ec2 from '@aws-cdk/aws-ec2';
    import * as ecs from '@aws-cdk/aws-ecs';
    import * as ecsPatterns from '@aws-cdk/aws-ecs-patterns';
    import * as cxapi from '@aws-cdk/cx-api';
    import * as path from 'path';
    
    const app = new App();
    
    const stack = new Stack(app, 'aws-ecs-patterns-queue');
    stack.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true);
    
    const vpc = new ec2.Vpc(stack, 'VPC', {
      maxAzs: 2,
    });
    
    new ecsPatterns.QueueProcessingFargateService(stack, 'QueueProcessingService', {
      vpc,
      memoryLimitMiB: 512,
      image: new ecs.AssetImage(path.join(__dirname, '..', 'sqs-reader')),
    });
    
    Docs
  • import * as api from '@aws-cdk/aws-apigateway';
    import * as lambda from '@aws-cdk/aws-lambda';
    
    const rule = new events.Rule(this, 'Rule', {
      schedule: events.Schedule.rate(cdk.Duration.minutes(1)),
    });
    
    const fn = new lambda.Function( this, 'MyFunc', {
      handler: 'index.handler',
      runtime: lambda.Runtime.NODEJS_12_X,
      code: lambda.Code.fromInline( 'exports.handler = e => {}' ),
    } );
    
    const restApi = new api.LambdaRestApi( this, 'MyRestAPI', { handler: fn } );
    
    const dlq = new sqs.Queue(this, 'DeadLetterQueue');
    
    rule.addTarget(
      new targets.ApiGateway( restApi, {
        path: '/*/test',
        method: 'GET',
        stage:  'prod',
        pathParameterValues: ['path-value'],
        headerParameters: {
          Header1: 'header1',
        },
        queryStringParameters: {
          QueryParam1: 'query-param-1',
        },
        deadLetterQueue: dlq
      } ),
    )
    
    Docs
  • // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import * as cx_api from '@aws-cdk/cx-api';
    import * as pipelines from '@aws-cdk/pipelines';
    
    declare const cloudFormationStackArtifact: cx_api.CloudFormationStackArtifact;
    const stackDeployment = pipelines.StackDeployment.fromArtifact(cloudFormationStackArtifact);
    
    Docs
  • import { HttpAlbIntegration } from '@aws-cdk/aws-apigatewayv2-integrations';
    
    declare const lb: elbv2.ApplicationLoadBalancer;
    const listener = lb.addListener('listener', { port: 80 });
    listener.addTargets('target', {
      port: 80,
    });
    
    const httpEndpoint = new apigwv2.HttpApi(this, 'HttpProxyPrivateApi', {
      defaultIntegration: new HttpAlbIntegration('DefaultIntegration', listener, {
        parameterMapping: new apigwv2.ParameterMapping()
          .appendHeader('header2', apigwv2.MappingValue.requestHeader('header1'))
          .removeHeader('header1'),
      }),
    });
    
    Docs
  • // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import * as events from '@aws-cdk/aws-events';
    import * as events_targets from '@aws-cdk/aws-events-targets';
    import * as iam from '@aws-cdk/aws-iam';
    import * as sqs from '@aws-cdk/aws-sqs';
    import * as cdk from '@aws-cdk/core';
    
    declare const queue: sqs.Queue;
    declare const role: iam.Role;
    declare const ruleTargetInput: events.RuleTargetInput;
    const apiDestinationProps: events_targets.ApiDestinationProps = {
      deadLetterQueue: queue,
      event: ruleTargetInput,
      eventRole: role,
      headerParameters: {
        headerParametersKey: 'headerParameters',
      },
      maxEventAge: cdk.Duration.minutes(30),
      pathParameterValues: ['pathParameterValues'],
      queryStringParameters: {
        queryStringParametersKey: 'queryStringParameters',
      },
      retryAttempts: 123,
    };
    
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples