Interface QueueProcessingServiceBaseProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
QueueProcessingEc2ServiceProps
,QueueProcessingFargateServiceProps
- All Known Implementing Classes:
QueueProcessingEc2ServiceProps.Jsii$Proxy
,QueueProcessingFargateServiceProps.Jsii$Proxy
,QueueProcessingServiceBaseProps.Jsii$Proxy
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.*; import software.amazon.awscdk.services.ec2.*; import software.amazon.awscdk.services.ecs.*; import software.amazon.awscdk.services.ecs.patterns.*; import software.amazon.awscdk.services.sqs.*; Cluster cluster; ContainerImage containerImage; LogDriver logDriver; Queue queue; Secret secret; Vpc vpc; QueueProcessingServiceBaseProps queueProcessingServiceBaseProps = QueueProcessingServiceBaseProps.builder() .capacityProviderStrategies(List.of(CapacityProviderStrategy.builder() .capacityProvider("capacityProvider") // the properties below are optional .base(123) .weight(123) .build())) .circuitBreaker(DeploymentCircuitBreaker.builder() .enable(false) .rollback(false) .build()) .cluster(cluster) .command(List.of("command")) .cooldown(Duration.minutes(30)) .cpuTargetUtilizationPercent(123) .deploymentController(DeploymentController.builder() .type(DeploymentControllerType.ECS) .build()) .disableCpuBasedScaling(false) .enableECSManagedTags(false) .enableExecuteCommand(false) .enableLogging(false) .environment(Map.of( "environmentKey", "environment")) .family("family") .image(containerImage) .logDriver(logDriver) .maxHealthyPercent(123) .maxReceiveCount(123) .maxScalingCapacity(123) .minHealthyPercent(123) .minScalingCapacity(123) .propagateTags(PropagatedTagSource.SERVICE) .queue(queue) .retentionPeriod(Duration.minutes(30)) .scalingSteps(List.of(ScalingInterval.builder() .change(123) // the properties below are optional .lower(123) .upper(123) .build())) .secrets(Map.of( "secretsKey", secret)) .serviceName("serviceName") .visibilityTimeout(Duration.minutes(30)) .vpc(vpc) .build();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forQueueProcessingServiceBaseProps
static final class
An implementation forQueueProcessingServiceBaseProps
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
default List<CapacityProviderStrategy>
A list of Capacity Provider strategies used to place a service.default DeploymentCircuitBreaker
Whether to enable the deployment circuit breaker.default ICluster
The name of the cluster that hosts the service.The command that is passed to the container.default Duration
Grace period after scaling activity in seconds.default Number
The target CPU utilization percentage for CPU based scaling strategy when enabled.default DeploymentController
Specifies which deployment controller to use for the service.default Boolean
Flag to disable CPU based auto scaling strategy on the service.default Boolean
Specifies whether to enable Amazon ECS managed tags for the tasks within the service.default Boolean
Whether ECS Exec should be enabled.default Boolean
Flag to indicate whether to enable logging.The environment variables to pass to the container.default String
The name of a family that the task definition is registered to.default ContainerImage
getImage()
The image used to start a container.default LogDriver
The log driver to use.default Number
The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment.default Number
The maximum number of times that a message can be received by consumers.default Number
Maximum capacity to scale to.default Number
The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment.default Number
Minimum capacity to scale to.default PropagatedTagSource
Specifies whether to propagate the tags from the task definition or the service to the tasks in the service.default IQueue
getQueue()
A queue for which to process items from.default Duration
The number of seconds that Dead Letter Queue retains a message.default List<ScalingInterval>
The intervals for scaling based on the SQS queue's ApproximateNumberOfMessagesVisible metric.The secret to expose to the container as an environment variable.default String
The name of the service.default Duration
Timeout of processing a single message.default IVpc
getVpc()
The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getCapacityProviderStrategies
A list of Capacity Provider strategies used to place a service.Default: - undefined
-
getCircuitBreaker
Whether to enable the deployment circuit breaker.If this property is defined, circuit breaker will be implicitly enabled.
Default: - disabled
-
getCluster
The name of the cluster that hosts the service.If a cluster is specified, the vpc construct should be omitted. Alternatively, you can omit both cluster and vpc.
Default: - create a new cluster; if both cluster and vpc are omitted, a new VPC will be created for you.
-
getCommand
The command that is passed to the container.If you provide a shell command as a single string, you have to quote command-line arguments.
Default: - CMD value built into container image.
-
getCooldown
Grace period after scaling activity in seconds.Subsequent scale outs during the cooldown period are squashed so that only the biggest scale out happens.
Subsequent scale ins during the cooldown period are ignored.
Default: 300 seconds
- See Also:
-
getCpuTargetUtilizationPercent
The target CPU utilization percentage for CPU based scaling strategy when enabled.Default: - 50
-
getDeploymentController
Specifies which deployment controller to use for the service.For more information, see Amazon ECS Deployment Types
Default: - Rolling update (ECS)
-
getDisableCpuBasedScaling
Flag to disable CPU based auto scaling strategy on the service.Default: - false
-
getEnableECSManagedTags
Specifies whether to enable Amazon ECS managed tags for the tasks within the service.For more information, see Tagging Your Amazon ECS Resources
Default: false
-
getEnableExecuteCommand
Whether ECS Exec should be enabled.Default: - false
-
getEnableLogging
Flag to indicate whether to enable logging.Default: true
-
getEnvironment
The environment variables to pass to the container.The variable
QUEUE_NAME
with valuequeue.queueName
will always be passed.Default: 'QUEUE_NAME: queue.queueName'
-
getFamily
The name of a family that the task definition is registered to.A family groups multiple versions of a task definition.
Default: - Automatically generated name.
-
getImage
The image used to start a container.For
QueueProcessingFargateService
, eitherimage
ortaskDefinition
must be specified, but not both. ForQueueProcessingEc2Service
,image
is required.Default: - the image of the task definition is used for Fargate, required otherwise
-
getLogDriver
The log driver to use.Default: - AwsLogDriver if enableLogging is true
-
getMaxHealthyPercent
The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment.Default: - default from underlying service.
-
getMaxReceiveCount
The maximum number of times that a message can be received by consumers.When this value is exceeded for a message the message will be automatically sent to the Dead Letter Queue.
If the queue construct is specified, maxReceiveCount should be omitted.
Default: 3
-
getMaxScalingCapacity
Maximum capacity to scale to.Default: 2
-
getMinHealthyPercent
The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment.Default: - default from underlying service.
-
getMinScalingCapacity
Minimum capacity to scale to.Default: 1
-
getPropagateTags
Specifies whether to propagate the tags from the task definition or the service to the tasks in the service.Tags can only be propagated to the tasks within the service during service creation.
Default: - none
-
getQueue
A queue for which to process items from.If specified and this is a FIFO queue, the queue name must end in the string '.fifo'. See CreateQueue
Default: 'SQSQueue with CloudFormation-generated name'
-
getRetentionPeriod
The number of seconds that Dead Letter Queue retains a message.If the queue construct is specified, retentionPeriod should be omitted.
Default: Duration.days(14)
-
getScalingSteps
The intervals for scaling based on the SQS queue's ApproximateNumberOfMessagesVisible metric.Maps a range of metric values to a particular scaling behavior. See Simple and Step Scaling Policies for Amazon EC2 Auto Scaling
Default: [{ upper: 0, change: -1 },{ lower: 100, change: +1 },{ lower: 500, change: +5 }]
-
getSecrets
The secret to expose to the container as an environment variable.Default: - No secret environment variables.
-
getServiceName
The name of the service.Default: - CloudFormation-generated name.
-
getVisibilityTimeout
Timeout of processing a single message.After dequeuing, the processor has this much time to handle the message and delete it from the queue before it becomes visible again for dequeueing by another processor. Values must be between 0 and (12 hours).
If the queue construct is specified, visibilityTimeout should be omitted.
Default: Duration.seconds(30)
-
getVpc
The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed.If a vpc is specified, the cluster construct should be omitted. Alternatively, you can omit both vpc and cluster.
Default: - uses the VPC defined in the cluster or creates a new VPC.
-
builder
-