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 SpotMaintenanceStrategiesArgs extends core.SchemaArgs {
  capacityRebalance?: CapacityRebalance;
}

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

export interface EphemeralBlockDeviceArgs extends core.SchemaArgs {
  deviceName: string | core.StringOut;

  virtualName: string | core.StringOut;
}

export class EphemeralBlockDevice extends core.Schema<EphemeralBlockDeviceArgs> {
  @core.attr(String)
  public deviceName!: string | core.StringOut;

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

export interface RootBlockDeviceArgs extends core.SchemaArgs {
  deleteOnTermination?: boolean | core.BooleanOut;

  encrypted?: boolean | core.BooleanOut;

  iops?: number | core.NumberOut;

  kmsKeyId?: string | core.StringOut;

  throughput?: number | core.NumberOut;

  volumeSize?: number | core.NumberOut;

  volumeType?: string | core.StringOut;
}

export class RootBlockDevice extends core.Schema<RootBlockDeviceArgs> {
  @core.attr(Boolean)
  public deleteOnTermination?: boolean | core.BooleanOut;

  @core.attr(Boolean, { computed: true })
  public encrypted?: boolean | core.BooleanOut;

  @core.attr(Number, { computed: true })
  public iops?: number | core.NumberOut;

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

  @core.attr(Number, { computed: true })
  public throughput?: number | core.NumberOut;

  @core.attr(Number, { computed: true })
  public volumeSize?: number | core.NumberOut;

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

export interface EbsBlockDeviceArgs extends core.SchemaArgs {
  deleteOnTermination?: boolean | core.BooleanOut;

  deviceName: string | core.StringOut;

  encrypted?: boolean | core.BooleanOut;

  iops?: number | core.NumberOut;

  kmsKeyId?: string | core.StringOut;

  snapshotId?: string | core.StringOut;

  throughput?: number | core.NumberOut;

  volumeSize?: number | core.NumberOut;

  volumeType?: string | core.StringOut;
}

export class EbsBlockDevice extends core.Schema<EbsBlockDeviceArgs> {
  @core.attr(Boolean)
  public deleteOnTermination?: boolean | core.BooleanOut;

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

  @core.attr(Boolean, { computed: true })
  public encrypted?: boolean | core.BooleanOut;

  @core.attr(Number, { computed: true })
  public iops?: number | core.NumberOut;

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

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

  @core.attr(Number, { computed: true })
  public throughput?: number | core.NumberOut;

  @core.attr(Number, { computed: true })
  public volumeSize?: number | core.NumberOut;

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

export interface LaunchSpecificationArgs extends core.SchemaArgs {
  ami: string | core.StringOut;

  associatePublicIpAddress?: boolean | core.BooleanOut;

  availabilityZone?: string | core.StringOut;

  ebsBlockDevice?: core.Array<EbsBlockDevice> | core.ArrayOut<EbsBlockDevice>;

  ebsOptimized?: boolean | core.BooleanOut;

  ephemeralBlockDevice?:
    | core.Array<EphemeralBlockDevice>
    | core.ArrayOut<EphemeralBlockDevice>;

  iamInstanceProfile?: string | core.StringOut;

  iamInstanceProfileArn?: string | core.StringOut;

  instanceType: string | core.StringOut;

  keyName?: string | core.StringOut;

  monitoring?: boolean | core.BooleanOut;

  placementGroup?: string | core.StringOut;

  placementTenancy?: string | core.StringOut;

  rootBlockDevice?:
    | core.Array<RootBlockDevice>
    | core.ArrayOut<RootBlockDevice>;

  spotPrice?: string | core.StringOut;

  subnetId?: string | core.StringOut;

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

  userData?: string | core.StringOut;

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

  weightedCapacity?: string | core.StringOut;
}

export class LaunchSpecification extends core.Schema<LaunchSpecificationArgs> {
  @core.attr(String)
  public ami!: string | core.StringOut;

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

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

  @core.attr(EbsBlockDevice, { computed: true, kind: "array" })
  public ebsBlockDevice?:
    | core.Array<EbsBlockDevice>
    | core.ArrayOut<EbsBlockDevice>;

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

  @core.attr(EphemeralBlockDevice, { computed: true, kind: "array" })
  public ephemeralBlockDevice?:
    | core.Array<EphemeralBlockDevice>
    | core.ArrayOut<EphemeralBlockDevice>;

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

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

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

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

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

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

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

  @core.attr(RootBlockDevice, { computed: true, kind: "array" })
  public rootBlockDevice?:
    | core.Array<RootBlockDevice>
    | core.ArrayOut<RootBlockDevice>;

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

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

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

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

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

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

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

  name?: string | core.StringOut;

  version?: string | core.StringOut;
}

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

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

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

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 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 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 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 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 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 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 OverridesArgs extends core.SchemaArgs {
  availabilityZone?: string | core.StringOut;

  instanceRequirements?: InstanceRequirements;

  instanceType?: string | core.StringOut;

  priority?: number | core.NumberOut;

  spotPrice?: string | core.StringOut;

  subnetId?: string | core.StringOut;

  weightedCapacity?: number | core.NumberOut;
}

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

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

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

  @core.attr(Number, { computed: true })
  public priority?: number | core.NumberOut;

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

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

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

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

  overrides?: core.Array<Overrides> | core.ArrayOut<Overrides>;
}

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

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

export interface SpotFleetRequestArgs extends core.ResourceArgs {
  allocationStrategy?: string | core.StringOut;

  excessCapacityTerminationPolicy?: string | core.StringOut;

  fleetType?: string | core.StringOut;

  iamFleetRole: string | core.StringOut;

  instanceInterruptionBehaviour?: string | core.StringOut;

  instancePoolsToUseCount?: number | core.NumberOut;

  launchSpecification?:
    | core.Array<LaunchSpecification>
    | core.ArrayOut<LaunchSpecification>;

  launchTemplateConfig?:
    | core.Array<LaunchTemplateConfig>
    | core.ArrayOut<LaunchTemplateConfig>;

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

  onDemandAllocationStrategy?: string | core.StringOut;

  onDemandMaxTotalPrice?: string | core.StringOut;

  onDemandTargetCapacity?: number | core.NumberOut;

  replaceUnhealthyInstances?: boolean | core.BooleanOut;

  spotMaintenanceStrategies?: SpotMaintenanceStrategies;

  spotPrice?: string | core.StringOut;

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

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

  targetCapacity: number | core.NumberOut;

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

  terminateInstancesOnDelete?: string | core.StringOut;

  terminateInstancesWithExpiration?: boolean | core.BooleanOut;

  validFrom?: string | core.StringOut;

  validUntil?: string | core.StringOut;

  waitForFulfillment?: boolean | core.BooleanOut;
}

export class SpotFleetRequest extends core.Resource<SpotFleetRequestArgs> {
  @core.attr(String)
  public allocationStrategy?: string | core.StringOut;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @core.attr(SpotMaintenanceStrategies)
  public spotMaintenanceStrategies?: SpotMaintenanceStrategies;

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

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

  @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(Number)
  public targetCapacity!: number | core.NumberOut;

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

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

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

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

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

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

  constructor(name: string, args?: SpotFleetRequestArgs) {
    super(name, "aws_spot_fleet_request", args);
  }

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