x-wafv2_webacl - AWS::WAFv2::WebACL

Module to create/use existing AWS::WAFv2::WebACL

x-wafv2_webacl:
  managed-wafv2_webacl-01:
    Properties: {}
    Lookup:
      Arn: <>
      Identifier: <>

Properties

Refer to the WAFv2 WebACL properties

Lookup

Lookup for WAFv2 WebACL is different: you cannot use Tags Instead you must set one of

  • Arn : The ARN of the WebACL

  • Identifier : The Identifier of the WebACL in the format name|id|scope

Other parameters for Lookup (RoleArn etc.) are valid as for other resources.

Services

There is no association at the moment with services as the WAF is considered an “Environment” resource, not one to be interacted with by ECS services.

If you need this feature, please open a Feature Request.

ReturnValues

You can export to environment variables the native AWS WAFv2 WebACL.ReturnValues , as per the documentation.

Hint

The only one excluded is Capacity as it is a number. Open a new FR to retrieve it.

JSON Schema

Model

x-wafv2_webacl

x-wafv2_webacl.spec.json

x-wafv2_webacl specification

type

object

properties

  • Lookup

type

object

properties

  • Arn

The ARN identifier.

type

string

format

^arn:(aws|aws-cn|aws-us-gov):([a-z0-9-]+):([a-z0-9-]+)?:(d{12})?:(.*$)

  • Identifier

The ID of the WAF Rule

type

string

pattern

^([\w\-_]+)\|([\w\-]+)\|(REGIONAL|GLOBAL)$

  • RoleArn

type

string

format

^arn:(aws|aws-cn|aws-us-gov):iam::(d{12}):role/(.*$)

  • Region

AWS Region to look for the resource into.

type

string

format

(af|ap|ca|eu|me|sa|us|cn|us)-[S]+-[d]$

additionalProperties

False

  • Properties

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-webacl.htm

type

object

  • MacroParameters

type

object

properties

additionalProperties

False

  • Services

x-resources.common.spec.json#/definitions/Services

  • LoadBalancers

List of x-elbv2 to Associate the WebACL with

type

array

items

type

string

Definition

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "id": "x-wafv2_webacl.spec.json",
  "$id": "x-wafv2_webacl.spec.json",
  "title": "x-wafv2_webacl",
  "description": "x-wafv2_webacl specification",
  "type": "object",
  "oneOf": [
    {
      "required": [
        "Properties"
      ]
    },
    {
      "required": [
        "Lookup"
      ]
    }
  ],
  "properties": {
    "Lookup": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "Arn": {
          "type": "string",
          "description": "The ARN identifier.",
          "format": "^arn:(aws|aws-cn|aws-us-gov):([a-z0-9-]+):([a-z0-9-]+)?:(\\d{12})?:(.*$)"
        },
        "Identifier": {
          "type": "string",
          "description": "The ID of the WAF Rule",
          "pattern": "^([\\w\\-_]+)\\|([\\w\\-]+)\\|(REGIONAL|GLOBAL)$"
        },
        "RoleArn": {
          "type": "string",
          "format": "^arn:(aws|aws-cn|aws-us-gov):iam::(\\d{12}):role/(.*$)"
        },
        "Region": {
          "type": "string",
          "format": "(af|ap|ca|eu|me|sa|us|cn|us)-[\\S]+-[\\d]$",
          "description": "AWS Region to look for the resource into."
        }
      }
    },
    "Properties": {
      "type": "object",
      "description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-webacl.htm"
    },
    "MacroParameters": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
      }
    },
    "Services": {
      "$ref": "x-resources.common.spec.json#/definitions/Services"
    },
    "LoadBalancers": {
      "type": "array",
      "description": "List of x-elbv2 to Associate the WebACL with",
      "items": {
        "type": "string"
      }
    }
  }
}

Test files

You can find the test files here to use as reference for your use-case.