// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS WAF */ export interface WafByteMatchSetConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_byte_match_set.html#name WafByteMatchSet#name} */ readonly name: string; /** * byte_match_tuples block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_byte_match_set.html#byte_match_tuples WafByteMatchSet#byte_match_tuples} */ readonly byteMatchTuples?: WafByteMatchSetByteMatchTuples[]; } export interface WafByteMatchSetByteMatchTuplesFieldToMatch { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_byte_match_set.html#data WafByteMatchSet#data} */ readonly data?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_byte_match_set.html#type WafByteMatchSet#type} */ readonly type: string; } export function wafByteMatchSetByteMatchTuplesFieldToMatchToTerraform(struct?: WafByteMatchSetByteMatchTuplesFieldToMatchOutputReference | WafByteMatchSetByteMatchTuplesFieldToMatch): 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: cdktf.stringToTerraform(struct!.data), type: cdktf.stringToTerraform(struct!.type), } } export class WafByteMatchSetByteMatchTuplesFieldToMatchOutputReference extends cdktf.ComplexObject { private isEmptyObject = false; /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param isSingleItem True if this is a block, false if it's a list */ public constructor(terraformResource: cdktf.ITerraformResource, terraformAttribute: string, isSingleItem: boolean) { super(terraformResource, terraformAttribute, isSingleItem); } public get internalValue(): WafByteMatchSetByteMatchTuplesFieldToMatch | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._data !== undefined) { hasAnyValues = true; internalValueResult.data = this._data; } if (this._type !== undefined) { hasAnyValues = true; internalValueResult.type = this._type; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: WafByteMatchSetByteMatchTuplesFieldToMatch | undefined) { if (value === undefined) { this.isEmptyObject = false; this._data = undefined; this._type = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._data = value.data; this._type = value.type; } } // data - computed: false, optional: true, required: false private _data?: string; public get data() { return this.getStringAttribute('data'); } public set data(value: string) { this._data = value; } public resetData() { this._data = undefined; } // Temporarily expose input value. Use with caution. public get dataInput() { return this._data; } // type - computed: false, optional: false, required: true private _type?: string; public get type() { return this.getStringAttribute('type'); } public set type(value: string) { this._type = value; } // Temporarily expose input value. Use with caution. public get typeInput() { return this._type; } } export interface WafByteMatchSetByteMatchTuples { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_byte_match_set.html#positional_constraint WafByteMatchSet#positional_constraint} */ readonly positionalConstraint: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_byte_match_set.html#target_string WafByteMatchSet#target_string} */ readonly targetString?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_byte_match_set.html#text_transformation WafByteMatchSet#text_transformation} */ readonly textTransformation: string; /** * field_to_match block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/waf_byte_match_set.html#field_to_match WafByteMatchSet#field_to_match} */ readonly fieldToMatch: WafByteMatchSetByteMatchTuplesFieldToMatch; } export function wafByteMatchSetByteMatchTuplesToTerraform(struct?: WafByteMatchSetByteMatchTuples): 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 { positional_constraint: cdktf.stringToTerraform(struct!.positionalConstraint), target_string: cdktf.stringToTerraform(struct!.targetString), text_transformation: cdktf.stringToTerraform(struct!.textTransformation), field_to_match: wafByteMatchSetByteMatchTuplesFieldToMatchToTerraform(struct!.fieldToMatch), } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/waf_byte_match_set.html aws_waf_byte_match_set} */ export class WafByteMatchSet extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_waf_byte_match_set"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/waf_byte_match_set.html aws_waf_byte_match_set} 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 WafByteMatchSetConfig */ public constructor(scope: Construct, id: string, config: WafByteMatchSetConfig) { super(scope, id, { terraformResourceType: 'aws_waf_byte_match_set', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._name = config.name; this._byteMatchTuples = config.byteMatchTuples; } // ========== // ATTRIBUTES // ========== // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // 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; } // byte_match_tuples - computed: false, optional: true, required: false private _byteMatchTuples?: WafByteMatchSetByteMatchTuples[]; public get byteMatchTuples() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('byte_match_tuples') as any; } public set byteMatchTuples(value: WafByteMatchSetByteMatchTuples[]) { this._byteMatchTuples = value; } public resetByteMatchTuples() { this._byteMatchTuples = undefined; } // Temporarily expose input value. Use with caution. public get byteMatchTuplesInput() { return this._byteMatchTuples; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { name: cdktf.stringToTerraform(this._name), byte_match_tuples: cdktf.listMapper(wafByteMatchSetByteMatchTuplesToTerraform)(this._byteMatchTuples), }; } }