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

export interface LoadBalancerArgs extends core.SchemaArgs {
  containerName: string | core.StringOut;

  containerPort?: number | core.NumberOut;

  loadBalancerName?: string | core.StringOut;

  targetGroupArn?: string | core.StringOut;
}

export class LoadBalancer extends core.Schema<LoadBalancerArgs> {
  @core.attr(String)
  public containerName!: string | core.StringOut;

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

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

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

export interface CapacityProviderStrategyArgs extends core.SchemaArgs {
  base?: number | core.NumberOut;

  capacityProvider: string | core.StringOut;

  weight: number | core.NumberOut;
}

export class CapacityProviderStrategy extends core.Schema<CapacityProviderStrategyArgs> {
  @core.attr(Number)
  public base?: number | core.NumberOut;

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

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

export interface ServiceRegistriesArgs extends core.SchemaArgs {
  containerName?: string | core.StringOut;

  containerPort?: number | core.NumberOut;

  port?: number | core.NumberOut;

  registryArn: string | core.StringOut;
}

export class ServiceRegistries extends core.Schema<ServiceRegistriesArgs> {
  @core.attr(String)
  public containerName?: string | core.StringOut;

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

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

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

export interface ScaleArgs extends core.SchemaArgs {
  unit?: string | core.StringOut;

  value?: number | core.NumberOut;
}

export class Scale extends core.Schema<ScaleArgs> {
  @core.attr(String)
  public unit?: string | core.StringOut;

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

export interface NetworkConfigurationArgs extends core.SchemaArgs {
  assignPublicIp?: boolean | core.BooleanOut;

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

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

export class NetworkConfiguration extends core.Schema<NetworkConfigurationArgs> {
  @core.attr(Boolean)
  public assignPublicIp?: boolean | core.BooleanOut;

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

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

export interface TaskSetArgs extends core.ResourceArgs {
  capacityProviderStrategy?:
    | core.Array<CapacityProviderStrategy>
    | core.ArrayOut<CapacityProviderStrategy>;

  cluster: string | core.StringOut;

  externalId?: string | core.StringOut;

  forceDelete?: boolean | core.BooleanOut;

  launchType?: string | core.StringOut;

  loadBalancer?: core.Array<LoadBalancer> | core.ArrayOut<LoadBalancer>;

  networkConfiguration?: NetworkConfiguration;

  platformVersion?: string | core.StringOut;

  scale?: Scale;

  service: string | core.StringOut;

  serviceRegistries?: ServiceRegistries;

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

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

  taskDefinition: string | core.StringOut;

  waitUntilStable?: boolean | core.BooleanOut;

  waitUntilStableTimeout?: string | core.StringOut;
}

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

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

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

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

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

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

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

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

  @core.attr(NetworkConfiguration)
  public networkConfiguration?: NetworkConfiguration;

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

  @core.attr(Scale, { computed: true })
  public scale?: Scale;

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

  @core.attr(ServiceRegistries)
  public serviceRegistries?: ServiceRegistries;

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

  @core.attr(String, { computed: true })
  public status!: 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(String)
  public taskDefinition!: string | core.StringOut;

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

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

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

  constructor(name: string, args?: TaskSetArgs) {
    super(name, "aws_ecs_task_set", args);
  }

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