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

export interface OidcArgs extends core.SchemaArgs {
  issuer: string | core.StringOut;
}

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

export interface IdentityArgs extends core.SchemaArgs {
  oidc: core.Array<Oidc> | core.ArrayOut<Oidc>;
}

export class Identity extends core.Schema<IdentityArgs> {
  @core.attr(Oidc, { computed: true, kind: "array" })
  public oidc!: core.Array<Oidc> | core.ArrayOut<Oidc>;
}

export interface KubernetesNetworkConfigArgs extends core.SchemaArgs {
  ipFamily: string | core.StringOut;

  serviceIpv4Cidr: string | core.StringOut;
}

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

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

export interface CertificateAuthorityArgs extends core.SchemaArgs {
  data: string | core.StringOut;
}

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

export interface VpcConfigArgs extends core.SchemaArgs {
  clusterSecurityGroupId: string | core.StringOut;

  endpointPrivateAccess: boolean | core.BooleanOut;

  endpointPublicAccess: boolean | core.BooleanOut;

  publicAccessCidrs: core.Array<string> | core.ArrayOut<core.StringOut>;

  securityGroupIds: core.Array<string> | core.ArrayOut<core.StringOut>;

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

  vpcId: string | core.StringOut;
}

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

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

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

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

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

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

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

export interface DsClusterArgs {
  name: string | core.StringOut;

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

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

  @core.attr(CertificateAuthority, { computed: true, kind: "array" })
  public certificateAuthority!:
    | core.Array<CertificateAuthority>
    | core.ArrayOut<CertificateAuthority>;

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

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

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

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

  @core.attr(Identity, { computed: true, kind: "array" })
  public identity!: core.Array<Identity> | core.ArrayOut<Identity>;

  @core.attr(KubernetesNetworkConfig, { computed: true, kind: "array" })
  public kubernetesNetworkConfig!:
    | core.Array<KubernetesNetworkConfig>
    | core.ArrayOut<KubernetesNetworkConfig>;

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

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

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

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

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

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

  @core.attr(VpcConfig, { computed: true, kind: "array" })
  public vpcConfig!: core.Array<VpcConfig> | core.ArrayOut<VpcConfig>;

  constructor(name: string, args?: DsClusterArgs) {
    super(name, "aws_eks_cluster", args);
  }

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