$VPC_ID = ""
$PROJECT_NAME = ""
$REGION = ""
$NAME_LIST = @(
"elb-sg",
"ep-sg"
)
foreach ($item in $NAME_LIST) {
$GROUP_ID = aws ec2 create-security-group `
--description $item `
--group-name $item `
--vpc-id $VPC_ID `
--tag-specifications "ResourceType=security-group,Tags=[{Key=Name,Value=$($item)},{Key=project,Value=$PROJECT_NAME}]" `
--region $REGION `
--query 'GroupId' `
--output text `
--no-cli-pager
$_ = aws ec2 revoke-security-group-egress `
--group-id $GROUP_ID `
--protocol all `
--cidr 0.0.0.0/0 `
--region $REGION
echo "$item $GROUP_ID"
}