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

export interface SecretBlkArgs extends core.SchemaArgs {
  context?: core.Map<string, string> | core.MapOut<core.StringOut>;

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

  name: string | core.StringOut;

  payload: string | core.StringOut;
}

export class SecretBlk extends core.Schema<SecretBlkArgs> {
  @core.attr(String, { kind: "map" })
  public context?: core.Map<string, string> | core.MapOut<core.StringOut>;

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

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

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

export interface DsSecretArgs {
  secret: core.Array<SecretBlk> | core.ArrayOut<SecretBlk>;
}

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

  @core.attr(SecretBlk, { kind: "array" })
  public secret!: core.Array<SecretBlk> | core.ArrayOut<SecretBlk>;

  constructor(name: string, args?: DsSecretArgs) {
    super(name, "aws_kms_secret", args);
  }

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