import * as core from "@terrascript/core"; export interface VisibilityConfigArgs extends core.SchemaArgs { cloudwatchMetricsEnabled: boolean | core.BooleanOut; metricName: string | core.StringOut; sampledRequestsEnabled: boolean | core.BooleanOut; } export class VisibilityConfig extends core.Schema { @core.attr(Boolean) public cloudwatchMetricsEnabled!: boolean | core.BooleanOut; @core.attr(String) public metricName!: string | core.StringOut; @core.attr(Boolean) public sampledRequestsEnabled!: boolean | core.BooleanOut; } export interface ForwardedIpConfigArgs extends core.SchemaArgs { fallbackBehavior: string | core.StringOut; headerName: string | core.StringOut; } export class ForwardedIpConfig extends core.Schema { @core.attr(String) public fallbackBehavior!: string | core.StringOut; @core.attr(String) public headerName!: string | core.StringOut; } export interface GeoMatchStatementArgs extends core.SchemaArgs { countryCodes: core.Array | core.ArrayOut; forwardedIpConfig?: ForwardedIpConfig; } export class GeoMatchStatement extends core.Schema { @core.attr(String, { kind: "array" }) public countryCodes!: core.Array | core.ArrayOut; @core.attr(ForwardedIpConfig) public forwardedIpConfig?: ForwardedIpConfig; } export interface LabelMatchStatementArgs extends core.SchemaArgs { key: string | core.StringOut; scope: string | core.StringOut; } export class LabelMatchStatement extends core.Schema { @core.attr(String) public key!: string | core.StringOut; @core.attr(String) public scope!: string | core.StringOut; } export interface MethodArgs extends core.SchemaArgs {} export class Method extends core.Schema {} export interface QueryStringArgs extends core.SchemaArgs {} export class QueryString extends core.Schema {} export interface SingleHeaderArgs extends core.SchemaArgs { name: string | core.StringOut; } export class SingleHeader extends core.Schema { @core.attr(String) public name!: string | core.StringOut; } export interface SingleQueryArgumentArgs extends core.SchemaArgs { name: string | core.StringOut; } export class SingleQueryArgument extends core.Schema { @core.attr(String) public name!: string | core.StringOut; } export interface UriPathArgs extends core.SchemaArgs {} export class UriPath extends core.Schema {} export interface AllQueryArgumentsArgs extends core.SchemaArgs {} export class AllQueryArguments extends core.Schema {} export interface BodyArgs extends core.SchemaArgs {} export class Body extends core.Schema {} export interface FieldToMatchArgs extends core.SchemaArgs { allQueryArguments?: AllQueryArguments; body?: Body; method?: Method; queryString?: QueryString; singleHeader?: SingleHeader; singleQueryArgument?: SingleQueryArgument; uriPath?: UriPath; } export class FieldToMatch extends core.Schema { @core.attr(AllQueryArguments) public allQueryArguments?: AllQueryArguments; @core.attr(Body) public body?: Body; @core.attr(Method) public method?: Method; @core.attr(QueryString) public queryString?: QueryString; @core.attr(SingleHeader) public singleHeader?: SingleHeader; @core.attr(SingleQueryArgument) public singleQueryArgument?: SingleQueryArgument; @core.attr(UriPath) public uriPath?: UriPath; } export interface TextTransformationArgs extends core.SchemaArgs { priority: number | core.NumberOut; type: string | core.StringOut; } export class TextTransformation extends core.Schema { @core.attr(Number) public priority!: number | core.NumberOut; @core.attr(String) public type!: string | core.StringOut; } export interface SizeConstraintStatementArgs extends core.SchemaArgs { comparisonOperator: string | core.StringOut; fieldToMatch?: FieldToMatch; size: number | core.NumberOut; textTransformation: | core.Array | core.ArrayOut; } export class SizeConstraintStatement extends core.Schema { @core.attr(String) public comparisonOperator!: string | core.StringOut; @core.attr(FieldToMatch) public fieldToMatch?: FieldToMatch; @core.attr(Number) public size!: number | core.NumberOut; @core.attr(TextTransformation, { kind: "array" }) public textTransformation!: | core.Array | core.ArrayOut; } export interface IpSetForwardedIpConfigArgs extends core.SchemaArgs { fallbackBehavior: string | core.StringOut; headerName: string | core.StringOut; position: string | core.StringOut; } export class IpSetForwardedIpConfig extends core.Schema { @core.attr(String) public fallbackBehavior!: string | core.StringOut; @core.attr(String) public headerName!: string | core.StringOut; @core.attr(String) public position!: string | core.StringOut; } export interface IpSetReferenceStatementArgs extends core.SchemaArgs { arn: string | core.StringOut; ipSetForwardedIpConfig?: IpSetForwardedIpConfig; } export class IpSetReferenceStatement extends core.Schema { @core.attr(String) public arn!: string | core.StringOut; @core.attr(IpSetForwardedIpConfig) public ipSetForwardedIpConfig?: IpSetForwardedIpConfig; } export interface XssMatchStatementArgs extends core.SchemaArgs { fieldToMatch?: FieldToMatch; textTransformation: | core.Array | core.ArrayOut; } export class XssMatchStatement extends core.Schema { @core.attr(FieldToMatch) public fieldToMatch?: FieldToMatch; @core.attr(TextTransformation, { kind: "array" }) public textTransformation!: | core.Array | core.ArrayOut; } export interface RegexPatternSetReferenceStatementArgs extends core.SchemaArgs { arn: string | core.StringOut; fieldToMatch?: FieldToMatch; textTransformation: | core.Array | core.ArrayOut; } export class RegexPatternSetReferenceStatement extends core.Schema { @core.attr(String) public arn!: string | core.StringOut; @core.attr(FieldToMatch) public fieldToMatch?: FieldToMatch; @core.attr(TextTransformation, { kind: "array" }) public textTransformation!: | core.Array | core.ArrayOut; } export interface SqliMatchStatementArgs extends core.SchemaArgs { fieldToMatch?: FieldToMatch; textTransformation: | core.Array | core.ArrayOut; } export class SqliMatchStatement extends core.Schema { @core.attr(FieldToMatch) public fieldToMatch?: FieldToMatch; @core.attr(TextTransformation, { kind: "array" }) public textTransformation!: | core.Array | core.ArrayOut; } export interface ByteMatchStatementArgs extends core.SchemaArgs { fieldToMatch?: FieldToMatch; positionalConstraint: string | core.StringOut; searchString: string | core.StringOut; textTransformation: | core.Array | core.ArrayOut; } export class ByteMatchStatement extends core.Schema { @core.attr(FieldToMatch) public fieldToMatch?: FieldToMatch; @core.attr(String) public positionalConstraint!: string | core.StringOut; @core.attr(String) public searchString!: string | core.StringOut; @core.attr(TextTransformation, { kind: "array" }) public textTransformation!: | core.Array | core.ArrayOut; } export interface RuleStatementOrStatementStatementNotStatementStatementArgs extends core.SchemaArgs { byteMatchStatement?: ByteMatchStatement; geoMatchStatement?: GeoMatchStatement; ipSetReferenceStatement?: IpSetReferenceStatement; labelMatchStatement?: LabelMatchStatement; regexPatternSetReferenceStatement?: RegexPatternSetReferenceStatement; sizeConstraintStatement?: SizeConstraintStatement; sqliMatchStatement?: SqliMatchStatement; xssMatchStatement?: XssMatchStatement; } export class RuleStatementOrStatementStatementNotStatementStatement extends core.Schema { @core.attr(ByteMatchStatement) public byteMatchStatement?: ByteMatchStatement; @core.attr(GeoMatchStatement) public geoMatchStatement?: GeoMatchStatement; @core.attr(IpSetReferenceStatement) public ipSetReferenceStatement?: IpSetReferenceStatement; @core.attr(LabelMatchStatement) public labelMatchStatement?: LabelMatchStatement; @core.attr(RegexPatternSetReferenceStatement) public regexPatternSetReferenceStatement?: RegexPatternSetReferenceStatement; @core.attr(SizeConstraintStatement) public sizeConstraintStatement?: SizeConstraintStatement; @core.attr(SqliMatchStatement) public sqliMatchStatement?: SqliMatchStatement; @core.attr(XssMatchStatement) public xssMatchStatement?: XssMatchStatement; } export interface RuleStatementOrStatementStatementNotStatementArgs extends core.SchemaArgs { statement: | core.Array | core.ArrayOut; } export class RuleStatementOrStatementStatementNotStatement extends core.Schema { @core.attr(RuleStatementOrStatementStatementNotStatementStatement, { kind: "array", }) public statement!: | core.Array | core.ArrayOut; } export interface RuleStatementOrStatementStatementOrStatementArgs extends core.SchemaArgs { statement: | core.Array | core.ArrayOut; } export class RuleStatementOrStatementStatementOrStatement extends core.Schema { @core.attr(RuleStatementOrStatementStatementNotStatementStatement, { kind: "array", }) public statement!: | core.Array | core.ArrayOut; } export interface RuleStatementOrStatementStatementAndStatementArgs extends core.SchemaArgs { statement: | core.Array | core.ArrayOut; } export class RuleStatementOrStatementStatementAndStatement extends core.Schema { @core.attr(RuleStatementOrStatementStatementNotStatementStatement, { kind: "array", }) public statement!: | core.Array | core.ArrayOut; } export interface RuleStatementOrStatementStatementArgs extends core.SchemaArgs { andStatement?: RuleStatementOrStatementStatementAndStatement; byteMatchStatement?: ByteMatchStatement; geoMatchStatement?: GeoMatchStatement; ipSetReferenceStatement?: IpSetReferenceStatement; labelMatchStatement?: LabelMatchStatement; notStatement?: RuleStatementOrStatementStatementNotStatement; orStatement?: RuleStatementOrStatementStatementOrStatement; regexPatternSetReferenceStatement?: RegexPatternSetReferenceStatement; sizeConstraintStatement?: SizeConstraintStatement; sqliMatchStatement?: SqliMatchStatement; xssMatchStatement?: XssMatchStatement; } export class RuleStatementOrStatementStatement extends core.Schema { @core.attr(RuleStatementOrStatementStatementAndStatement) public andStatement?: RuleStatementOrStatementStatementAndStatement; @core.attr(ByteMatchStatement) public byteMatchStatement?: ByteMatchStatement; @core.attr(GeoMatchStatement) public geoMatchStatement?: GeoMatchStatement; @core.attr(IpSetReferenceStatement) public ipSetReferenceStatement?: IpSetReferenceStatement; @core.attr(LabelMatchStatement) public labelMatchStatement?: LabelMatchStatement; @core.attr(RuleStatementOrStatementStatementNotStatement) public notStatement?: RuleStatementOrStatementStatementNotStatement; @core.attr(RuleStatementOrStatementStatementOrStatement) public orStatement?: RuleStatementOrStatementStatementOrStatement; @core.attr(RegexPatternSetReferenceStatement) public regexPatternSetReferenceStatement?: RegexPatternSetReferenceStatement; @core.attr(SizeConstraintStatement) public sizeConstraintStatement?: SizeConstraintStatement; @core.attr(SqliMatchStatement) public sqliMatchStatement?: SqliMatchStatement; @core.attr(XssMatchStatement) public xssMatchStatement?: XssMatchStatement; } export interface RuleStatementOrStatementArgs extends core.SchemaArgs { statement: | core.Array | core.ArrayOut; } export class RuleStatementOrStatement extends core.Schema { @core.attr(RuleStatementOrStatementStatement, { kind: "array" }) public statement!: | core.Array | core.ArrayOut; } export interface RuleStatementAndStatementArgs extends core.SchemaArgs { statement: | core.Array | core.ArrayOut; } export class RuleStatementAndStatement extends core.Schema { @core.attr(RuleStatementOrStatementStatement, { kind: "array" }) public statement!: | core.Array | core.ArrayOut; } export interface RuleStatementNotStatementArgs extends core.SchemaArgs { statement: | core.Array | core.ArrayOut; } export class RuleStatementNotStatement extends core.Schema { @core.attr(RuleStatementOrStatementStatement, { kind: "array" }) public statement!: | core.Array | core.ArrayOut; } export interface RuleStatementArgs extends core.SchemaArgs { andStatement?: RuleStatementAndStatement; byteMatchStatement?: ByteMatchStatement; geoMatchStatement?: GeoMatchStatement; ipSetReferenceStatement?: IpSetReferenceStatement; labelMatchStatement?: LabelMatchStatement; notStatement?: RuleStatementNotStatement; orStatement?: RuleStatementOrStatement; regexPatternSetReferenceStatement?: RegexPatternSetReferenceStatement; sizeConstraintStatement?: SizeConstraintStatement; sqliMatchStatement?: SqliMatchStatement; xssMatchStatement?: XssMatchStatement; } export class RuleStatement extends core.Schema { @core.attr(RuleStatementAndStatement) public andStatement?: RuleStatementAndStatement; @core.attr(ByteMatchStatement) public byteMatchStatement?: ByteMatchStatement; @core.attr(GeoMatchStatement) public geoMatchStatement?: GeoMatchStatement; @core.attr(IpSetReferenceStatement) public ipSetReferenceStatement?: IpSetReferenceStatement; @core.attr(LabelMatchStatement) public labelMatchStatement?: LabelMatchStatement; @core.attr(RuleStatementNotStatement) public notStatement?: RuleStatementNotStatement; @core.attr(RuleStatementOrStatement) public orStatement?: RuleStatementOrStatement; @core.attr(RegexPatternSetReferenceStatement) public regexPatternSetReferenceStatement?: RegexPatternSetReferenceStatement; @core.attr(SizeConstraintStatement) public sizeConstraintStatement?: SizeConstraintStatement; @core.attr(SqliMatchStatement) public sqliMatchStatement?: SqliMatchStatement; @core.attr(XssMatchStatement) public xssMatchStatement?: XssMatchStatement; } export interface InsertHeaderArgs extends core.SchemaArgs { name: string | core.StringOut; value: string | core.StringOut; } export class InsertHeader extends core.Schema { @core.attr(String) public name!: string | core.StringOut; @core.attr(String) public value!: string | core.StringOut; } export interface CustomRequestHandlingArgs extends core.SchemaArgs { insertHeader: core.Array | core.ArrayOut; } export class CustomRequestHandling extends core.Schema { @core.attr(InsertHeader, { kind: "array" }) public insertHeader!: core.Array | core.ArrayOut; } export interface AllowArgs extends core.SchemaArgs { customRequestHandling?: CustomRequestHandling; } export class Allow extends core.Schema { @core.attr(CustomRequestHandling) public customRequestHandling?: CustomRequestHandling; } export interface ResponseHeaderArgs extends core.SchemaArgs { name: string | core.StringOut; value: string | core.StringOut; } export class ResponseHeader extends core.Schema { @core.attr(String) public name!: string | core.StringOut; @core.attr(String) public value!: string | core.StringOut; } export interface CustomResponseArgs extends core.SchemaArgs { customResponseBodyKey?: string | core.StringOut; responseCode: number | core.NumberOut; responseHeader?: core.Array | core.ArrayOut; } export class CustomResponse extends core.Schema { @core.attr(String) public customResponseBodyKey?: string | core.StringOut; @core.attr(Number) public responseCode!: number | core.NumberOut; @core.attr(ResponseHeader, { kind: "array" }) public responseHeader?: | core.Array | core.ArrayOut; } export interface BlockArgs extends core.SchemaArgs { customResponse?: CustomResponse; } export class Block extends core.Schema { @core.attr(CustomResponse) public customResponse?: CustomResponse; } export interface CountArgs extends core.SchemaArgs { customRequestHandling?: CustomRequestHandling; } export class Count extends core.Schema { @core.attr(CustomRequestHandling) public customRequestHandling?: CustomRequestHandling; } export interface ActionArgs extends core.SchemaArgs { allow?: Allow; block?: Block; count?: Count; } export class Action extends core.Schema { @core.attr(Allow) public allow?: Allow; @core.attr(Block) public block?: Block; @core.attr(Count) public count?: Count; } export interface RuleLabelArgs extends core.SchemaArgs { name: string | core.StringOut; } export class RuleLabel extends core.Schema { @core.attr(String) public name!: string | core.StringOut; } export interface RuleArgs extends core.SchemaArgs { action: Action; name: string | core.StringOut; priority: number | core.NumberOut; ruleLabel?: core.Array | core.ArrayOut; statement: RuleStatement; visibilityConfig: VisibilityConfig; } export class Rule extends core.Schema { @core.attr(Action) public action!: Action; @core.attr(String) public name!: string | core.StringOut; @core.attr(Number) public priority!: number | core.NumberOut; @core.attr(RuleLabel, { kind: "array" }) public ruleLabel?: core.Array | core.ArrayOut; @core.attr(RuleStatement) public statement!: RuleStatement; @core.attr(VisibilityConfig) public visibilityConfig!: VisibilityConfig; } export interface CustomResponseBodyArgs extends core.SchemaArgs { content: string | core.StringOut; contentType: string | core.StringOut; key: string | core.StringOut; } export class CustomResponseBody extends core.Schema { @core.attr(String) public content!: string | core.StringOut; @core.attr(String) public contentType!: string | core.StringOut; @core.attr(String) public key!: string | core.StringOut; } export interface V2RuleGroupArgs extends core.ResourceArgs { /** * (Required, Forces new resource) The web ACL capacity units (WCUs) required for this rule group. See * [here](https://docs.aws.amazon.com/waf/latest/APIReference/API_CreateRuleGroup.html#API_CreateRuleGr * oup_RequestSyntax) for general information and [here](https://docs.aws.amazon.com/waf/latest/develop * erguide/waf-rule-statements-list.html) for capacity specific information. */ capacity: number | core.NumberOut; /** * (Optional) Defines custom response bodies that can be referenced by `custom_response` actions. See [ * Custom Response Body](#custom-response-body) below for details. */ customResponseBody?: | core.Array | core.ArrayOut; /** * (Optional) A friendly description of the rule group. */ description?: string | core.StringOut; /** * (Required, Forces new resource) A friendly name of the rule group. */ name: string | core.StringOut; /** * (Optional) The rule blocks used to identify the web requests that you want to `allow`, `block`, or ` * count`. See [Rules](#rules) below for details. */ rule?: core.Array | core.ArrayOut; /** * (Required, Forces new resource) Specifies whether this is for an AWS CloudFront distribution or for * a regional application. Valid values are `CLOUDFRONT` or `REGIONAL`. To work with CloudFront, you mu * st also specify the region `us-east-1` (N. Virginia) on the AWS provider. */ scope: string | core.StringOut; /** * (Optional) An array of key:value pairs to associate with the resource. If configured with a provider * [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/d * ocs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined * at the provider-level. */ tags?: core.Map | core.MapOut; /** * A map of tags assigned to the resource, including those inherited from the provider [`default_tags` * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags- * configuration-block). */ tagsAll?: core.Map | core.MapOut; /** * (Required) Defines and enables Amazon CloudWatch metrics and web request sample collection. See [Vis * ibility Configuration](#visibility-configuration) below for details. */ visibilityConfig: VisibilityConfig; } export class V2RuleGroup extends core.Resource { /** * (Required) The Amazon Resource Name (ARN) of the IP Set that this statement references. */ @core.attr(String, { computed: true }) public arn!: string | core.StringOut; /** * (Required, Forces new resource) The web ACL capacity units (WCUs) required for this rule group. See * [here](https://docs.aws.amazon.com/waf/latest/APIReference/API_CreateRuleGroup.html#API_CreateRuleGr * oup_RequestSyntax) for general information and [here](https://docs.aws.amazon.com/waf/latest/develop * erguide/waf-rule-statements-list.html) for capacity specific information. */ @core.attr(Number) public capacity!: number | core.NumberOut; /** * (Optional) Defines custom response bodies that can be referenced by `custom_response` actions. See [ * Custom Response Body](#custom-response-body) below for details. */ @core.attr(CustomResponseBody, { kind: "array" }) public customResponseBody?: | core.Array | core.ArrayOut; /** * (Optional) A friendly description of the rule group. */ @core.attr(String) public description?: string | core.StringOut; /** * The ID of the WAF rule group. */ @core.attr(String, { computed: true }) public id!: string | core.StringOut; @core.attr(String, { computed: true }) public lockToken!: string | core.StringOut; /** * (Required, Forces new resource) A friendly name of the rule group. */ @core.attr(String) public name!: string | core.StringOut; /** * (Optional) The rule blocks used to identify the web requests that you want to `allow`, `block`, or ` * count`. See [Rules](#rules) below for details. */ @core.attr(Rule, { kind: "array" }) public rule?: core.Array | core.ArrayOut; /** * (Required, Forces new resource) Specifies whether this is for an AWS CloudFront distribution or for * a regional application. Valid values are `CLOUDFRONT` or `REGIONAL`. To work with CloudFront, you mu * st also specify the region `us-east-1` (N. Virginia) on the AWS provider. */ @core.attr(String) public scope!: string | core.StringOut; /** * (Optional) An array of key:value pairs to associate with the resource. If configured with a provider * [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/d * ocs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined * at the provider-level. */ @core.attr(String, { kind: "map" }) public tags?: core.Map | core.MapOut; /** * A map of tags assigned to the resource, including those inherited from the provider [`default_tags` * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags- * configuration-block). */ @core.attr(String, { computed: true, kind: "map" }) public tagsAll?: core.Map | core.MapOut; /** * (Required) Defines and enables Amazon CloudWatch metrics and web request sample collection. See [Vis * ibility Configuration](#visibility-configuration) below for details. */ @core.attr(VisibilityConfig) public visibilityConfig!: VisibilityConfig; constructor(name: string, args?: V2RuleGroupArgs) { super(name, "aws_wafv2_rule_group", args); } public override getNamespace(): string { return "aws_waf"; } }