docs: public static boolean doesSecurityGroupExist(AmazonEC2 ec2,
              String securityGroupName) throws AmazonClientException,
              AmazonServiceException {
  
          DescribeSecurityGroupsRequest securityGroupsRequest =
                  new DescribeSecurityGroupsRequest()
                      .withGroupNames(securityGroupName);
  
          try {
              ec2.describeSecurityGroups(securityGroupsRequest);
              return true;
  
          } catch (AmazonServiceException ase) {
              if (INVALID_GROUP_NOT_FOUND.equals(ase.getErrorCode())) {
                  return false;
              }
              throw ase;
          }
      }