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

export interface KeyArgs extends core.ResourceArgs {
  bypassPolicyLockoutSafetyCheck?: boolean | core.BooleanOut;

  customerMasterKeySpec?: string | core.StringOut;

  deletionWindowInDays?: number | core.NumberOut;

  description?: string | core.StringOut;

  enableKeyRotation?: boolean | core.BooleanOut;

  isEnabled?: boolean | core.BooleanOut;

  keyUsage?: string | core.StringOut;

  multiRegion?: boolean | core.BooleanOut;

  policy?: string | core.StringOut;

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

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

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

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

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

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

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

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

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

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

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

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

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

  @core.attr(String, { computed: true })
  public policy?: 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?: KeyArgs) {
    super(name, "aws_kms_key", args);
  }

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