// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS WAF Regional */ export interface WafregionalWebAclConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#metric_name WafregionalWebAcl#metric_name} */ readonly metricName: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#name WafregionalWebAcl#name} */ readonly name: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#tags WafregionalWebAcl#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#tags_all WafregionalWebAcl#tags_all} */ readonly tagsAll?: { [key: string]: string } | cdktf.IResolvable; /** * default_action block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#default_action WafregionalWebAcl#default_action} */ readonly defaultAction: WafregionalWebAclDefaultAction; /** * logging_configuration block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#logging_configuration WafregionalWebAcl#logging_configuration} */ readonly loggingConfiguration?: WafregionalWebAclLoggingConfiguration; /** * rule block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#rule WafregionalWebAcl#rule} */ readonly rule?: WafregionalWebAclRule[]; } export interface WafregionalWebAclDefaultAction { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#type WafregionalWebAcl#type} */ readonly type: string; } export function wafregionalWebAclDefaultActionToTerraform(struct?: WafregionalWebAclDefaultActionOutputReference | WafregionalWebAclDefaultAction): 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 { type: cdktf.stringToTerraform(struct!.type), } } export class WafregionalWebAclDefaultActionOutputReference 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(): WafregionalWebAclDefaultAction | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._type !== undefined) { hasAnyValues = true; internalValueResult.type = this._type; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: WafregionalWebAclDefaultAction | undefined) { if (value === undefined) { this.isEmptyObject = false; this._type = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._type = value.type; } } // 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 WafregionalWebAclLoggingConfigurationRedactedFieldsFieldToMatch { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#data WafregionalWebAcl#data} */ readonly data?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#type WafregionalWebAcl#type} */ readonly type: string; } export function wafregionalWebAclLoggingConfigurationRedactedFieldsFieldToMatchToTerraform(struct?: WafregionalWebAclLoggingConfigurationRedactedFieldsFieldToMatch): 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 interface WafregionalWebAclLoggingConfigurationRedactedFields { /** * field_to_match block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#field_to_match WafregionalWebAcl#field_to_match} */ readonly fieldToMatch: WafregionalWebAclLoggingConfigurationRedactedFieldsFieldToMatch[]; } export function wafregionalWebAclLoggingConfigurationRedactedFieldsToTerraform(struct?: WafregionalWebAclLoggingConfigurationRedactedFieldsOutputReference | WafregionalWebAclLoggingConfigurationRedactedFields): 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 { field_to_match: cdktf.listMapper(wafregionalWebAclLoggingConfigurationRedactedFieldsFieldToMatchToTerraform)(struct!.fieldToMatch), } } export class WafregionalWebAclLoggingConfigurationRedactedFieldsOutputReference 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(): WafregionalWebAclLoggingConfigurationRedactedFields | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._fieldToMatch !== undefined) { hasAnyValues = true; internalValueResult.fieldToMatch = this._fieldToMatch; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: WafregionalWebAclLoggingConfigurationRedactedFields | undefined) { if (value === undefined) { this.isEmptyObject = false; this._fieldToMatch = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._fieldToMatch = value.fieldToMatch; } } // field_to_match - computed: false, optional: false, required: true private _fieldToMatch?: WafregionalWebAclLoggingConfigurationRedactedFieldsFieldToMatch[]; public get fieldToMatch() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('field_to_match') as any; } public set fieldToMatch(value: WafregionalWebAclLoggingConfigurationRedactedFieldsFieldToMatch[]) { this._fieldToMatch = value; } // Temporarily expose input value. Use with caution. public get fieldToMatchInput() { return this._fieldToMatch; } } export interface WafregionalWebAclLoggingConfiguration { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#log_destination WafregionalWebAcl#log_destination} */ readonly logDestination: string; /** * redacted_fields block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#redacted_fields WafregionalWebAcl#redacted_fields} */ readonly redactedFields?: WafregionalWebAclLoggingConfigurationRedactedFields; } export function wafregionalWebAclLoggingConfigurationToTerraform(struct?: WafregionalWebAclLoggingConfigurationOutputReference | WafregionalWebAclLoggingConfiguration): 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 { log_destination: cdktf.stringToTerraform(struct!.logDestination), redacted_fields: wafregionalWebAclLoggingConfigurationRedactedFieldsToTerraform(struct!.redactedFields), } } export class WafregionalWebAclLoggingConfigurationOutputReference 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(): WafregionalWebAclLoggingConfiguration | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._logDestination !== undefined) { hasAnyValues = true; internalValueResult.logDestination = this._logDestination; } if (this._redactedFields?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.redactedFields = this._redactedFields?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: WafregionalWebAclLoggingConfiguration | undefined) { if (value === undefined) { this.isEmptyObject = false; this._logDestination = undefined; this._redactedFields.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._logDestination = value.logDestination; this._redactedFields.internalValue = value.redactedFields; } } // log_destination - computed: false, optional: false, required: true private _logDestination?: string; public get logDestination() { return this.getStringAttribute('log_destination'); } public set logDestination(value: string) { this._logDestination = value; } // Temporarily expose input value. Use with caution. public get logDestinationInput() { return this._logDestination; } // redacted_fields - computed: false, optional: true, required: false private _redactedFields = new WafregionalWebAclLoggingConfigurationRedactedFieldsOutputReference(this as any, "redacted_fields", true); public get redactedFields() { return this._redactedFields; } public putRedactedFields(value: WafregionalWebAclLoggingConfigurationRedactedFields) { this._redactedFields.internalValue = value; } public resetRedactedFields() { this._redactedFields.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get redactedFieldsInput() { return this._redactedFields.internalValue; } } export interface WafregionalWebAclRuleAction { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#type WafregionalWebAcl#type} */ readonly type: string; } export function wafregionalWebAclRuleActionToTerraform(struct?: WafregionalWebAclRuleActionOutputReference | WafregionalWebAclRuleAction): 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 { type: cdktf.stringToTerraform(struct!.type), } } export class WafregionalWebAclRuleActionOutputReference 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(): WafregionalWebAclRuleAction | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._type !== undefined) { hasAnyValues = true; internalValueResult.type = this._type; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: WafregionalWebAclRuleAction | undefined) { if (value === undefined) { this.isEmptyObject = false; this._type = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._type = value.type; } } // 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 WafregionalWebAclRuleOverrideAction { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#type WafregionalWebAcl#type} */ readonly type: string; } export function wafregionalWebAclRuleOverrideActionToTerraform(struct?: WafregionalWebAclRuleOverrideActionOutputReference | WafregionalWebAclRuleOverrideAction): 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 { type: cdktf.stringToTerraform(struct!.type), } } export class WafregionalWebAclRuleOverrideActionOutputReference 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(): WafregionalWebAclRuleOverrideAction | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._type !== undefined) { hasAnyValues = true; internalValueResult.type = this._type; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: WafregionalWebAclRuleOverrideAction | undefined) { if (value === undefined) { this.isEmptyObject = false; this._type = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._type = value.type; } } // 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 WafregionalWebAclRule { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#priority WafregionalWebAcl#priority} */ readonly priority: number; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#rule_id WafregionalWebAcl#rule_id} */ readonly ruleId: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#type WafregionalWebAcl#type} */ readonly type?: string; /** * action block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#action WafregionalWebAcl#action} */ readonly action?: WafregionalWebAclRuleAction; /** * override_action block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html#override_action WafregionalWebAcl#override_action} */ readonly overrideAction?: WafregionalWebAclRuleOverrideAction; } export function wafregionalWebAclRuleToTerraform(struct?: WafregionalWebAclRule): 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 { priority: cdktf.numberToTerraform(struct!.priority), rule_id: cdktf.stringToTerraform(struct!.ruleId), type: cdktf.stringToTerraform(struct!.type), action: wafregionalWebAclRuleActionToTerraform(struct!.action), override_action: wafregionalWebAclRuleOverrideActionToTerraform(struct!.overrideAction), } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html aws_wafregional_web_acl} */ export class WafregionalWebAcl extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_wafregional_web_acl"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html aws_wafregional_web_acl} 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 WafregionalWebAclConfig */ public constructor(scope: Construct, id: string, config: WafregionalWebAclConfig) { super(scope, id, { terraformResourceType: 'aws_wafregional_web_acl', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._metricName = config.metricName; this._name = config.name; this._tags = config.tags; this._tagsAll = config.tagsAll; this._defaultAction.internalValue = config.defaultAction; this._loggingConfiguration.internalValue = config.loggingConfiguration; this._rule = config.rule; } // ========== // 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; } // 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; } // default_action - computed: false, optional: false, required: true private _defaultAction = new WafregionalWebAclDefaultActionOutputReference(this as any, "default_action", true); public get defaultAction() { return this._defaultAction; } public putDefaultAction(value: WafregionalWebAclDefaultAction) { this._defaultAction.internalValue = value; } // Temporarily expose input value. Use with caution. public get defaultActionInput() { return this._defaultAction.internalValue; } // logging_configuration - computed: false, optional: true, required: false private _loggingConfiguration = new WafregionalWebAclLoggingConfigurationOutputReference(this as any, "logging_configuration", true); public get loggingConfiguration() { return this._loggingConfiguration; } public putLoggingConfiguration(value: WafregionalWebAclLoggingConfiguration) { this._loggingConfiguration.internalValue = value; } public resetLoggingConfiguration() { this._loggingConfiguration.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get loggingConfigurationInput() { return this._loggingConfiguration.internalValue; } // rule - computed: false, optional: true, required: false private _rule?: WafregionalWebAclRule[]; public get rule() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('rule') as any; } public set rule(value: WafregionalWebAclRule[]) { this._rule = value; } public resetRule() { this._rule = undefined; } // Temporarily expose input value. Use with caution. public get ruleInput() { return this._rule; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { metric_name: cdktf.stringToTerraform(this._metricName), name: cdktf.stringToTerraform(this._name), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), default_action: wafregionalWebAclDefaultActionToTerraform(this._defaultAction.internalValue), logging_configuration: wafregionalWebAclLoggingConfigurationToTerraform(this._loggingConfiguration.internalValue), rule: cdktf.listMapper(wafregionalWebAclRuleToTerraform)(this._rule), }; } }