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

export interface TagArgs extends core.SchemaArgs {
  key: string | core.StringOut;

  propagateAtLaunch: boolean | core.BooleanOut;

  value: string | core.StringOut;
}

export class Tag extends core.Schema<TagArgs> {
  @core.attr(String)
  public key!: string | core.StringOut;

  @core.attr(Boolean)
  public propagateAtLaunch!: boolean | core.BooleanOut;

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

export interface GroupTagArgs extends core.ResourceArgs {
  autoscalingGroupName: string | core.StringOut;

  tag: Tag;
}

export class GroupTag extends core.Resource<GroupTagArgs> {
  @core.attr(String)
  public autoscalingGroupName!: string | core.StringOut;

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

  @core.attr(Tag)
  public tag!: Tag;

  constructor(name: string, args?: GroupTagArgs) {
    super(name, "aws_autoscaling_group_tag", args);
  }

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