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

export interface NetworkAclRuleArgs extends core.ResourceArgs {
  cidrBlock?: string | core.StringOut;

  egress?: boolean | core.BooleanOut;

  fromPort?: number | core.NumberOut;

  icmpCode?: number | core.NumberOut;

  icmpType?: number | core.NumberOut;

  ipv6CidrBlock?: string | core.StringOut;

  networkAclId: string | core.StringOut;

  protocol: string | core.StringOut;

  ruleAction: string | core.StringOut;

  ruleNumber: number | core.NumberOut;

  toPort?: number | core.NumberOut;
}

export class NetworkAclRule extends core.Resource<NetworkAclRuleArgs> {
  @core.attr(String)
  public cidrBlock?: string | core.StringOut;

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

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

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

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

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

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

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

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

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

  @core.attr(Number)
  public ruleNumber!: number | core.NumberOut;

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

  constructor(name: string, args?: NetworkAclRuleArgs) {
    super(name, "aws_network_acl_rule", args);
  }

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