Example usage for com.amazonaws.services.ec2.model CreateInternetGatewayRequest CreateInternetGatewayRequest

List of usage examples for com.amazonaws.services.ec2.model CreateInternetGatewayRequest CreateInternetGatewayRequest

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model CreateInternetGatewayRequest CreateInternetGatewayRequest.

Prototype

CreateInternetGatewayRequest

Source Link

Usage

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//w  w w . ja v a2  s. c om
 * @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;
}