code: public void createSecurityGroup(String groupName,
        String description) {
  
      AmazonEC2 amazonEC2 = getEc2Client();
      try {
        final CreateSecurityGroupRequest securityGroupRequest = new CreateSecurityGroupRequest()
            .withGroupName(groupName)
            .withDescription(description);
        amazonEC2.createSecurityGroup(securityGroupRequest);
  
        LOGGER.info("Created Security Group: " + groupName);
      } catch (AmazonServiceException ase) {
        // This might mean that security group is already created, hence ignore
        LOGGER.warn("Issue in creating security group", ase);
      }
    }
docs: *
  Create an Amazon AWS security group
  
  @param groupName Security group name
  @param description Security group description