Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Error with WAF #239

Open
firstval opened this issue Jan 15, 2020 · 0 comments
Open

Error with WAF #239

firstval opened this issue Jan 15, 2020 · 0 comments

Comments

@firstval
Copy link

firstval commented Jan 15, 2020

I getting an error with WAF even when I upload directly with the cloudformation it has no issues but using cfn-lint I get an error

This is the error message

2020-01-15 02:15:58,302 - cfnlint - INFO - Run scan of template main.yaml
E3002 Expecting an object at Resources/WAFACL/Properties/Rules
main.yaml:69:7

MYTEMPLATE

AWSTemplateFormatVersion: '2010-09-09'
Description: AWS WAF AWS Managed Rule Set for TWEB
############################
######   PARAMETERS   ######
############################
Parameters:
  Environment:
    Type: String
    Default: bt
    Description: The environment expected to be launch
    AllowedValues:
      - bt
      - stg
      - prd

############################
#######   MAPPINGS   #######
############################
Mappings:
  EnvironmentSource:
    bt:
      Name: bt-app-waf
    stg:
      Name: stg-app-waf
    prd:
      Name: prd-app-waf
############################
#######   RESOURCES   ######
############################
Resources:
  WAFACL:
    Type: AWS::WAFv2::WebACL
    Properties:
      Name: !FindInMap
        - EnvironmentSource
        - !Ref Environment
        - Name
      Description: !Join
        - ""
        - - "The AWS WAF set for "
          - !FindInMap
            - EnvironmentSource
            - !Ref Environment
            - Name
      DefaultAction:
        Allow: {}
      VisibilityConfig:
        SampledRequestsEnabled: true
        CloudWatchMetricsEnabled: true
        MetricName: !Join
          - ""
          - - !FindInMap
              - EnvironmentSource
              - !Ref Environment
              - Name
            - Metric
      Scope: REGIONAL
      Rules:
        - Priority: 1
          Name: !Join
            - ""
            - - !FindInMap
                - EnvironmentSource
                - !Ref Environment
                - Name
              - -CommonManagedRule
          OverrideAction:
            Count: {}
          VisibilityConfig:
            SampledRequestsEnabled: true
            CloudWatchMetricsEnabled: true
            MetricName: !Join
              - ""
              - - !FindInMap
                  - EnvironmentSource
                  - !Ref Environment
                  - Name
                - -AWSManagedCommonRuleMetric
          Statement:
            ManagedRuleGroupStatement:
              Name: AWSManagedRulesCommonRuleSet
              VendorName: AWS
    
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant