How to use the @aws-cdk/aws-sqs.Queue function in @aws-cdk/aws-sqs

To help you get started, we’ve selected a few @aws-cdk/aws-sqs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deepalert / deepalert / lib / deepalert-stack.ts View on Github external
billingMode: dynamodb.BillingMode.PAY_PER_REQUEST,
      partitionKey: { name: "pk", type: dynamodb.AttributeType.STRING },
      sortKey: { name: "sk", type: dynamodb.AttributeType.STRING },
      timeToLiveAttribute: "expires_at",
    });

    // ----------------------------------------------------------------
    // Messaging Channels
    this.alertTopic = new sns.Topic(this, "alertTopic");
    this.taskTopic = new sns.Topic(this, "taskTopic");
    this.contentTopic = new sns.Topic(this, "contentTopic");
    this.attributeTopic = new sns.Topic(this, "attributeTopic");
    this.reportTopic = new sns.Topic(this, "reportTopic");

    const alertQueueTimeout = cdk.Duration.seconds(30);
    this.alertQueue = new sqs.Queue(this, "alertQueue", {
      visibilityTimeout: alertQueueTimeout,
    });
    this.alertTopic.addSubscription(new SqsSubscription(this.alertQueue));

    const contentQueueTimeout = cdk.Duration.seconds(30);
    this.contentQueue = new sqs.Queue(this, "contentQueue", {
      visibilityTimeout: contentQueueTimeout,
    });

    const attributeQueueTimeout = cdk.Duration.seconds(30);
    this.attributeQueue = new sqs.Queue(this, "attributeQueue", {
      visibilityTimeout: attributeQueueTimeout,
    });

    // ----------------------------------------------------------------
    // Lambda Functions
github nathanpeck / screenshot-service / app.3.js View on Github external
maxAZs: 2,
      natGateways: 1
    });

    // Create an ECS cluster
    this.cluster = new ecs.Cluster(this, 'cluster', {
      vpc: this.vpc
    });

    // Create S3 bucket
    this.screenshotBucket = new s3.Bucket(this, 'screenshot-bucket', {
      publicReadAccess: true
    });

    // Create queue
    this.screenshotQueue = new sqs.Queue(this, 'screenshot-queue');

    // Create DynamoDB table
    this.screenshotTable = new dynamodb.Table(this, 'screenshots', {
      partitionKey: { name: 'id', type: dynamodb.AttributeType.String },
      billingMode: dynamodb.BillingMode.PayPerRequest
    });
  }
}
github aws / aws-cdk / packages / @aws-cdk / aws-ecs-patterns / lib / base / queue-processing-service-base.ts View on Github external
constructor(scope: Construct, id: string, props: QueueProcessingServiceBaseProps) {
    super(scope, id);

    if (props.cluster && props.vpc) {
      throw new Error(`You can only specify either vpc or cluster. Alternatively, you can leave both blank`);
    }
    this.cluster = props.cluster || this.getDefaultCluster(this, props.vpc);

    // Create the SQS queue if one is not provided
    this.sqsQueue = props.queue !== undefined ? props.queue : new Queue(this, 'EcsProcessingQueue', {});

    // Setup autoscaling scaling intervals
    const defaultScalingSteps = [{ upper: 0, change: -1 }, { lower: 100, change: +1 }, { lower: 500, change: +5 }];
    this.scalingSteps = props.scalingSteps !== undefined ? props.scalingSteps : defaultScalingSteps;

    // Create log driver if logging is enabled
    const enableLogging = props.enableLogging !== undefined ? props.enableLogging : true;
    this.logDriver = props.logDriver !== undefined
                        ? props.logDriver
                        : enableLogging
                            ? this.createAWSLogDriver(this.node.id)
                            : undefined;

    // Add the queue name to environment variables
    this.environment = { ...(props.environment || {}), QUEUE_NAME: this.sqsQueue.queueName };
    this.secrets = props.secrets;
github deepalert / deepalert / lib / deepalert-stack.ts View on Github external
this.attributeTopic = new sns.Topic(this, "attributeTopic");
    this.reportTopic = new sns.Topic(this, "reportTopic");

    const alertQueueTimeout = cdk.Duration.seconds(30);
    this.alertQueue = new sqs.Queue(this, "alertQueue", {
      visibilityTimeout: alertQueueTimeout,
    });
    this.alertTopic.addSubscription(new SqsSubscription(this.alertQueue));

    const contentQueueTimeout = cdk.Duration.seconds(30);
    this.contentQueue = new sqs.Queue(this, "contentQueue", {
      visibilityTimeout: contentQueueTimeout,
    });

    const attributeQueueTimeout = cdk.Duration.seconds(30);
    this.attributeQueue = new sqs.Queue(this, "attributeQueue", {
      visibilityTimeout: attributeQueueTimeout,
    });

    // ----------------------------------------------------------------
    // Lambda Functions
    const baseEnvVars = {
      TASK_TOPIC: this.taskTopic.topicArn,
      REPORT_TOPIC: this.reportTopic.topicArn,
      CACHE_TABLE: this.cacheTable.tableName,
    };
    const nodeModulesLayer = new lambda.LayerVersion(this, "NodeModulesLayer", {
      code: lambda.AssetCode.fromAsset("????"),
      compatibleRuntimes: [lambda.Runtime.NODEJS_10_X],
    });
    this.recvAlert = new NodejsFunction(this, "recvAlert", {
      entry: path.join(__dirname, "lambda/recvAlert.js"),
github deepalert / deepalert / lib / deepalert-stack.ts View on Github external
// ----------------------------------------------------------------
    // Messaging Channels
    this.alertTopic = new sns.Topic(this, "alertTopic");
    this.taskTopic = new sns.Topic(this, "taskTopic");
    this.contentTopic = new sns.Topic(this, "contentTopic");
    this.attributeTopic = new sns.Topic(this, "attributeTopic");
    this.reportTopic = new sns.Topic(this, "reportTopic");

    const alertQueueTimeout = cdk.Duration.seconds(30);
    this.alertQueue = new sqs.Queue(this, "alertQueue", {
      visibilityTimeout: alertQueueTimeout,
    });
    this.alertTopic.addSubscription(new SqsSubscription(this.alertQueue));

    const contentQueueTimeout = cdk.Duration.seconds(30);
    this.contentQueue = new sqs.Queue(this, "contentQueue", {
      visibilityTimeout: contentQueueTimeout,
    });

    const attributeQueueTimeout = cdk.Duration.seconds(30);
    this.attributeQueue = new sqs.Queue(this, "attributeQueue", {
      visibilityTimeout: attributeQueueTimeout,
    });

    // ----------------------------------------------------------------
    // Lambda Functions
    const baseEnvVars = {
      TASK_TOPIC: this.taskTopic.topicArn,
      REPORT_TOPIC: this.reportTopic.topicArn,
      CACHE_TABLE: this.cacheTable.tableName,
    };
    const nodeModulesLayer = new lambda.LayerVersion(this, "NodeModulesLayer", {

@aws-cdk/aws-sqs

The CDK Construct Library for AWS::SQS

Apache-2.0
Latest version published 1 year ago

Package Health Score

70 / 100
Full package analysis

Popular @aws-cdk/aws-sqs functions