/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ import { fileURLToPath } from "url"; // snippet-start:[ec2.JavaScript.SecurityGroups.describeSecurityGroupsV3] import { DescribeSecurityGroupsCommand } from "@aws-sdk/client-ec2"; import { client } from "../libs/client.js"; // Log the details of a specific security group. export const main = async () => { const command = new DescribeSecurityGroupsCommand({ GroupIds: ["SECURITY_GROUP_ID"], }); try { const { SecurityGroups } = await client.send(command); console.log(JSON.stringify(SecurityGroups, null, 2)); } catch (err) { console.error(err); } }; // snippet-end:[ec2.JavaScript.SecurityGroups.describeSecurityGroupsV3] // Invoke main function if this file was run directly. if (process.argv[1] === fileURLToPath(import.meta.url)) { main(); }