2023-06-15 11:03:58 +00:00
|
|
|
def make_arn_for_wacl(
|
|
|
|
name: str, account_id: str, region_name: str, wacl_id: str, scope: str
|
|
|
|
) -> str:
|
2021-08-04 05:45:41 +00:00
|
|
|
"""https://docs.aws.amazon.com/waf/latest/developerguide/how-aws-waf-works.html - explains --scope (cloudfront vs regional)"""
|
|
|
|
|
|
|
|
if scope == "REGIONAL":
|
|
|
|
scope = "regional"
|
|
|
|
elif scope == "CLOUDFRONT":
|
|
|
|
scope = "global"
|
2022-08-13 09:49:43 +00:00
|
|
|
return f"arn:aws:wafv2:{region_name}:{account_id}:{scope}/webacl/{name}/{wacl_id}"
|