Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ECR region regex #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions awsglue/scripts/activate_etl_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def extract_registry_id(ecr_root: str) -> str:
Extract AWS account id of the ECR registry from its root address
e.g. xxxxxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com
"""
match = re.match(r"^(\d{12})\.dkr\.ecr\.[a-z]{2}-[a-z]{4}-\d\.amazonaws\.com$", ecr_root)
match = re.match(r"^(\d{12})\.dkr\.ecr\.[a-z]{2}-[a-z]{4,9}-\d\.amazonaws\.com$", ecr_root)
if match:
return match.group(1)
else:
Expand All @@ -129,7 +129,7 @@ def parse_ecr_url(ecr_url: str) -> Tuple[str, str, str]:
E.g. https://xxxxxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/salesforce:7.2.0-latest
"""
ecr_root, repo = parse_url(ecr_url)
if not re.match("^\d{12}\.dkr\.ecr\.[a-z]{2}-[a-z]{4}-\d\.amazonaws\.com$", ecr_root):
if not re.match("^\d{12}\.dkr\.ecr\.[a-z]{2}-[a-z]{4,9}-\d\.amazonaws\.com$", ecr_root):
raise ValueError("malformed registry, correct pattern is https://aws_account_id.dkr.ecr.region.amazonaws.com")
if not re.match("^[^:]+:[^:]+$", repo):
raise ValueError("malformed image name, only one colon allowed to delimit image name and tag")
Expand Down