use of software.amazon.awssdk.services.ec2.model.CreateSecurityGroupRequest in project incubator-gobblin by apache.
the class AWSSdkClient method createSecurityGroup.
/**
* Create an Amazon AWS security group
*
* @param groupName Security group name
* @param description Security group description
*/
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);
}
}
Aggregations