Amazon web services 在cloudformation模板中的不同WAFv2 WebACL中重用相同的规则

Amazon web services 在cloudformation模板中的不同WAFv2 WebACL中重用相同的规则,amazon-web-services,amazon-cloudformation,amazon-waf,Amazon Web Services,Amazon Cloudformation,Amazon Waf,在旧WAF中,我可以定义一个规则,然后在不同的WebACL中使用它,如下所示: HasAutorization: Type: "AWS::WAFRegional::ByteMatchSet" Properties: Name: "ByteMatch for matching Authorization header" ByteMatchTuples: - FieldToMatch: Type: "HEADER&qu

在旧WAF中,我可以定义一个规则,然后在不同的WebACL中使用它,如下所示:

HasAutorization:
Type: "AWS::WAFRegional::ByteMatchSet"
Properties:
  Name: "ByteMatch for matching Authorization header"
  ByteMatchTuples:
    - FieldToMatch:
        Type: "HEADER"
        Data: "Authorization"
      TargetString: "bearer"
      TextTransformation: "LOWERCASE"
      PositionalConstraint: "CONTAINS_WORD"

AuthorizationRule:
Type: AWS::WAFRegional::Rule
Properties:
  MetricName: AuthorizationRule
  Name: AuthorizationRule
  Predicates:
    - DataId: !Ref HasAutorization
      Negated: false
      Type: ByteMatch

DashboardACL:
  Type: "AWS::WAFRegional::WebACL"
  Properties:
    Name: "Protect backend from attacks"
    DefaultAction:
      Type: "BLOCK"
    MetricName: "DashboardACL"
    Rules:
      - Action:
          Type: "ALLOW"
        Priority: 1
        RuleId: !Ref "AuthorizationRule"


 GatewayACL:
  Type: "AWS::WAFRegional::WebACL"
  Properties:
    Name: "Protect platform from attacks"
    DefaultAction:
      Type: "BLOCK"
    MetricName: "DashboardACL"
    Rules:
      - Action:
          Type: "ALLOW"
        Priority: 1
        RuleId: !Ref "AuthorizationRule"
有没有一种方法可以让我在WAFv2中做同样的事情