import * as core from "@terrascript/core";

export interface CapacityRebalanceArgs extends core.SchemaArgs {
  replacementStrategy?: string | core.StringOut;
}

export class CapacityRebalance extends core.Schema<CapacityRebalanceArgs> {
  @core.attr(String)
  public replacementStrategy?: string | core.StringOut;
}

export interface MaintenanceStrategiesArgs extends core.SchemaArgs {
  capacityRebalance?: CapacityRebalance;
}

export class MaintenanceStrategies extends core.Schema<MaintenanceStrategiesArgs> {
  @core.attr(CapacityRebalance)
  public capacityRebalance?: CapacityRebalance;
}

export interface SpotOptionsArgs extends core.SchemaArgs {
  allocationStrategy?: string | core.StringOut;

  instanceInterruptionBehavior?: string | core.StringOut;

  instancePoolsToUseCount?: number | core.NumberOut;

  maintenanceStrategies?: MaintenanceStrategies;
}

export class SpotOptions extends core.Schema<SpotOptionsArgs> {
  @core.attr(String)
  public allocationStrategy?: string | core.StringOut;

  @core.attr(String)
  public instanceInterruptionBehavior?: string | core.StringOut;

  @core.attr(Number)
  public instancePoolsToUseCount?: number | core.NumberOut;

  @core.attr(MaintenanceStrategies)
  public maintenanceStrategies?: MaintenanceStrategies;
}

export interface TargetCapacitySpecificationArgs extends core.SchemaArgs {
  defaultTargetCapacityType: string | core.StringOut;

  onDemandTargetCapacity?: number | core.NumberOut;

  spotTargetCapacity?: number | core.NumberOut;

  totalTargetCapacity: number | core.NumberOut;
}

export class TargetCapacitySpecification extends core.Schema<TargetCapacitySpecificationArgs> {
  @core.attr(String)
  public defaultTargetCapacityType!: string | core.StringOut;

  @core.attr(Number)
  public onDemandTargetCapacity?: number | core.NumberOut;

  @core.attr(Number)
  public spotTargetCapacity?: number | core.NumberOut;

  @core.attr(Number)
  public totalTargetCapacity!: number | core.NumberOut;
}

export interface LaunchTemplateSpecificationArgs extends core.SchemaArgs {
  launchTemplateId?: string | core.StringOut;

  launchTemplateName?: string | core.StringOut;

  version: string | core.StringOut;
}

export class LaunchTemplateSpecification extends core.Schema<LaunchTemplateSpecificationArgs> {
  @core.attr(String)
  public launchTemplateId?: string | core.StringOut;

  @core.attr(String)
  public launchTemplateName?: string | core.StringOut;

  @core.attr(String)
  public version!: string | core.StringOut;
}

export interface VcpuCountArgs extends core.SchemaArgs {
  max?: number | core.NumberOut;

  min: number | core.NumberOut;
}

export class VcpuCount extends core.Schema<VcpuCountArgs> {
  @core.attr(Number)
  public max?: number | core.NumberOut;

  @core.attr(Number)
  public min!: number | core.NumberOut;
}

export interface MemoryGibPerVcpuArgs extends core.SchemaArgs {
  max?: number | core.NumberOut;

  min?: number | core.NumberOut;
}

export class MemoryGibPerVcpu extends core.Schema<MemoryGibPerVcpuArgs> {
  @core.attr(Number)
  public max?: number | core.NumberOut;

  @core.attr(Number)
  public min?: number | core.NumberOut;
}

export interface AcceleratorTotalMemoryMibArgs extends core.SchemaArgs {
  max?: number | core.NumberOut;

  min?: number | core.NumberOut;
}

export class AcceleratorTotalMemoryMib extends core.Schema<AcceleratorTotalMemoryMibArgs> {
  @core.attr(Number)
  public max?: number | core.NumberOut;

  @core.attr(Number)
  public min?: number | core.NumberOut;
}

export interface TotalLocalStorageGbArgs extends core.SchemaArgs {
  max?: number | core.NumberOut;

  min?: number | core.NumberOut;
}

export class TotalLocalStorageGb extends core.Schema<TotalLocalStorageGbArgs> {
  @core.attr(Number)
  public max?: number | core.NumberOut;

  @core.attr(Number)
  public min?: number | core.NumberOut;
}

export interface BaselineEbsBandwidthMbpsArgs extends core.SchemaArgs {
  max?: number | core.NumberOut;

  min?: number | core.NumberOut;
}

export class BaselineEbsBandwidthMbps extends core.Schema<BaselineEbsBandwidthMbpsArgs> {
  @core.attr(Number)
  public max?: number | core.NumberOut;

  @core.attr(Number)
  public min?: number | core.NumberOut;
}

export interface MemoryMibArgs extends core.SchemaArgs {
  max?: number | core.NumberOut;

  min: number | core.NumberOut;
}

export class MemoryMib extends core.Schema<MemoryMibArgs> {
  @core.attr(Number)
  public max?: number | core.NumberOut;

  @core.attr(Number)
  public min!: number | core.NumberOut;
}

export interface NetworkInterfaceCountArgs extends core.SchemaArgs {
  max?: number | core.NumberOut;

  min?: number | core.NumberOut;
}

export class NetworkInterfaceCount extends core.Schema<NetworkInterfaceCountArgs> {
  @core.attr(Number)
  public max?: number | core.NumberOut;

  @core.attr(Number)
  public min?: number | core.NumberOut;
}

export interface AcceleratorCountArgs extends core.SchemaArgs {
  max?: number | core.NumberOut;

  min?: number | core.NumberOut;
}

export class AcceleratorCount extends core.Schema<AcceleratorCountArgs> {
  @core.attr(Number)
  public max?: number | core.NumberOut;

  @core.attr(Number)
  public min?: number | core.NumberOut;
}

export interface InstanceRequirementsArgs extends core.SchemaArgs {
  acceleratorCount?: AcceleratorCount;

  acceleratorManufacturers?: core.Array<string> | core.ArrayOut<core.StringOut>;

  acceleratorNames?: core.Array<string> | core.ArrayOut<core.StringOut>;

  acceleratorTotalMemoryMib?: AcceleratorTotalMemoryMib;

  acceleratorTypes?: core.Array<string> | core.ArrayOut<core.StringOut>;

  bareMetal?: string | core.StringOut;

  baselineEbsBandwidthMbps?: BaselineEbsBandwidthMbps;

  burstablePerformance?: string | core.StringOut;

  cpuManufacturers?: core.Array<string> | core.ArrayOut<core.StringOut>;

  excludedInstanceTypes?: core.Array<string> | core.ArrayOut<core.StringOut>;

  instanceGenerations?: core.Array<string> | core.ArrayOut<core.StringOut>;

  localStorage?: string | core.StringOut;

  localStorageTypes?: core.Array<string> | core.ArrayOut<core.StringOut>;

  memoryGibPerVcpu?: MemoryGibPerVcpu;

  memoryMib: MemoryMib;

  networkInterfaceCount?: NetworkInterfaceCount;

  onDemandMaxPricePercentageOverLowestPrice?: number | core.NumberOut;

  requireHibernateSupport?: boolean | core.BooleanOut;

  spotMaxPricePercentageOverLowestPrice?: number | core.NumberOut;

  totalLocalStorageGb?: TotalLocalStorageGb;

  vcpuCount: VcpuCount;
}

export class InstanceRequirements extends core.Schema<InstanceRequirementsArgs> {
  @core.attr(AcceleratorCount)
  public acceleratorCount?: AcceleratorCount;

  @core.attr(String, { kind: "array" })
  public acceleratorManufacturers?:
    | core.Array<string>
    | core.ArrayOut<core.StringOut>;

  @core.attr(String, { kind: "array" })
  public acceleratorNames?: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(AcceleratorTotalMemoryMib)
  public acceleratorTotalMemoryMib?: AcceleratorTotalMemoryMib;

  @core.attr(String, { kind: "array" })
  public acceleratorTypes?: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(String)
  public bareMetal?: string | core.StringOut;

  @core.attr(BaselineEbsBandwidthMbps)
  public baselineEbsBandwidthMbps?: BaselineEbsBandwidthMbps;

  @core.attr(String)
  public burstablePerformance?: string | core.StringOut;

  @core.attr(String, { kind: "array" })
  public cpuManufacturers?: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(String, { kind: "array" })
  public excludedInstanceTypes?:
    | core.Array<string>
    | core.ArrayOut<core.StringOut>;

  @core.attr(String, { kind: "array" })
  public instanceGenerations?:
    | core.Array<string>
    | core.ArrayOut<core.StringOut>;

  @core.attr(String)
  public localStorage?: string | core.StringOut;

  @core.attr(String, { kind: "array" })
  public localStorageTypes?: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(MemoryGibPerVcpu)
  public memoryGibPerVcpu?: MemoryGibPerVcpu;

  @core.attr(MemoryMib)
  public memoryMib!: MemoryMib;

  @core.attr(NetworkInterfaceCount)
  public networkInterfaceCount?: NetworkInterfaceCount;

  @core.attr(Number)
  public onDemandMaxPricePercentageOverLowestPrice?: number | core.NumberOut;

  @core.attr(Boolean)
  public requireHibernateSupport?: boolean | core.BooleanOut;

  @core.attr(Number)
  public spotMaxPricePercentageOverLowestPrice?: number | core.NumberOut;

  @core.attr(TotalLocalStorageGb)
  public totalLocalStorageGb?: TotalLocalStorageGb;

  @core.attr(VcpuCount)
  public vcpuCount!: VcpuCount;
}

export interface OverrideArgs extends core.SchemaArgs {
  availabilityZone?: string | core.StringOut;

  instanceRequirements?: InstanceRequirements;

  instanceType?: string | core.StringOut;

  maxPrice?: string | core.StringOut;

  priority?: number | core.NumberOut;

  subnetId?: string | core.StringOut;

  weightedCapacity?: number | core.NumberOut;
}

export class Override extends core.Schema<OverrideArgs> {
  @core.attr(String)
  public availabilityZone?: string | core.StringOut;

  @core.attr(InstanceRequirements)
  public instanceRequirements?: InstanceRequirements;

  @core.attr(String)
  public instanceType?: string | core.StringOut;

  @core.attr(String)
  public maxPrice?: string | core.StringOut;

  @core.attr(Number)
  public priority?: number | core.NumberOut;

  @core.attr(String)
  public subnetId?: string | core.StringOut;

  @core.attr(Number)
  public weightedCapacity?: number | core.NumberOut;
}

export interface LaunchTemplateConfigArgs extends core.SchemaArgs {
  launchTemplateSpecification: LaunchTemplateSpecification;

  override?: core.Array<Override> | core.ArrayOut<Override>;
}

export class LaunchTemplateConfig extends core.Schema<LaunchTemplateConfigArgs> {
  @core.attr(LaunchTemplateSpecification)
  public launchTemplateSpecification!: LaunchTemplateSpecification;

  @core.attr(Override, { kind: "array" })
  public override?: core.Array<Override> | core.ArrayOut<Override>;
}

export interface OnDemandOptionsArgs extends core.SchemaArgs {
  allocationStrategy?: string | core.StringOut;
}

export class OnDemandOptions extends core.Schema<OnDemandOptionsArgs> {
  @core.attr(String)
  public allocationStrategy?: string | core.StringOut;
}

export interface FleetArgs extends core.ResourceArgs {
  context?: string | core.StringOut;

  excessCapacityTerminationPolicy?: string | core.StringOut;

  launchTemplateConfig: LaunchTemplateConfig;

  onDemandOptions?: OnDemandOptions;

  replaceUnhealthyInstances?: boolean | core.BooleanOut;

  spotOptions?: SpotOptions;

  tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;

  targetCapacitySpecification: TargetCapacitySpecification;

  terminateInstances?: boolean | core.BooleanOut;

  terminateInstancesWithExpiration?: boolean | core.BooleanOut;

  type?: string | core.StringOut;
}

export class Fleet extends core.Resource<FleetArgs> {
  @core.attr(String, { computed: true })
  public arn!: string | core.StringOut;

  @core.attr(String)
  public context?: string | core.StringOut;

  @core.attr(String)
  public excessCapacityTerminationPolicy?: string | core.StringOut;

  @core.attr(String, { computed: true })
  public id!: string | core.StringOut;

  @core.attr(LaunchTemplateConfig)
  public launchTemplateConfig!: LaunchTemplateConfig;

  @core.attr(OnDemandOptions)
  public onDemandOptions?: OnDemandOptions;

  @core.attr(Boolean)
  public replaceUnhealthyInstances?: boolean | core.BooleanOut;

  @core.attr(SpotOptions)
  public spotOptions?: SpotOptions;

  @core.attr(String, { kind: "map" })
  public tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  @core.attr(String, { computed: true, kind: "map" })
  public tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;

  @core.attr(TargetCapacitySpecification)
  public targetCapacitySpecification!: TargetCapacitySpecification;

  @core.attr(Boolean)
  public terminateInstances?: boolean | core.BooleanOut;

  @core.attr(Boolean)
  public terminateInstancesWithExpiration?: boolean | core.BooleanOut;

  @core.attr(String)
  public type?: string | core.StringOut;

  constructor(name: string, args?: FleetArgs) {
    super(name, "aws_ec2_fleet", args);
  }

  public override getNamespace(): string {
    return "aws_ec2";
  }
}
