Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
237 views
in Technique[技术] by (71.8m points)

amazon web services - Daily assign all Application Load Balancers to WAF

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

question from:https://stackoverflow.com/questions/65921345/daily-assign-all-application-load-balancers-to-waf

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...