Example usage for com.amazonaws.services.ec2.model CreateInternetGatewayResult getInternetGateway

List of usage examples for com.amazonaws.services.ec2.model CreateInternetGatewayResult getInternetGateway

Introduction

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

Prototype


public InternetGateway getInternetGateway() 

Source Link

Document

Information about the internet gateway.

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//from w w  w  .  j  a va  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;
}

From source file:com.vmware.photon.controller.model.adapters.awsadapter.AWSNetworkService.java

License:Open Source License

public String createInternetGateway(AmazonEC2AsyncClient client) {
    CreateInternetGatewayResult result = client.createInternetGateway();
    return result.getInternetGateway().getInternetGatewayId();
}