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

export interface VpcConfigurationArgs extends core.SchemaArgs {
  roleArn: string | core.StringOut;

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

  subnetIds: core.Array<string> | core.ArrayOut<core.StringOut>;

  vpcId: string | core.StringOut;
}

export class VpcConfiguration extends core.Schema<VpcConfigurationArgs> {
  @core.attr(String)
  public roleArn!: string | core.StringOut;

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

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

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

export interface TopicRuleDestinationArgs extends core.ResourceArgs {
  enabled?: boolean | core.BooleanOut;

  vpcConfiguration: VpcConfiguration;
}

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

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

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

  @core.attr(VpcConfiguration)
  public vpcConfiguration!: VpcConfiguration;

  constructor(name: string, args?: TopicRuleDestinationArgs) {
    super(name, "aws_iot_topic_rule_destination", args);
  }

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