Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Changelog
=========
--------------------
3.25 (2025-06-27)
--------------------
- Added me-central-1 elasticbeanstalk-env-resources bucket
- Added il-central-1 and me-central-1 to regions list

--------------------
3.24.1 (2025-05-20)
--------------------
Expand Down
2 changes: 1 addition & 1 deletion ebcli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
__version__ = '3.24.1'
__version__ = '3.25'
22 changes: 19 additions & 3 deletions ebcli/lib/elasticbeanstalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,23 @@ def create_application_version(
**kwargs)


def _get_env_resources_bucket_name(region):
"""
Get the environment resources bucket name for a given region.
Some regions have different bucket naming patterns with suffixes.
"""
region_suffix_mapping = {
'me-central-1': 'f08b818c'
}

base_name = 'elasticbeanstalk-env-resources-' + region

if region in region_suffix_mapping:
return base_name + '-' + region_suffix_mapping[region]

return base_name


def create_environment(environment):
"""
Creates an Elastic Beanstalk environment
Expand All @@ -327,14 +344,13 @@ def create_environment(environment):

if environment.database:
region = aws.get_region_name()
bucket_name = _get_env_resources_bucket_name(region)

kwargs['TemplateSpecification'] = {
'TemplateSnippets': [
{'SnippetName': 'RdsExtensionEB',
'Order': 10000,
'SourceUrl': 'https://s3.amazonaws.com/'
'elasticbeanstalk-env-resources-' + region +
'/eb_snippets/rds/rds.json'}
'SourceUrl': 'https://s3.amazonaws.com/' + bucket_name + '/eb_snippets/rds/rds.json'}
]
}

Expand Down
2 changes: 2 additions & 0 deletions ebcli/objects/region.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def get_all_regions():
Region('af-south-1', 'Africa (Cape Town)'),
Region('ap-southeast-3', 'Asia Pacific (Jakarta)'),
Region('ap-northeast-3', 'Asia Pacific (Osaka)'),
Region('il-central-1', 'Israel (Tel Aviv)'),
Region('me-central-1', 'Middle East (UAE)'),
]


Expand Down
8 changes: 8 additions & 0 deletions tests/unit/lib/test_elasticbeanstalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -1791,6 +1791,14 @@ def test_list_application_load_balancers__no_vpc(
expected_result, result
)

def test_get_env_resources_bucket_name_standard_region(self):
bucket_name = elasticbeanstalk._get_env_resources_bucket_name('us-east-1')
self.assertEqual(bucket_name, 'elasticbeanstalk-env-resources-us-east-1')

def test_get_env_resources_bucket_name_me_central_1(self):
bucket_name = elasticbeanstalk._get_env_resources_bucket_name('me-central-1')
self.assertEqual(bucket_name, 'elasticbeanstalk-env-resources-me-central-1-f08b818c')

@mock.patch('ebcli.lib.elasticbeanstalk.describe_configuration_options')
def test_list_application_load_balancers__with_vpc(
self,
Expand Down
Loading