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

export interface ConfigurationsArgs extends core.SchemaArgs {
  classification?: string | core.StringOut;

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

export class Configurations extends core.Schema<ConfigurationsArgs> {
  @core.attr(String)
  public classification?: string | core.StringOut;

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

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

  size: number | core.NumberOut;

  type: string | core.StringOut;

  volumesPerInstance?: number | core.NumberOut;
}

export class InstanceTypeConfigsEbsConfig extends core.Schema<InstanceTypeConfigsEbsConfigArgs> {
  @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 InstanceTypeConfigsArgs extends core.SchemaArgs {
  bidPrice?: string | core.StringOut;

  bidPriceAsPercentageOfOnDemandPrice?: number | core.NumberOut;

  configurations?: core.Array<Configurations> | core.ArrayOut<Configurations>;

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

  instanceType: string | core.StringOut;

  weightedCapacity?: number | core.NumberOut;
}

export class InstanceTypeConfigs extends core.Schema<InstanceTypeConfigsArgs> {
  @core.attr(String)
  public bidPrice?: string | core.StringOut;

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

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

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

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

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

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

export class OnDemandSpecification extends core.Schema<OnDemandSpecificationArgs> {
  @core.attr(String)
  public allocationStrategy!: string | core.StringOut;
}

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

  blockDurationMinutes?: number | core.NumberOut;

  timeoutAction: string | core.StringOut;

  timeoutDurationMinutes: number | core.NumberOut;
}

export class SpotSpecification extends core.Schema<SpotSpecificationArgs> {
  @core.attr(String)
  public allocationStrategy!: string | core.StringOut;

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

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

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

export interface LaunchSpecificationsArgs extends core.SchemaArgs {
  onDemandSpecification?:
    | core.Array<OnDemandSpecification>
    | core.ArrayOut<OnDemandSpecification>;

  spotSpecification?:
    | core.Array<SpotSpecification>
    | core.ArrayOut<SpotSpecification>;
}

export class LaunchSpecifications extends core.Schema<LaunchSpecificationsArgs> {
  @core.attr(OnDemandSpecification, { kind: "array" })
  public onDemandSpecification?:
    | core.Array<OnDemandSpecification>
    | core.ArrayOut<OnDemandSpecification>;

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

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

  instanceTypeConfigs?:
    | core.Array<InstanceTypeConfigs>
    | core.ArrayOut<InstanceTypeConfigs>;

  launchSpecifications?: LaunchSpecifications;

  name?: string | core.StringOut;

  provisionedOnDemandCapacity: number | core.NumberOut;

  provisionedSpotCapacity: number | core.NumberOut;

  targetOnDemandCapacity?: number | core.NumberOut;

  targetSpotCapacity?: number | core.NumberOut;
}

export class MasterInstanceFleet extends core.Schema<MasterInstanceFleetArgs> {
  @core.attr(String, { computed: true })
  public id!: string | core.StringOut;

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

  @core.attr(LaunchSpecifications)
  public launchSpecifications?: LaunchSpecifications;

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

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

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

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

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

export interface BootstrapActionArgs extends core.SchemaArgs {
  args?: core.Array<string> | core.ArrayOut<core.StringOut>;

  name: string | core.StringOut;

  path: string | core.StringOut;
}

export class BootstrapAction extends core.Schema<BootstrapActionArgs> {
  @core.attr(String, { kind: "array" })
  public args?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

export interface AutoTerminationPolicyArgs extends core.SchemaArgs {
  idleTimeout?: number | core.NumberOut;
}

export class AutoTerminationPolicy extends core.Schema<AutoTerminationPolicyArgs> {
  @core.attr(Number)
  public idleTimeout?: number | core.NumberOut;
}

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

  size: number | core.NumberOut;

  throughput?: number | core.NumberOut;

  type: string | core.StringOut;

  volumesPerInstance?: number | core.NumberOut;
}

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

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

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

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

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

export interface MasterInstanceGroupArgs extends core.SchemaArgs {
  bidPrice?: string | core.StringOut;

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

  id: string | core.StringOut;

  instanceCount?: number | core.NumberOut;

  instanceType: string | core.StringOut;

  name?: string | core.StringOut;
}

export class MasterInstanceGroup extends core.Schema<MasterInstanceGroupArgs> {
  @core.attr(String)
  public bidPrice?: string | core.StringOut;

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

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

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

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

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

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

  instanceTypeConfigs?:
    | core.Array<InstanceTypeConfigs>
    | core.ArrayOut<InstanceTypeConfigs>;

  launchSpecifications?: LaunchSpecifications;

  name?: string | core.StringOut;

  provisionedOnDemandCapacity: number | core.NumberOut;

  provisionedSpotCapacity: number | core.NumberOut;

  targetOnDemandCapacity?: number | core.NumberOut;

  targetSpotCapacity?: number | core.NumberOut;
}

export class CoreInstanceFleet extends core.Schema<CoreInstanceFleetArgs> {
  @core.attr(String, { computed: true })
  public id!: string | core.StringOut;

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

  @core.attr(LaunchSpecifications)
  public launchSpecifications?: LaunchSpecifications;

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

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

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

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

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

export interface HadoopJarStepArgs extends core.SchemaArgs {
  args?: core.Array<string> | core.ArrayOut<core.StringOut>;

  jar: string | core.StringOut;

  mainClass?: string | core.StringOut;

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

export class HadoopJarStep extends core.Schema<HadoopJarStepArgs> {
  @core.attr(String, { kind: "array" })
  public args?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

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

export interface StepArgs extends core.SchemaArgs {
  actionOnFailure: string | core.StringOut;

  hadoopJarStep: HadoopJarStep;

  name: string | core.StringOut;
}

export class Step extends core.Schema<StepArgs> {
  @core.attr(String)
  public actionOnFailure!: string | core.StringOut;

  @core.attr(HadoopJarStep)
  public hadoopJarStep!: HadoopJarStep;

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

export interface Ec2AttributesArgs extends core.SchemaArgs {
  additionalMasterSecurityGroups?: string | core.StringOut;

  additionalSlaveSecurityGroups?: string | core.StringOut;

  emrManagedMasterSecurityGroup?: string | core.StringOut;

  emrManagedSlaveSecurityGroup?: string | core.StringOut;

  instanceProfile: string | core.StringOut;

  keyName?: string | core.StringOut;

  serviceAccessSecurityGroup?: string | core.StringOut;

  subnetId?: string | core.StringOut;

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

export class Ec2Attributes extends core.Schema<Ec2AttributesArgs> {
  @core.attr(String)
  public additionalMasterSecurityGroups?: string | core.StringOut;

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

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

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

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

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

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

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

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

export interface KerberosAttributesArgs extends core.SchemaArgs {
  adDomainJoinPassword?: string | core.StringOut;

  adDomainJoinUser?: string | core.StringOut;

  crossRealmTrustPrincipalPassword?: string | core.StringOut;

  kdcAdminPassword: string | core.StringOut;

  realm: string | core.StringOut;
}

export class KerberosAttributes extends core.Schema<KerberosAttributesArgs> {
  @core.attr(String)
  public adDomainJoinPassword?: string | core.StringOut;

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

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

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

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

export interface CoreInstanceGroupArgs extends core.SchemaArgs {
  autoscalingPolicy?: string | core.StringOut;

  bidPrice?: string | core.StringOut;

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

  id: string | core.StringOut;

  instanceCount?: number | core.NumberOut;

  instanceType: string | core.StringOut;

  name?: string | core.StringOut;
}

export class CoreInstanceGroup extends core.Schema<CoreInstanceGroupArgs> {
  @core.attr(String)
  public autoscalingPolicy?: string | core.StringOut;

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

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

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

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

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

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

export interface ClusterArgs extends core.ResourceArgs {
  additionalInfo?: string | core.StringOut;

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

  autoTerminationPolicy?: AutoTerminationPolicy;

  autoscalingRole?: string | core.StringOut;

  bootstrapAction?:
    | core.Array<BootstrapAction>
    | core.ArrayOut<BootstrapAction>;

  configurations?: string | core.StringOut;

  configurationsJson?: string | core.StringOut;

  coreInstanceFleet?: CoreInstanceFleet;

  coreInstanceGroup?: CoreInstanceGroup;

  customAmiId?: string | core.StringOut;

  ebsRootVolumeSize?: number | core.NumberOut;

  ec2Attributes?: Ec2Attributes;

  keepJobFlowAliveWhenNoSteps?: boolean | core.BooleanOut;

  kerberosAttributes?: KerberosAttributes;

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

  logEncryptionKmsKeyId?: string | core.StringOut;

  logUri?: string | core.StringOut;

  masterInstanceFleet?: MasterInstanceFleet;

  masterInstanceGroup?: MasterInstanceGroup;

  name: string | core.StringOut;

  releaseLabel: string | core.StringOut;

  scaleDownBehavior?: string | core.StringOut;

  securityConfiguration?: string | core.StringOut;

  serviceRole: string | core.StringOut;

  step?: core.Array<Step> | core.ArrayOut<Step>;

  stepConcurrencyLevel?: number | core.NumberOut;

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

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

  terminationProtection?: boolean | core.BooleanOut;

  visibleToAllUsers?: boolean | core.BooleanOut;
}

export class Cluster extends core.Resource<ClusterArgs> {
  @core.attr(String)
  public additionalInfo?: string | core.StringOut;

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

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

  @core.attr(AutoTerminationPolicy)
  public autoTerminationPolicy?: AutoTerminationPolicy;

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

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

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

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

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

  @core.attr(CoreInstanceFleet, { computed: true })
  public coreInstanceFleet?: CoreInstanceFleet;

  @core.attr(CoreInstanceGroup, { computed: true })
  public coreInstanceGroup?: CoreInstanceGroup;

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

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

  @core.attr(Ec2Attributes)
  public ec2Attributes?: Ec2Attributes;

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

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

  @core.attr(KerberosAttributes)
  public kerberosAttributes?: KerberosAttributes;

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

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

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

  @core.attr(MasterInstanceFleet, { computed: true })
  public masterInstanceFleet?: MasterInstanceFleet;

  @core.attr(MasterInstanceGroup, { computed: true })
  public masterInstanceGroup?: MasterInstanceGroup;

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

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

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

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

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

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

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

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

  @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(Boolean, { computed: true })
  public terminationProtection?: boolean | core.BooleanOut;

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

  constructor(name: string, args?: ClusterArgs) {
    super(name, "aws_emr_cluster", args);
  }

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