#2255 - CF - Implement FN::Transform and AWS::Include
This commit is contained in:
parent
60c98ca836
commit
cbf0397953
5 changed files with 82 additions and 8 deletions
|
|
@ -35,6 +35,17 @@ def bucket_name_from_url(url):
|
|||
return None
|
||||
|
||||
|
||||
# 'owi-common-cf', 'snippets/test.json' = bucket_and_name_from_url('s3://owi-common-cf/snippets/test.json')
|
||||
def bucket_and_name_from_url(url):
|
||||
prefix = "s3://"
|
||||
if url.startswith(prefix):
|
||||
bucket_name = url[len(prefix) : url.index("/", len(prefix))]
|
||||
key = url[url.index("/", len(prefix)) + 1 :]
|
||||
return bucket_name, key
|
||||
else:
|
||||
return None, None
|
||||
|
||||
|
||||
REGION_URL_REGEX = re.compile(
|
||||
r"^https?://(s3[-\.](?P<region1>.+)\.amazonaws\.com/(.+)|"
|
||||
r"(.+)\.s3[-\.](?P<region2>.+)\.amazonaws\.com)/?"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue