// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS WAF */ export interface WafRateBasedRuleConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_rate_based_rule.html#metric_name WafRateBasedRule#metric_name} */ readonly metricName: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_rate_based_rule.html#name WafRateBasedRule#name} */ readonly name: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_rate_based_rule.html#rate_key WafRateBasedRule#rate_key} */ readonly rateKey: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_rate_based_rule.html#rate_limit WafRateBasedRule#rate_limit} */ readonly rateLimit: number; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_rate_based_rule.html#tags WafRateBasedRule#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_rate_based_rule.html#tags_all WafRateBasedRule#tags_all} */ readonly tagsAll?: { [key: string]: string } | cdktf.IResolvable; /** * predicates block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_rate_based_rule.html#predicates WafRateBasedRule#predicates} */ readonly predicates?: WafRateBasedRulePredicates[]; } export interface WafRateBasedRulePredicates { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_rate_based_rule.html#data_id WafRateBasedRule#data_id} */ readonly dataId: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_rate_based_rule.html#negated WafRateBasedRule#negated} */ readonly negated: boolean | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_rate_based_rule.html#type WafRateBasedRule#type} */ readonly type: string; } export function wafRateBasedRulePredicatesToTerraform(struct?: WafRateBasedRulePredicates): any { if (!cdktf.canInspect(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { data_id: cdktf.stringToTerraform(struct!.dataId), negated: cdktf.booleanToTerraform(struct!.negated), type: cdktf.stringToTerraform(struct!.type), } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/waf_rate_based_rule.html aws_waf_rate_based_rule} */ export class WafRateBasedRule extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_waf_rate_based_rule"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/waf_rate_based_rule.html aws_waf_rate_based_rule} Resource * * @param scope The scope in which to define this construct * @param id The scoped construct ID. Must be unique amongst siblings in the same scope * @param options WafRateBasedRuleConfig */ public constructor(scope: Construct, id: string, config: WafRateBasedRuleConfig) { super(scope, id, { terraformResourceType: 'aws_waf_rate_based_rule', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._metricName = config.metricName; this._name = config.name; this._rateKey = config.rateKey; this._rateLimit = config.rateLimit; this._tags = config.tags; this._tagsAll = config.tagsAll; this._predicates = config.predicates; } // ========== // ATTRIBUTES // ========== // arn - computed: true, optional: false, required: false public get arn() { return this.getStringAttribute('arn'); } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // metric_name - computed: false, optional: false, required: true private _metricName?: string; public get metricName() { return this.getStringAttribute('metric_name'); } public set metricName(value: string) { this._metricName = value; } // Temporarily expose input value. Use with caution. public get metricNameInput() { return this._metricName; } // name - computed: false, optional: false, required: true private _name?: string; public get name() { return this.getStringAttribute('name'); } public set name(value: string) { this._name = value; } // Temporarily expose input value. Use with caution. public get nameInput() { return this._name; } // rate_key - computed: false, optional: false, required: true private _rateKey?: string; public get rateKey() { return this.getStringAttribute('rate_key'); } public set rateKey(value: string) { this._rateKey = value; } // Temporarily expose input value. Use with caution. public get rateKeyInput() { return this._rateKey; } // rate_limit - computed: false, optional: false, required: true private _rateLimit?: number; public get rateLimit() { return this.getNumberAttribute('rate_limit'); } public set rateLimit(value: number) { this._rateLimit = value; } // Temporarily expose input value. Use with caution. public get rateLimitInput() { return this._rateLimit; } // tags - computed: false, optional: true, required: false private _tags?: { [key: string]: string } | cdktf.IResolvable; public get tags() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('tags') as any; } public set tags(value: { [key: string]: string } | cdktf.IResolvable) { this._tags = value; } public resetTags() { this._tags = undefined; } // Temporarily expose input value. Use with caution. public get tagsInput() { return this._tags; } // tags_all - computed: true, optional: true, required: false private _tagsAll?: { [key: string]: string } | cdktf.IResolvable; public get tagsAll() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('tags_all') as any; } public set tagsAll(value: { [key: string]: string } | cdktf.IResolvable) { this._tagsAll = value; } public resetTagsAll() { this._tagsAll = undefined; } // Temporarily expose input value. Use with caution. public get tagsAllInput() { return this._tagsAll; } // predicates - computed: false, optional: true, required: false private _predicates?: WafRateBasedRulePredicates[]; public get predicates() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('predicates') as any; } public set predicates(value: WafRateBasedRulePredicates[]) { this._predicates = value; } public resetPredicates() { this._predicates = undefined; } // Temporarily expose input value. Use with caution. public get predicatesInput() { return this._predicates; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { metric_name: cdktf.stringToTerraform(this._metricName), name: cdktf.stringToTerraform(this._name), rate_key: cdktf.stringToTerraform(this._rateKey), rate_limit: cdktf.numberToTerraform(this._rateLimit), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), predicates: cdktf.listMapper(wafRateBasedRulePredicatesToTerraform)(this._predicates), }; } }