Skip to content

Commit db14a3a

Browse files
committed
Added Glue SR Regexp
1 parent fe3258f commit db14a3a

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

src/compose_x_common/aws/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# SPDX-License-Identifier: MPL-2.0
22
# Copyright 2020-2022 John Mille <[email protected]>
3-
# SPDX-License-Identifier: MPL-2.0
4-
# Copyright 2020-2022 John Mille <[email protected]>
53

64
from __future__ import annotations
75

src/compose_x_common/aws/arns.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from compose_x_common.aws.ecs import CLUSTER_ID_ARN_RE
1010
from compose_x_common.aws.ecs.services import SERVICE_ARN_RE
1111
from compose_x_common.aws.elasticache import CACHE_CLUSTER_ARN_RE
12+
from compose_x_common.aws.glue import GLUE_SR_ARN_RE
1213
from compose_x_common.aws.iam import IAM_ROLE_ARN_RE, IAM_USER_ARN_RE
1314
from compose_x_common.aws.kinesis import KINESIS_FIREHOSE_ARN_RE, KINESIS_STREAM_ARN_RE
1415
from compose_x_common.aws.kms import KMS_ALIAS_ARN_RE, KMS_KEY_ARN_RE
@@ -57,6 +58,7 @@
5758
"AWS::MSK::Cluster": MSK_CLUSTER_ARN_RE,
5859
"AWS::MSK::Configuration": MSK_CONFIGURATION_ARN_RE,
5960
"AWS::MSK::ServerlessCluster": MSK_CLUSTER_ARN_RE,
61+
"AWS::Glue::Registry": GLUE_SR_ARN_RE,
6062
}
6163

6264
ARNS_PER_TAGGINGAPI_TYPE = {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# Copyright 2020-2022 John Mille <[email protected]>
3+
4+
"""
5+
AWS Glue
6+
"""
7+
import re
8+
9+
GLUE_SR_ARN_RE = re.compile(
10+
r"^arn:(?P<partition>[\w\-]+):glue:(?P<region>[\w\-]+):"
11+
r"(?P<accountid>[\d]{12}):registry/"
12+
r"(?P<id>[\w\-\$\#]{1,255})$"
13+
)
14+
15+
GLUE_SR_NAME_RE = re.compile(r"^[\w\-\$\#]{1,255}$")

tests/test_arns.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def valid_arns():
3737
"AWS::MSK::Cluster": "arn:aws:kafka:us-east-1:123456789012:cluster/CustomerMessages/abcd1234-abcd-dcba-4321-a1b2abcd9f9f-2",
3838
"AWS::MSK::ServerlessCluster": "arn:aws:kafka:eu-west-1:123456789012:cluster/demo-cluster-1/d7e68213-0896-4839-80df-dea01b79750c-s1",
3939
"AWS::MSK::Configuration": "arn:aws:kafka:eu-west-1:123456789012:configuration/default-msk-331/e44a32b9-4cba-4686-a1e4-b0e72fb1baa4-8",
40+
"AWS::Glue::Registry": "arn:aws:glue:us-east-2:012345678912:registry/registryname-1",
4041
}
4142

4243

0 commit comments

Comments
 (0)