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

export interface EbsOptionsArgs extends core.SchemaArgs {
  ebsEnabled: boolean | core.BooleanOut;

  iops?: number | core.NumberOut;

  throughput?: number | core.NumberOut;

  volumeSize?: number | core.NumberOut;

  volumeType?: string | core.StringOut;
}

export class EbsOptions extends core.Schema<EbsOptionsArgs> {
  @core.attr(Boolean)
  public ebsEnabled!: boolean | core.BooleanOut;

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

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

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

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

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

  value: number | core.NumberOut;
}

export class Duration extends core.Schema<DurationArgs> {
  @core.attr(String)
  public unit!: string | core.StringOut;

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

export interface MaintenanceScheduleArgs extends core.SchemaArgs {
  cronExpressionForRecurrence: string | core.StringOut;

  duration: Duration;

  startAt: string | core.StringOut;
}

export class MaintenanceSchedule extends core.Schema<MaintenanceScheduleArgs> {
  @core.attr(String)
  public cronExpressionForRecurrence!: string | core.StringOut;

  @core.attr(Duration)
  public duration!: Duration;

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

export interface AutoTuneOptionsArgs extends core.SchemaArgs {
  desiredState: string | core.StringOut;

  maintenanceSchedule?:
    | core.Array<MaintenanceSchedule>
    | core.ArrayOut<MaintenanceSchedule>;

  rollbackOnDisable?: string | core.StringOut;
}

export class AutoTuneOptions extends core.Schema<AutoTuneOptionsArgs> {
  @core.attr(String)
  public desiredState!: string | core.StringOut;

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

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

export interface VpcOptionsArgs extends core.SchemaArgs {
  availabilityZones: 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 VpcOptions extends core.Schema<VpcOptionsArgs> {
  @core.attr(String, { computed: true, kind: "array" })
  public availabilityZones!: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

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

export interface SnapshotOptionsArgs extends core.SchemaArgs {
  automatedSnapshotStartHour: number | core.NumberOut;
}

export class SnapshotOptions extends core.Schema<SnapshotOptionsArgs> {
  @core.attr(Number)
  public automatedSnapshotStartHour!: number | core.NumberOut;
}

export interface MasterUserOptionsArgs extends core.SchemaArgs {
  masterUserArn?: string | core.StringOut;

  masterUserName?: string | core.StringOut;

  masterUserPassword?: string | core.StringOut;
}

export class MasterUserOptions extends core.Schema<MasterUserOptionsArgs> {
  @core.attr(String)
  public masterUserArn?: string | core.StringOut;

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

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

export interface AdvancedSecurityOptionsArgs extends core.SchemaArgs {
  enabled: boolean | core.BooleanOut;

  internalUserDatabaseEnabled?: boolean | core.BooleanOut;

  masterUserOptions?: MasterUserOptions;
}

export class AdvancedSecurityOptions extends core.Schema<AdvancedSecurityOptionsArgs> {
  @core.attr(Boolean)
  public enabled!: boolean | core.BooleanOut;

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

  @core.attr(MasterUserOptions)
  public masterUserOptions?: MasterUserOptions;
}

export interface LogPublishingOptionsArgs extends core.SchemaArgs {
  cloudwatchLogGroupArn: string | core.StringOut;

  enabled?: boolean | core.BooleanOut;

  logType: string | core.StringOut;
}

export class LogPublishingOptions extends core.Schema<LogPublishingOptionsArgs> {
  @core.attr(String)
  public cloudwatchLogGroupArn!: string | core.StringOut;

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

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

export interface DomainEndpointOptionsArgs extends core.SchemaArgs {
  customEndpoint?: string | core.StringOut;

  customEndpointCertificateArn?: string | core.StringOut;

  customEndpointEnabled?: boolean | core.BooleanOut;

  enforceHttps?: boolean | core.BooleanOut;

  tlsSecurityPolicy?: string | core.StringOut;
}

export class DomainEndpointOptions extends core.Schema<DomainEndpointOptionsArgs> {
  @core.attr(String)
  public customEndpoint?: string | core.StringOut;

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

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

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

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

export interface NodeToNodeEncryptionArgs extends core.SchemaArgs {
  enabled: boolean | core.BooleanOut;
}

export class NodeToNodeEncryption extends core.Schema<NodeToNodeEncryptionArgs> {
  @core.attr(Boolean)
  public enabled!: boolean | core.BooleanOut;
}

export interface CognitoOptionsArgs extends core.SchemaArgs {
  enabled?: boolean | core.BooleanOut;

  identityPoolId: string | core.StringOut;

  roleArn: string | core.StringOut;

  userPoolId: string | core.StringOut;
}

export class CognitoOptions extends core.Schema<CognitoOptionsArgs> {
  @core.attr(Boolean)
  public enabled?: boolean | core.BooleanOut;

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

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

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

export interface EncryptAtRestArgs extends core.SchemaArgs {
  enabled: boolean | core.BooleanOut;

  kmsKeyId?: string | core.StringOut;
}

export class EncryptAtRest extends core.Schema<EncryptAtRestArgs> {
  @core.attr(Boolean)
  public enabled!: boolean | core.BooleanOut;

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

export interface ZoneAwarenessConfigArgs extends core.SchemaArgs {
  availabilityZoneCount?: number | core.NumberOut;
}

export class ZoneAwarenessConfig extends core.Schema<ZoneAwarenessConfigArgs> {
  @core.attr(Number)
  public availabilityZoneCount?: number | core.NumberOut;
}

export interface ColdStorageOptionsArgs extends core.SchemaArgs {
  enabled?: boolean | core.BooleanOut;
}

export class ColdStorageOptions extends core.Schema<ColdStorageOptionsArgs> {
  @core.attr(Boolean, { computed: true })
  public enabled?: boolean | core.BooleanOut;
}

export interface ClusterConfigArgs extends core.SchemaArgs {
  coldStorageOptions?: ColdStorageOptions;

  dedicatedMasterCount?: number | core.NumberOut;

  dedicatedMasterEnabled?: boolean | core.BooleanOut;

  dedicatedMasterType?: string | core.StringOut;

  instanceCount?: number | core.NumberOut;

  instanceType?: string | core.StringOut;

  warmCount?: number | core.NumberOut;

  warmEnabled?: boolean | core.BooleanOut;

  warmType?: string | core.StringOut;

  zoneAwarenessConfig?: ZoneAwarenessConfig;

  zoneAwarenessEnabled?: boolean | core.BooleanOut;
}

export class ClusterConfig extends core.Schema<ClusterConfigArgs> {
  @core.attr(ColdStorageOptions, { computed: true })
  public coldStorageOptions?: ColdStorageOptions;

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

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

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

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

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

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

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

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

  @core.attr(ZoneAwarenessConfig)
  public zoneAwarenessConfig?: ZoneAwarenessConfig;

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

export interface DomainArgs extends core.ResourceArgs {
  accessPolicies?: string | core.StringOut;

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

  advancedSecurityOptions?: AdvancedSecurityOptions;

  autoTuneOptions?: AutoTuneOptions;

  clusterConfig?: ClusterConfig;

  cognitoOptions?: CognitoOptions;

  domainEndpointOptions?: DomainEndpointOptions;

  domainName: string | core.StringOut;

  ebsOptions?: EbsOptions;

  encryptAtRest?: EncryptAtRest;

  engineVersion?: string | core.StringOut;

  logPublishingOptions?:
    | core.Array<LogPublishingOptions>
    | core.ArrayOut<LogPublishingOptions>;

  nodeToNodeEncryption?: NodeToNodeEncryption;

  snapshotOptions?: SnapshotOptions;

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

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

  vpcOptions?: VpcOptions;
}

export class Domain extends core.Resource<DomainArgs> {
  @core.attr(String, { computed: true })
  public accessPolicies?: string | core.StringOut;

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

  @core.attr(AdvancedSecurityOptions, { computed: true })
  public advancedSecurityOptions?: AdvancedSecurityOptions;

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

  @core.attr(AutoTuneOptions, { computed: true })
  public autoTuneOptions?: AutoTuneOptions;

  @core.attr(ClusterConfig, { computed: true })
  public clusterConfig?: ClusterConfig;

  @core.attr(CognitoOptions)
  public cognitoOptions?: CognitoOptions;

  @core.attr(DomainEndpointOptions, { computed: true })
  public domainEndpointOptions?: DomainEndpointOptions;

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

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

  @core.attr(EbsOptions, { computed: true })
  public ebsOptions?: EbsOptions;

  @core.attr(EncryptAtRest, { computed: true })
  public encryptAtRest?: EncryptAtRest;

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

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

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

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

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

  @core.attr(NodeToNodeEncryption, { computed: true })
  public nodeToNodeEncryption?: NodeToNodeEncryption;

  @core.attr(SnapshotOptions)
  public snapshotOptions?: SnapshotOptions;

  @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(VpcOptions)
  public vpcOptions?: VpcOptions;

  constructor(name: string, args?: DomainArgs) {
    super(name, "aws_opensearch_domain", args);
  }

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