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

export interface RotationRulesArgs extends core.SchemaArgs {
  automaticallyAfterDays: number | core.NumberOut;
}

export class RotationRules extends core.Schema<RotationRulesArgs> {
  @core.attr(Number, { computed: true })
  public automaticallyAfterDays!: number | core.NumberOut;
}

export interface DsSecretRotationArgs {
  secretId: string | core.StringOut;
}

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

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

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

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

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

  constructor(name: string, args?: DsSecretRotationArgs) {
    super(name, "aws_secretsmanager_secret_rotation", args);
  }

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