MCPcopy Create free account
hub / github.com/agenticsorg/edge-agents / get_regions

Method get_regions

scripts/agents/devops/src/aws/base.py:348–368  ·  view source on GitHub ↗

Get a list of all available AWS regions. Returns: List of region names.

(self)

Source from the content-addressed store, hash-verified

346 raise NotImplementedError("Resource tagging not implemented for this service")
347
348 def get_regions(self) -> List[str]:
349 """
350 Get a list of all available AWS regions.
351
352 Returns:
353 List of region names.
354 """
355 try:
356 ec2_client = self.session.client('ec2', region_name='us-east-1')
357 response = ec2_client.describe_regions()
358 return [region['RegionName'] for region in response['Regions']]
359 except Exception as e:
360 logger.warning(f"Failed to get AWS regions: {e}")
361 # Return a default list of common regions
362 return [
363 'us-east-1', 'us-east-2', 'us-west-1', 'us-west-2',
364 'ca-central-1', 'eu-west-1', 'eu-west-2', 'eu-west-3',
365 'eu-central-1', 'ap-northeast-1', 'ap-northeast-2',
366 'ap-southeast-1', 'ap-southeast-2', 'ap-south-1',
367 'sa-east-1'
368 ]
369
370 def wait_for(
371 self,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected