Search in sources :

Example 6 with EbsInstanceBlockDevice

use of com.amazonaws.services.ec2.model.EbsInstanceBlockDevice in project aws-athena-query-federation by awslabs.

the class Ec2TableProviderTest method makeInstance.

private Instance makeInstance(String id) {
    Instance instance = new Instance();
    instance.withInstanceId(id).withImageId("image_id").withInstanceType("instance_type").withPlatform("platform").withPrivateDnsName("private_dns_name").withPrivateIpAddress("private_ip_address").withPublicDnsName("public_dns_name").withPublicIpAddress("public_ip_address").withSubnetId("subnet_id").withVpcId("vpc_id").withArchitecture("architecture").withInstanceLifecycle("instance_lifecycle").withRootDeviceName("root_device_name").withRootDeviceType("root_device_type").withSpotInstanceRequestId("spot_instance_request_id").withVirtualizationType("virtualization_type").withKeyName("key_name").withKernelId("kernel_id").withCapacityReservationId("capacity_reservation_id").withLaunchTime(new Date(100_000)).withState(new InstanceState().withCode(100).withName("name")).withStateReason(new StateReason().withCode("code").withMessage("message")).withEbsOptimized(true);
    List<InstanceNetworkInterface> interfaces = new ArrayList<>();
    interfaces.add(new InstanceNetworkInterface().withStatus("status").withSubnetId("subnet").withVpcId("vpc").withMacAddress("mac_address").withPrivateDnsName("private_dns").withPrivateIpAddress("private_ip").withNetworkInterfaceId("interface_id").withGroups(new GroupIdentifier().withGroupId("group_id").withGroupName("group_name")));
    interfaces.add(new InstanceNetworkInterface().withStatus("status").withSubnetId("subnet").withVpcId("vpc").withMacAddress("mac").withPrivateDnsName("private_dns").withPrivateIpAddress("private_ip").withNetworkInterfaceId("interface_id").withGroups(new GroupIdentifier().withGroupId("group_id").withGroupName("group_name")));
    instance.withNetworkInterfaces(interfaces).withSecurityGroups(new GroupIdentifier().withGroupId("group_id").withGroupName("group_name")).withBlockDeviceMappings(new InstanceBlockDeviceMapping().withDeviceName("device_name").withEbs(new EbsInstanceBlockDevice().withVolumeId("volume_id")));
    return instance;
}
Also used : InstanceState(com.amazonaws.services.ec2.model.InstanceState) Instance(com.amazonaws.services.ec2.model.Instance) StateReason(com.amazonaws.services.ec2.model.StateReason) ArrayList(java.util.ArrayList) InstanceNetworkInterface(com.amazonaws.services.ec2.model.InstanceNetworkInterface) InstanceBlockDeviceMapping(com.amazonaws.services.ec2.model.InstanceBlockDeviceMapping) Date(java.util.Date) GroupIdentifier(com.amazonaws.services.ec2.model.GroupIdentifier) EbsInstanceBlockDevice(com.amazonaws.services.ec2.model.EbsInstanceBlockDevice)

Aggregations

Instance (com.amazonaws.services.ec2.model.Instance)6 EbsInstanceBlockDevice (com.amazonaws.services.ec2.model.EbsInstanceBlockDevice)5 InstanceBlockDeviceMapping (com.amazonaws.services.ec2.model.InstanceBlockDeviceMapping)5 DescribeInstancesResult (com.amazonaws.services.ec2.model.DescribeInstancesResult)4 Reservation (com.amazonaws.services.ec2.model.Reservation)4 ArrayList (java.util.ArrayList)4 CreateTagsRequest (com.amazonaws.services.ec2.model.CreateTagsRequest)3 AmazonEc2Client (com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonEc2Client)3 CloudResource (com.sequenceiq.cloudbreak.cloud.model.CloudResource)3 Test (org.junit.Test)3 InstanceState (com.amazonaws.services.ec2.model.InstanceState)2 AmazonServiceException (com.amazonaws.AmazonServiceException)1 Tag (com.amazonaws.services.cloudformation.model.Tag)1 AmazonEC2 (com.amazonaws.services.ec2.AmazonEC2)1 DescribeInstancesRequest (com.amazonaws.services.ec2.model.DescribeInstancesRequest)1 DescribeVolumesRequest (com.amazonaws.services.ec2.model.DescribeVolumesRequest)1 DescribeVolumesResult (com.amazonaws.services.ec2.model.DescribeVolumesResult)1 GroupIdentifier (com.amazonaws.services.ec2.model.GroupIdentifier)1 InstanceNetworkInterface (com.amazonaws.services.ec2.model.InstanceNetworkInterface)1 StateReason (com.amazonaws.services.ec2.model.StateReason)1