static

in athena-aws-cmdb/src/main/java/com/amazonaws/athena/connectors/aws/cmdb/tables/ec2/Ec2TableProvider.java [236:312]


    static {
        SCHEMA = SchemaBuilder.newBuilder()
                .addStringField("instance_id")
                .addStringField("image_id")
                .addStringField("instance_type")
                .addStringField("platform")
                .addStringField("private_dns_name")
                .addStringField("private_ip_address")
                .addStringField("public_dns_name")
                .addStringField("public_ip_address")
                .addStringField("subnet_id")
                .addStringField("vpc_id")
                .addStringField("architecture")
                .addStringField("instance_lifecycle")
                .addStringField("root_device_name")
                .addStringField("root_device_type")
                .addStringField("spot_instance_request_id")
                .addStringField("virtualization_type")
                .addStringField("key_name")
                .addStringField("kernel_id")
                .addStringField("capacity_reservation_id")
                .addField("launch_time", Types.MinorType.DATEMILLI.getType())
                .addStructField("state")
                .addChildField("state", "name", Types.MinorType.VARCHAR.getType())
                .addChildField("state", "code", Types.MinorType.INT.getType())
                .addStructField("state_reason")
                .addChildField("state_reason", "message", Types.MinorType.VARCHAR.getType())
                .addChildField("state_reason", "code", Types.MinorType.VARCHAR.getType())

                //Example of a List of Structs
                .addField(
                        FieldBuilder.newBuilder("network_interfaces", new ArrowType.List())
                                .addField(
                                        FieldBuilder.newBuilder("interface", Types.MinorType.STRUCT.getType())
                                                .addStringField("status")
                                                .addStringField("subnet")
                                                .addStringField("vpc")
                                                .addStringField("mac")
                                                .addStringField("private_dns")
                                                .addStringField("private_ip")
                                                .addListField("security_groups", Types.MinorType.VARCHAR.getType())
                                                .addStringField("interface_id")
                                                .build())
                                .build())
                .addBitField("ebs_optimized")
                .addListField("security_groups", Types.MinorType.VARCHAR.getType())
                .addListField("security_group_names", Types.MinorType.VARCHAR.getType())
                .addListField("ebs_volumes", Types.MinorType.VARCHAR.getType())
                .addMetadata("instance_id", "EC2 Instance id.")
                .addMetadata("image_id", "The id of the AMI used to boot the instance.")
                .addMetadata("instance_type", "The EC2 instance type,")
                .addMetadata("platform", "The platform of the instance (e.g. Linux)")
                .addMetadata("private_dns_name", "The private dns name of the instance.")
                .addMetadata("private_ip_address", "The private ip address of the instance.")
                .addMetadata("public_dns_name", "The public dns name of the instance.")
                .addMetadata("public_ip_address", "The public ip address of the instance.")
                .addMetadata("subnet_id", "The subnet id that the instance was launched in.")
                .addMetadata("vpc_id", "The id of the VPC that the instance was launched in.")
                .addMetadata("architecture", "The architecture of the instance (e.g. x86).")
                .addMetadata("instance_lifecycle", "The lifecycle state of the instance.")
                .addMetadata("root_device_name", "The name of the root device that the instance booted from.")
                .addMetadata("root_device_type", "The type of the root device that the instance booted from.")
                .addMetadata("spot_instance_requestId", "Spot Request ID if the instance was launched via spot. ")
                .addMetadata("virtualization_type", "The type of virtualization used by the instance (e.g. HVM)")
                .addMetadata("key_name", "The name of the ec2 instance from the name tag.")
                .addMetadata("kernel_id", "The id of the kernel used in the AMI that booted the instance.")
                .addMetadata("capacity_reservation_id", "Capacity reservation id that this instance was launched against.")
                .addMetadata("launch_time", "The time that the instance was launched at.")
                .addMetadata("state", "The state of the ec2 instance.")
                .addMetadata("state_reason", "The reason for the 'state' associated with the instance.")
                .addMetadata("ebs_optimized", "True if the instance is EBS optimized.")
                .addMetadata("network_interfaces", "The list of the network interfaces on the instance.")
                .addMetadata("security_groups", "The list of security group (ids) attached to this instance.")
                .addMetadata("security_group_names", "The list of security group (names) attached to this instance.")
                .addMetadata("ebs_volumes", "The list of ebs volume (ids) attached to this instance.")
                .build();
    }