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

export interface ClusterModeArgs extends core.SchemaArgs {
  numNodeGroups?: number | core.NumberOut;

  replicasPerNodeGroup?: number | core.NumberOut;
}

export class ClusterMode extends core.Schema<ClusterModeArgs> {
  @core.attr(Number, { computed: true })
  public numNodeGroups?: number | core.NumberOut;

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

export interface LogDeliveryConfigurationArgs extends core.SchemaArgs {
  destination: string | core.StringOut;

  destinationType: string | core.StringOut;

  logFormat: string | core.StringOut;

  logType: string | core.StringOut;
}

export class LogDeliveryConfiguration extends core.Schema<LogDeliveryConfigurationArgs> {
  @core.attr(String)
  public destination!: string | core.StringOut;

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

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

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

export interface ReplicationGroupArgs extends core.ResourceArgs {
  applyImmediately?: boolean | core.BooleanOut;

  atRestEncryptionEnabled?: boolean | core.BooleanOut;

  authToken?: string | core.StringOut;

  autoMinorVersionUpgrade?: string | core.StringOut;

  automaticFailoverEnabled?: boolean | core.BooleanOut;

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

  clusterMode?: ClusterMode;

  dataTieringEnabled?: boolean | core.BooleanOut;

  description?: string | core.StringOut;

  engine?: string | core.StringOut;

  engineVersion?: string | core.StringOut;

  finalSnapshotIdentifier?: string | core.StringOut;

  globalReplicationGroupId?: string | core.StringOut;

  kmsKeyId?: string | core.StringOut;

  logDeliveryConfiguration?:
    | core.Array<LogDeliveryConfiguration>
    | core.ArrayOut<LogDeliveryConfiguration>;

  maintenanceWindow?: string | core.StringOut;

  multiAzEnabled?: boolean | core.BooleanOut;

  nodeType?: string | core.StringOut;

  notificationTopicArn?: string | core.StringOut;

  numCacheClusters?: number | core.NumberOut;

  numNodeGroups?: number | core.NumberOut;

  numberCacheClusters?: number | core.NumberOut;

  parameterGroupName?: string | core.StringOut;

  port?: number | core.NumberOut;

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

  replicasPerNodeGroup?: number | core.NumberOut;

  replicationGroupDescription?: string | core.StringOut;

  replicationGroupId: string | core.StringOut;

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

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

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

  snapshotName?: string | core.StringOut;

  snapshotRetentionLimit?: number | core.NumberOut;

  snapshotWindow?: string | core.StringOut;

  subnetGroupName?: string | core.StringOut;

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

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

  transitEncryptionEnabled?: boolean | core.BooleanOut;

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

export class ReplicationGroup extends core.Resource<ReplicationGroupArgs> {
  @core.attr(Boolean, { computed: true })
  public applyImmediately?: boolean | core.BooleanOut;

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

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

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

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

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

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

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

  @core.attr(ClusterMode, { computed: true })
  public clusterMode?: ClusterMode;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @core.attr(String)
  public replicationGroupId!: string | 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 securityGroupNames?:
    | core.Array<string>
    | core.ArrayOut<core.StringOut>;

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

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

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

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

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

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

  constructor(name: string, args?: ReplicationGroupArgs) {
    super(name, "aws_elasticache_replication_group", args);
  }

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