In my development environment, we constantly create and destroy applications for testing. I would like all Application Load Balancers (ALB) to be placed behind our single AWS Web Application Firewall (WAF) daily through a Lambda script. I want a trigger to run a script that finds all ALBs and then assigns them to the WAF. I can't seem to figure out which boto3 client I should be using to execute this in Python 3.8. Any guidance? Thanks
Asked
Active
Viewed 125 times
0
-
Better to use [wafv2](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/wafv2.html) and [elbv2](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/elbv2.html) – amitd Jan 27 '21 at 15:10
1 Answers
-1
I suggest use cloudtrail event, using lambda look for elb creation event and connect them to waf.
And I assume you are using SAM or serverless for lambda deployment.
Some usefull link https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-cloudtrail-logs.html
https://docs.aws.amazon.com/lambda/latest/dg/with-cloudtrail-example.html

alikian
- 21
- 7