aws-cdk-lib.aws_ecs_patterns.QueueProcessingServiceBase

class QueueProcessingServiceBase

LanguageType name
.NETAmazon.CDK.AWS.ECS.Patterns.QueueProcessingServiceBase
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsecspatterns#QueueProcessingServiceBase
Javasoftware.amazon.awscdk.services.ecs.patterns.QueueProcessingServiceBase
Pythonaws_cdk.aws_ecs_patterns.QueueProcessingServiceBase
TypeScript (source)aws-cdk-lib » aws_ecs_patterns » QueueProcessingServiceBase

Implements IConstruct, IDependable

Extends Construct

Implemented by QueueProcessingEc2Service, QueueProcessingFargateService

The base class for QueueProcessingEc2Service and QueueProcessingFargateService services.

Initializer

new QueueProcessingServiceBase(scope: Construct, id: string, props: QueueProcessingServiceBaseProps)

Parameters

  • scope Construct
  • id string
  • props QueueProcessingServiceBaseProps

Constructs a new instance of the QueueProcessingServiceBase class.

Properties

NameTypeDescription
clusterIClusterThe cluster where your service will be deployed.
environment{ [string]: string }Environment variables that will include the queue name.
maxCapacitynumberThe maximum number of instances for autoscaling to scale up to.
minCapacitynumberThe minimum number of instances for autoscaling to scale down to.
nodeNodeThe tree node.
scalingStepsScalingInterval[]The scaling interval for autoscaling based off an SQS Queue size.
sqsQueueIQueueThe SQS queue that the service will process from.
deadLetterQueue?IQueueThe dead letter queue for the primary SQS queue.
logDriver?LogDriverThe AwsLogDriver to use for logging if logging is enabled.
secrets?{ [string]: Secret }The secret environment variables.

cluster

Type: ICluster

The cluster where your service will be deployed.


environment

Type: { [string]: string }

Environment variables that will include the queue name.


maxCapacity

Type: number

The maximum number of instances for autoscaling to scale up to.


minCapacity

Type: number

The minimum number of instances for autoscaling to scale down to.


node

Type: Node

The tree node.


scalingSteps

Type: ScalingInterval[]

The scaling interval for autoscaling based off an SQS Queue size.


sqsQueue

Type: IQueue

The SQS queue that the service will process from.


deadLetterQueue?

Type: IQueue (optional)

The dead letter queue for the primary SQS queue.


logDriver?

Type: LogDriver (optional)

The AwsLogDriver to use for logging if logging is enabled.


secrets?

Type: { [string]: Secret } (optional)

The secret environment variables.

Methods

NameDescription
toString()Returns a string representation of this construct.
protected configureAutoscalingForService(service)Configure autoscaling based off of CPU utilization as well as the number of messages visible in the SQS queue.
protected getDefaultCluster(scope, vpc?)Returns the default cluster.
protected grantPermissionsToService(service)Grant SQS permissions to an ECS service.

toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


protected configureAutoscalingForService(service)

protected configureAutoscalingForService(service: BaseService): void

Parameters

  • service BaseService — the ECS/Fargate service for which to apply the autoscaling rules to.

Configure autoscaling based off of CPU utilization as well as the number of messages visible in the SQS queue.


protected getDefaultCluster(scope, vpc?)

protected getDefaultCluster(scope: Construct, vpc?: IVpc): Cluster

Parameters

  • scope Construct
  • vpc IVpc

Returns

  • Cluster

Returns the default cluster.


protected grantPermissionsToService(service)

protected grantPermissionsToService(service: BaseService): void

Parameters

  • service BaseService — the ECS/Fargate service to which to grant SQS permissions.

Grant SQS permissions to an ECS service.