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

export interface EbsConfigArgs extends core.SchemaArgs {
  iops?: number | core.NumberOut;

  size: number | core.NumberOut;

  type: string | core.StringOut;

  volumesPerInstance?: number | core.NumberOut;
}

export class EbsConfig extends core.Schema<EbsConfigArgs> {
  @core.attr(Number)
  public iops?: number | core.NumberOut;

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

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

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

export interface InstanceGroupArgs extends core.ResourceArgs {
  autoscalingPolicy?: string | core.StringOut;

  bidPrice?: string | core.StringOut;

  clusterId: string | core.StringOut;

  configurationsJson?: string | core.StringOut;

  ebsConfig?: core.Array<EbsConfig> | core.ArrayOut<EbsConfig>;

  ebsOptimized?: boolean | core.BooleanOut;

  instanceCount?: number | core.NumberOut;

  instanceType: string | core.StringOut;

  name?: string | core.StringOut;
}

export class InstanceGroup extends core.Resource<InstanceGroupArgs> {
  @core.attr(String)
  public autoscalingPolicy?: string | core.StringOut;

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

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

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

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

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

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

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

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

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

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

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

  constructor(name: string, args?: InstanceGroupArgs) {
    super(name, "aws_emr_instance_group", args);
  }

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