Permalink
Browse files

Add new ap-south-1 (Mumbabi, India) region to the AWS EC2 driver.

  • Loading branch information...
Kami committed Jun 28, 2016
1 parent 7ea6b30 commit 02bb42865f8d49cf604a9f2119d4371783156518
Showing with 83 additions and 11 deletions.
  1. +2 −0 contrib/scrape-ec2-prices.py
  2. +37 −0 libcloud/compute/drivers/ec2.py
  3. +31 −1 libcloud/data/pricing.json
  4. +13 −10 libcloud/test/compute/test_ec2.py
@@ -45,6 +45,7 @@
'ap-southeast-2',
'ap-northeast-1',
'ap-northeast-2',
'ap-south-1',
'sa-east-1'
]

@@ -113,6 +114,7 @@
'apac-tokyo': 'ec2_ap_northeast',
'ap-northeast-1': 'ec2_ap_northeast',
'ap-northeast-2': 'ec2_ap_northeast',
'ap-south-1': 'ec2_ap_south_1',
'sa-east-1': 'ec2_sa_east',
'us-gov-west-1': 'ec2_us_govwest'
}
@@ -940,6 +940,43 @@ def GiB(value):
'x1.32xlarge'
]
},
# Asia Pacific (Mumbai, India) Region
'ap-south-1': {
'endpoint': 'ec2.ap-south-1.amazonaws.com',
'api_name': 'ec2_ap_south_1',
'country': 'India',
'signature_version': '4',
'instance_types': [
't2.nano',
't2.micro',
't2.small',
't2.medium',
't2.large',
'm4.large',
'm4.xlarge',
'm4.2xlarge',
'm4.4xlarge',
'm4.10xlarge',
'c4.large',
'c4.xlarge',
'c4.2xlarge',
'c4.4xlarge',
'c4.8xlarge',
'r3.large',
'r3.xlarge',
'r3.2xlarge',
'r3.4xlarge',
'r3.8xlarge',
'i2.xlarge',
'i2.2xlarge',
'i2.4xlarge',
'i2.8xlarge',
'd2.xlarge',
'd2.2xlarge',
'd2.4xlarge',
'd2.8xlarge'
]
},
# Asia Pacific (Singapore) Region
'ap-southeast-1': {
'endpoint': 'ec2.ap-southeast-1.amazonaws.com',
@@ -84,6 +84,36 @@
"t2.nano": 0.01,
"x1.32xlarge": 19.341
},
"ec2_ap_south_1": {
"c4.large": 0.137,
"c4.xlarge": 0.275,
"c4.2xlarge": 0.549,
"c4.4xlarge": 1.097,
"c4.8xlarge": 2.195,
"d2.xlarge": 0.827,
"d2.2xlarge": 1.653,
"d2.4xlarge": 3.306,
"d2.8xlarge": 6.612,
"i2.xlarge": 0.967,
"i2.2xlarge": 1.933,
"i2.4xlarge": 3.867,
"i2.8xlarge": 7.733,
"m4.large": 0.169,
"m4.xlarge": 0.337,
"m4.2xlarge": 0.675,
"m4.4xlarge": 1.35,
"m4.10xlarge": 3.375,
"r3.large": 0.19,
"r3.xlarge": 0.379,
"r3.2xlarge": 0.758,
"r3.4xlarge": 1.516,
"r3.8xlarge": 3.032,
"t2.micro": 0.019,
"t2.small": 0.038,
"t2.medium": 0.076,
"t2.large": 0.152,
"t2.nano": 0.0095
},
"ec2_ap_southeast": {
"c1.medium": 0.164,
"c1.xlarge": 0.655,
@@ -1005,5 +1035,5 @@
}
},
"storage": {},
"updated": 1463737767
"updated": 1467125838
}
@@ -393,7 +393,8 @@ def test_list_sizes(self):
('ec2_eu_west', 'eu-west-1'),
('ec2_ap_southeast', 'ap-southeast-1'),
('ec2_ap_northeast', 'ap-northeast-1'),
('ec2_ap_southeast_2', 'ap-southeast-2')
('ec2_ap_southeast_2', 'ap-southeast-2'),
('ec2_ap_south_1', 'ap-south-1')
]

for api_name, region_name in names:
@@ -402,15 +403,17 @@ def test_list_sizes(self):
sizes = self.driver.list_sizes()

ids = [s.id for s in sizes]
self.assertTrue('t1.micro' in ids)
self.assertTrue('m1.small' in ids)
self.assertTrue('m1.large' in ids)
self.assertTrue('m1.xlarge' in ids)
self.assertTrue('c1.medium' in ids)
self.assertTrue('c1.xlarge' in ids)
self.assertTrue('m2.xlarge' in ids)
self.assertTrue('m2.2xlarge' in ids)
self.assertTrue('m2.4xlarge' in ids)

if region_name not in ['ap-south-1']:
self.assertTrue('t1.micro' in ids)
self.assertTrue('m1.small' in ids)
self.assertTrue('m1.large' in ids)
self.assertTrue('m1.xlarge' in ids)
self.assertTrue('c1.medium' in ids)
self.assertTrue('c1.xlarge' in ids)
self.assertTrue('m2.xlarge' in ids)
self.assertTrue('m2.2xlarge' in ids)
self.assertTrue('m2.4xlarge' in ids)

if region_name == 'us-east-1':
self.assertEqual(len(sizes), 54)

0 comments on commit 02bb428

Please sign in to comment.