api-gateway-waf

dod-iac/api-gateway-waf/aws

Terraform Module HCL AWS

AWS WAF Regional Web ACL for use with AWS API Gateway REST API

Install
module "api-gateway-waf" {
source = "dod-iac/api-gateway-waf/aws"
version = "1.0.0"
}
plain text: /constructs/tfmod-dod-iac-api-gateway-waf-aws/install.txt
⭐ Source on GitHub 📦 Registry page
README

Usage Creates an AWS WAF Regional Web ACL for use with AWS API Gateway REST API. This is a regional resource, so you must create the WAF in the same region as your API Gateway. ``hcl module "cloudfront_waf" { source = "dod-iac/api-gateway-waf/aws" name = format("app-%s-api-%s", var.application, var.environment) metric_name = format("app%sApi%s", title(var.application), title(var.environment)) allowed_hosts = [format("%s.execute-api.%s.amazonaws.com", aws_api_gateway_rest_api.main.id, data.aws_region.current.name)] tags = { Application = var.application Environment = var.environment Automation = "Terraform" } } ` You can then associate the WAF with a REST API stage using the aws_wafregional_web_acl_association terraform resource. If you are not using terraform to manage API Gateway stages,

Inputs (7)
NameTypeDescriptionDefault
allowed_hostslist(string)List of allowed values for the host header. required
namestringThe name or description of the web ACL. required
metric_namestringThe name or description for the Amazon CloudWatch metric of this web ACL. required
tagsmap(string)A mapping of tags to assign to the WAF Web ACL Resource and WAF Rules.{}
aws_wafregional_byte_match_set_allowed_hosts_namestringThe name of the aws_wafregional_byte_match_set used by the rule used for filteri""
aws_wafregional_rule_allowed_hosts_namestringThe name of the rule used for filtering by host header. Defaults to "[name]-all""
aws_wafregional_rule_allowed_hosts_metric_namestringThe metric name of the rule used for filtering by host header. Defaults to "[me""
Outputs (1)
web_acl_id — The ID of the WAF WebACL.
Resources (3)
aws_wafregional_byte_match_setaws_wafregional_ruleaws_wafregional_web_acl
Topics & Tags
terraformawswaf
Details
FrameworkTerraform Module
LanguageHCL
Version1.0.0
Cloud AWS
★ Stars1
Forks2
Total downloads8.2k
Inputs7
Outputs1
Resources3
LicenseMIT
Namespacedod-iac
Updated