|
| 1 | +package ec2 |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/infracost/go-proto/pkg/tree/resource" |
| 5 | + "github.com/infracost/go-proto/pkg/tree/value" |
| 6 | +) |
| 7 | + |
| 8 | +type Instance struct { |
| 9 | + resource.Resource `tree:"-"` |
| 10 | + Type value.String `tree:"instance_type"` |
| 11 | + PurchaseOption value.Value[PurchaseOption] `tree:"purchase_option"` |
| 12 | + Tenancy value.Value[Tenancy] `tree:"tenancy"` |
| 13 | + EBSOptimized value.Bool `tree:"ebs_optimized"` |
| 14 | + MonitoringEnabled value.Bool `tree:"monitoring_enabled"` |
| 15 | + CPUCredits value.Value[CPUCreditOption] `tree:"cpu_credits"` |
| 16 | + HostID value.String `tree:"host_id"` |
| 17 | + LaunchTemplateID value.String `tree:"launch_template_id"` |
| 18 | + LaunchTemplateName value.String `tree:"launch_template_name"` |
| 19 | + ElasticInferenceAcceleratorType value.Value[ElasticInferenceAcceleratorType] `tree:"elastic_inference_accelerator_type"` |
| 20 | + AssociatePublicIPAddress value.Bool `tree:"associate_public_ip_address"` |
| 21 | + MetadataOptions InstanceMetadataOptions `tree:"metadata_options"` |
| 22 | + RootBlockDevice *BlockDeviceMapping `tree:"root_block_device"` |
| 23 | + // NOTE: Launch templates - which may be linked later (provider-time) - can alter attributes of existing block devices if they share a name |
| 24 | + BlockDeviceMappings []BlockDeviceMapping `tree:"block_device_mappings"` |
| 25 | + |
| 26 | + Relationships InstanceRelationships `tree:"-"` |
| 27 | +} |
| 28 | + |
| 29 | +type InstanceRelationships struct { |
| 30 | + InstanceState *InstanceStateMapping |
| 31 | + LaunchTemplate *LaunchTemplate |
| 32 | +} |
| 33 | + |
| 34 | +type PurchaseOption uint32 |
| 35 | + |
| 36 | +const ( |
| 37 | + PurchaseOptionUnknown PurchaseOption = iota |
| 38 | + PurchaseOptionOnDemand |
| 39 | + PurchaseOptionSpot |
| 40 | +) |
| 41 | + |
| 42 | +type Tenancy uint32 |
| 43 | + |
| 44 | +const ( |
| 45 | + TenancyUnknown Tenancy = iota |
| 46 | + TenancyShared |
| 47 | + TenancyDedicated |
| 48 | + TenancyHost |
| 49 | +) |
| 50 | + |
| 51 | +type CPUCreditOption uint32 |
| 52 | + |
| 53 | +const ( |
| 54 | + CPUCreditOptionUnknown CPUCreditOption = iota |
| 55 | + CPUCreditOptionStandard |
| 56 | + CPUCreditOptionUnlimited |
| 57 | +) |
| 58 | + |
| 59 | +type InstanceMetadataOptions struct { |
| 60 | + HTTPEndpointEnabled value.Bool `tree:"http_endpoint_enabled"` |
| 61 | + HTTPTokensRequired value.Bool `tree:"http_tokens_required"` |
| 62 | +} |
| 63 | + |
| 64 | +type BlockDeviceMapping struct { |
| 65 | + EBSVolume EBSVolume `tree:"ebs_volume"` |
| 66 | + DeviceName value.String `tree:"device_name"` |
| 67 | +} |
| 68 | + |
| 69 | +type ElasticInferenceAcceleratorType uint32 |
| 70 | + |
| 71 | +const ( |
| 72 | + ElasticInferenceAcceleratorTypeUnknown ElasticInferenceAcceleratorType = iota |
| 73 | + ElasticInferenceAcceleratorTypeEIA1Medium ElasticInferenceAcceleratorType = 1 |
| 74 | + ElasticInferenceAcceleratorTypeEIA1Large ElasticInferenceAcceleratorType = 2 |
| 75 | + ElasticInferenceAcceleratorTypeEIA1Xlarge ElasticInferenceAcceleratorType = 3 |
| 76 | + ElasticInferenceAcceleratorTypeEIA2Medium ElasticInferenceAcceleratorType = 4 |
| 77 | + ElasticInferenceAcceleratorTypeEIA2Large ElasticInferenceAcceleratorType = 5 |
| 78 | + ElasticInferenceAcceleratorTypeEIA2Xlarge ElasticInferenceAcceleratorType = 6 |
| 79 | +) |
0 commit comments