2021-08-04 05:45:41 +00:00
|
|
|
import uuid
|
|
|
|
|
|
|
|
from moto.wafv2.utils import make_arn_for_wacl
|
2022-08-13 09:49:43 +00:00
|
|
|
from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID
|
2021-08-04 05:45:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_make_arn_for_wacl():
|
|
|
|
uniqueID = str(uuid.uuid4())
|
|
|
|
region = "us-east-1"
|
|
|
|
name = "testName"
|
|
|
|
scope = "REGIONAL"
|
2022-08-13 09:49:43 +00:00
|
|
|
arn = make_arn_for_wacl(name, ACCOUNT_ID, region, uniqueID, scope)
|
2022-11-17 22:41:08 +00:00
|
|
|
assert (
|
|
|
|
arn == f"arn:aws:wafv2:{region}:{ACCOUNT_ID}:regional/webacl/{name}/{uniqueID}"
|
2021-08-04 05:45:41 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
scope = "CLOUDFRONT"
|
2022-08-13 09:49:43 +00:00
|
|
|
arn = make_arn_for_wacl(name, ACCOUNT_ID, region, uniqueID, scope)
|
2022-11-17 22:41:08 +00:00
|
|
|
assert arn == f"arn:aws:wafv2:{region}:{ACCOUNT_ID}:global/webacl/{name}/{uniqueID}"
|