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

export interface DnsRecordsArgs extends core.SchemaArgs {
  ttl: number | core.NumberOut;

  type: string | core.StringOut;
}

export class DnsRecords extends core.Schema<DnsRecordsArgs> {
  @core.attr(Number)
  public ttl!: number | core.NumberOut;

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

export interface DnsConfigArgs extends core.SchemaArgs {
  dnsRecords: core.Array<DnsRecords> | core.ArrayOut<DnsRecords>;

  namespaceId: string | core.StringOut;

  routingPolicy?: string | core.StringOut;
}

export class DnsConfig extends core.Schema<DnsConfigArgs> {
  @core.attr(DnsRecords, { kind: "array" })
  public dnsRecords!: core.Array<DnsRecords> | core.ArrayOut<DnsRecords>;

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

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

export interface HealthCheckConfigArgs extends core.SchemaArgs {
  failureThreshold?: number | core.NumberOut;

  resourcePath?: string | core.StringOut;

  type?: string | core.StringOut;
}

export class HealthCheckConfig extends core.Schema<HealthCheckConfigArgs> {
  @core.attr(Number)
  public failureThreshold?: number | core.NumberOut;

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

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

export interface HealthCheckCustomConfigArgs extends core.SchemaArgs {
  failureThreshold?: number | core.NumberOut;
}

export class HealthCheckCustomConfig extends core.Schema<HealthCheckCustomConfigArgs> {
  @core.attr(Number)
  public failureThreshold?: number | core.NumberOut;
}

export interface ServiceDiscoveryServiceArgs extends core.ResourceArgs {
  description?: string | core.StringOut;

  dnsConfig?: DnsConfig;

  forceDestroy?: boolean | core.BooleanOut;

  healthCheckConfig?: HealthCheckConfig;

  healthCheckCustomConfig?: HealthCheckCustomConfig;

  name: string | core.StringOut;

  namespaceId?: string | core.StringOut;

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

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

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

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

  @core.attr(DnsConfig)
  public dnsConfig?: DnsConfig;

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

  @core.attr(HealthCheckConfig)
  public healthCheckConfig?: HealthCheckConfig;

  @core.attr(HealthCheckCustomConfig)
  public healthCheckCustomConfig?: HealthCheckCustomConfig;

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

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

  @core.attr(String, { computed: true })
  public namespaceId?: 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>;

  constructor(name: string, args?: ServiceDiscoveryServiceArgs) {
    super(name, "aws_service_discovery_service", args);
  }

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