Amazon web services 如何使用Cloudformation在AWS WAF中启用WebACL日志记录?

Amazon web services 如何使用Cloudformation在AWS WAF中启用WebACL日志记录?,amazon-web-services,amazon-cloudformation,amazon-waf,aws-waf-security-automations,Amazon Web Services,Amazon Cloudformation,Amazon Waf,Aws Waf Security Automations,我正在浏览文档,但找不到启用日志记录的方法。我可以通过控制台启用日志记录,但我希望通过Cloudformation来实现,这样在新堆栈中默认情况下就可以启用日志记录 如何通过Cloudformation启用AWS WAF WebACL的登录 谢谢现在不支持它。可能是因为这个原因: 这意味着该堆栈需要在多个区域中创建资源 您可以在CloudFormation路线图页面上对此问题进行跟踪和投票,该问题目前不可用,但可以在创建新的web ACL时使用AWS配置设置日志记录。AWS WAF安全自动化已

我正在浏览文档,但找不到启用日志记录的方法。我可以通过控制台启用日志记录,但我希望通过Cloudformation来实现,这样在新堆栈中默认情况下就可以启用日志记录

如何通过Cloudformation启用AWS WAF WebACL的登录


谢谢

现在不支持它。可能是因为这个原因:

这意味着该堆栈需要在多个区域中创建资源


您可以在CloudFormation路线图页面上对此问题进行跟踪和投票,该问题目前不可用,但可以在创建新的web ACL时使用AWS配置设置日志记录。

AWS WAF安全自动化已使用lambda解决此问题

   ConfigureAWSWAFLogs:
    Type: 'Custom::ConfigureAWSWAFLogs'
    Condition: HttpFloodProtectionLogParserActivated
    Properties:
      ServiceToken: !GetAtt CustomResource.Arn
      WAFWebACLArn: !GetAtt WebACLStack.Outputs.WAFWebACLArn
      DeliveryStreamArn: !GetAtt FirehoseAthenaStack.Outputs.FirehoseWAFLogsDeliveryStreamArn
自定义资源lambda函数

elif event['ResourceType'] == "Custom::ConfigureAWSWAFLogs":
            if 'CREATE' in request_type:
                put_logging_configuration(log, event['ResourceProperties']['WAFWebACLArn'],
                                          event['ResourceProperties']['DeliveryStreamArn'])
查看


没有一种方法可以通过cloudformation在本地实现这一点。要做到这一点,您必须编写一个自定义lambda资源。