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)
|
2021-08-04 05:45:41 +00:00
|
|
|
assert arn == "arn:aws:wafv2:{}:{}:regional/webacl/{}/{}".format(
|
|
|
|
region, ACCOUNT_ID, name, uniqueID
|
|
|
|
)
|
|
|
|
|
|
|
|
scope = "CLOUDFRONT"
|
2022-08-13 09:49:43 +00:00
|
|
|
arn = make_arn_for_wacl(name, ACCOUNT_ID, region, uniqueID, scope)
|
2021-08-04 05:45:41 +00:00
|
|
|
assert arn == "arn:aws:wafv2:{}:{}:global/webacl/{}/{}".format(
|
|
|
|
region, ACCOUNT_ID, name, uniqueID
|
|
|
|
)
|