Creating a security group

Next, create a Security group using the VPC created in the previous section on creating a cluster. The AWS region is required to be specified in the following command, if not configured in persisted/shell defaults:

$groupid = New-EC2SecurityGroup -VpcId "vpc-6e021915" -Region "us-east-1" -GroupName "hello-worldPSSecurityGroup" -GroupDescription "EC2-VPC from PowerShell"

List the EC2 security group with the following Get-EC2SecurityGroup command:

Get-EC2SecurityGroup -Region "us-east-1" -GroupId $groupid

The EC2 security group gets listed, as shown here:

If required, the EC2 security group may be removed with the following ...

Get Amazon Fargate Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.