Skip to content
GitHubXDiscord

Queue

The Queue resource allows you to create and manage AWS PCS Queues which are essential for processing jobs in a distributed manner.

Create a basic PCS Queue with required properties and an optional tag.

import AWS from "alchemy/aws/control";
const pcsQueue = await AWS.PCS.Queue("myQueue", {
clusterId: "pcs-cluster-1",
tags: {
Environment: "Production"
}
});

Configure a queue with compute node group configurations for more granular control over task execution.

import AWS from "alchemy/aws/control";
const advancedQueue = await AWS.PCS.Queue("advancedQueue", {
clusterId: "pcs-cluster-1",
computeNodeGroupConfigurations: [
{
instanceType: "c5.large",
desiredSize: 2,
maxSize: 5,
minSize: 1
}
],
name: "AdvancedQueue"
});

Create a queue that adopts an existing resource if it is already present.

import AWS from "alchemy/aws/control";
const adoptedQueue = await AWS.PCS.Queue("adoptedQueue", {
clusterId: "pcs-cluster-1",
adopt: true,
name: "ExistingQueue"
});

Demonstrate how to create a queue with multiple tags for better resource management.

import AWS from "alchemy/aws/control";
const taggedQueue = await AWS.PCS.Queue("taggedQueue", {
clusterId: "pcs-cluster-1",
tags: {
Project: "DataProcessing",
Owner: "TeamA",
Environment: "Development"
}
});