Skip to content

Commit 51fb824

Browse files
Added AWS AU and GCP EU region support
1 parent 8d9719f commit 51fb824

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CHANGELOG
22

3+
## _v2.4.0_
4+
5+
### **Date: 01-September-2025**
6+
7+
- AWS AU and GCP EU region support added.
8+
39
## _v2.3.0_
410

511
### **Date: 21-July-2025**

contentstack/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
__title__ = 'contentstack-delivery-python'
2323
__author__ = 'contentstack'
2424
__status__ = 'debug'
25-
__version__ = 'v2.3.0'
25+
__version__ = 'v2.4.0'
2626
__endpoint__ = 'cdn.contentstack.io'
2727
__email__ = '[email protected]'
2828
__developer_email__ = '[email protected]'

contentstack/stack.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ class ContentstackRegion(enum.Enum):
2020
"""
2121
US = 'us'
2222
EU = 'eu'
23+
AU = 'au'
2324
AZURE_NA = 'azure-na'
2425
AZURE_EU = 'azure-eu'
2526
GCP_NA = 'gcp-na'
27+
GCP_EU = 'gcp-eu'
2628

2729

2830
class Stack:
@@ -124,12 +126,16 @@ def _validate_stack(self):
124126

125127
if self.region.value == 'eu' and self.host == DEFAULT_HOST:
126128
self.host = 'eu-cdn.contentstack.com'
129+
elif self.region.value == 'au' and self.host == DEFAULT_HOST:
130+
self.host = 'au-cdn.contentstack.com'
127131
elif self.region.value == 'azure-na' and self.host == DEFAULT_HOST:
128132
self.host = 'azure-na-cdn.contentstack.com'
129133
elif self.region.value == 'azure-eu' and self.host == DEFAULT_HOST:
130134
self.host = 'azure-eu-cdn.contentstack.com'
131135
elif self.region.value == 'gcp-na' and self.host == DEFAULT_HOST:
132136
self.host = 'gcp-na-cdn.contentstack.com'
137+
elif self.region.value == 'gcp-eu' and self.host == DEFAULT_HOST:
138+
self.host = 'gcp-eu-cdn.contentstack.com'
133139
elif self.region.value != 'us':
134140
self.host = f'{self.region.value}-{DEFAULT_HOST}'
135141
self.endpoint = f'https://{self.host}/{self.version}'

tests/test_stack.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ def test_02_stack_gcp_na_region(self):
3636
API_KEY, DELIVERY_TOKEN, ENVIRONMENT, region=ContentstackRegion.GCP_NA)
3737
self.assertEqual('gcp-na-cdn.contentstack.com', stack_region.host)
3838

39+
def test_02_stack_au_region(self):
40+
stack_region = contentstack.Stack(
41+
API_KEY, DELIVERY_TOKEN, ENVIRONMENT, region=ContentstackRegion.AU)
42+
self.assertEqual('au-cdn.contentstack.com', stack_region.host)
43+
44+
def test_02_stack_gcp_eu_region(self):
45+
stack_region = contentstack.Stack(
46+
API_KEY, DELIVERY_TOKEN, ENVIRONMENT, region=ContentstackRegion.GCP_EU)
47+
self.assertEqual('gcp-eu-cdn.contentstack.com', stack_region.host)
48+
3949
def test_03_stack_endpoint(self):
4050
self.assertEqual(f"https://{config.HOST}/v3",
4151
self.stack.endpoint)

0 commit comments

Comments
 (0)