AWS WAF V2 Web ACL

This page shows how to write Terraform and CloudFormation for AWS WAF V2 Web ACL and write them securely.

aws_wafv2_web_acl (Terraform)

The Web ACL in AWS WAF V2 can be configured in Terraform with the resource name aws_wafv2_web_acl. The following sections describe 4 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L1
resource "aws_wafv2_web_acl" "aws_wafv2_web_acl_REGIONAL" {
  name        = "REGIONAL-managed-rule"
  description = "Example of a REGIONAL managed rule."
  scope       = "REGIONAL"

  default_action {
waf.tf#L2
resource "aws_wafv2_web_acl" "wec_acl" {
  name = "web-acl"
  scope = "REGIONAL"

  default_action {
    allow {}
waf2.tf#L1
resource "aws_wafv2_web_acl" "pass" {
  name        = "managed-rule-example"
  description = "Example of a managed rule."
  scope       = "REGIONAL"

  default_action {
waf.tf#L5
resource "aws_wafv2_web_acl" "covidportal_acl" {
  name  = "covid_portal"
  scope = "REGIONAL"

  default_action {
    allow {}

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters