/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ import { fileURLToPath } from "url"; // snippet-start:[sqs.JavaScript.messages.setQueueAttributesV3] import { SetQueueAttributesCommand, SQSClient } from "@aws-sdk/client-sqs"; const client = new SQSClient({}); const SQS_QUEUE_URL = "queue-url"; export const main = async (queueUrl = SQS_QUEUE_URL) => { const command = new SetQueueAttributesCommand({ QueueUrl: queueUrl, Attributes: { DelaySeconds: "1", }, }); const response = await client.send(command); console.log(response); return response; }; // snippet-end:[sqs.JavaScript.messages.setQueueAttributesV3] // Invoke main function if this file was run directly. if (process.argv[1] === fileURLToPath(import.meta.url)) { main(); }