List of usage examples for com.amazonaws.services.ec2 AmazonEC2 createInternetGateway
CreateInternetGatewayResult createInternetGateway(CreateInternetGatewayRequest createInternetGatewayRequest);
Creates an internet gateway for use with a VPC.
From source file:com.urbancode.terraform.tasks.aws.helpers.AWSHelper.java
License:Apache License
/** * Creates an internetGateway and returns the id it was created with. * * @param ec2Client/*from www . j ava 2 s. c o m*/ * @return InternetGatewayId */ public String createInternetGateway(AmazonEC2 ec2Client) { String gatewayId = null; CreateInternetGatewayRequest request = new CreateInternetGatewayRequest(); CreateInternetGatewayResult result = ec2Client.createInternetGateway(request); if (result != null && result.getInternetGateway() != null) { gatewayId = result.getInternetGateway().getInternetGatewayId(); } return gatewayId; }