From fcf829839d897a81bbcbd36db02fe4f0c6ec74e5 Mon Sep 17 00:00:00 2001 From: Amy Woodward Date: Tue, 13 Nov 2012 18:32:07 -0800 Subject: [PATCH 1/2] Add support for AWS Australia (ap-southeast-2). --- lib/fog/aws/auto_scaling.rb | 2 +- lib/fog/aws/cloud_watch.rb | 2 +- lib/fog/aws/compute.rb | 2 +- lib/fog/aws/elb.rb | 2 +- lib/fog/aws/models/compute/server.rb | 2 ++ lib/fog/aws/rds.rb | 2 +- lib/fog/aws/requests/compute/describe_availability_zones.rb | 3 +++ lib/fog/aws/requests/dns/change_resource_record_sets.rb | 1 + lib/fog/aws/sqs.rb | 2 +- .../requests/auto_scaling/notification_configuration_tests.rb | 1 + tests/aws/requests/auto_scaling/tag_tests.rb | 1 + 11 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/fog/aws/auto_scaling.rb b/lib/fog/aws/auto_scaling.rb index 23bcb6b88..fd3b43764 100644 --- a/lib/fog/aws/auto_scaling.rb +++ b/lib/fog/aws/auto_scaling.rb @@ -258,7 +258,7 @@ module Fog setup_credentials(options) @region = options[:region] || 'us-east-1' - unless ['ap-northeast-1', 'ap-southeast-1', 'eu-west-1', 'sa-east-1', 'us-east-1', 'us-west-1', 'us-west-2'].include?(@region) + unless ['ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2', 'eu-west-1', 'sa-east-1', 'us-east-1', 'us-west-1', 'us-west-2'].include?(@region) raise ArgumentError, "Unknown region: #{@region.inspect}" end end diff --git a/lib/fog/aws/cloud_watch.rb b/lib/fog/aws/cloud_watch.rb index 2bee06678..45d70c71b 100644 --- a/lib/fog/aws/cloud_watch.rb +++ b/lib/fog/aws/cloud_watch.rb @@ -55,7 +55,7 @@ module Fog @region = options[:region] || 'us-east-1' - unless ['ap-northeast-1', 'ap-southeast-1', 'eu-west-1', 'sa-east-1', 'us-east-1', 'us-west-1', 'us-west-2'].include?(@region) + unless ['ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2', 'eu-west-1', 'sa-east-1', 'us-east-1', 'us-west-1', 'us-west-2'].include?(@region) raise ArgumentError, "Unknown region: #{@region.inspect}" end end diff --git a/lib/fog/aws/compute.rb b/lib/fog/aws/compute.rb index 0978f5e30..866312a19 100644 --- a/lib/fog/aws/compute.rb +++ b/lib/fog/aws/compute.rb @@ -221,7 +221,7 @@ module Fog setup_credentials(options) @region = options[:region] || 'us-east-1' - unless ['ap-northeast-1', 'ap-southeast-1', 'eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'sa-east-1'].include?(@region) + unless ['ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2', 'eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'sa-east-1'].include?(@region) raise ArgumentError, "Unknown region: #{@region.inspect}" end end diff --git a/lib/fog/aws/elb.rb b/lib/fog/aws/elb.rb index 9b73072a5..2518d0653 100644 --- a/lib/fog/aws/elb.rb +++ b/lib/fog/aws/elb.rb @@ -81,7 +81,7 @@ module Fog @region = options[:region] || 'us-east-1' - unless ['ap-northeast-1', 'ap-southeast-1', 'eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2'].include?(@region) + unless ['ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2', 'eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2'].include?(@region) raise ArgumentError, "Unknown region: #{@region.inspect}" end end diff --git a/lib/fog/aws/models/compute/server.rb b/lib/fog/aws/models/compute/server.rb index de755052c..e60a8fa86 100644 --- a/lib/fog/aws/models/compute/server.rb +++ b/lib/fog/aws/models/compute/server.rb @@ -60,6 +60,8 @@ module Fog 'ami-5e0fa45f' when 'ap-southeast-1' 'ami-f092eca2' + when 'ap-southeast-2' + 'ami-fb8611c1' # Ubuntu 12.04 LTS 64bit (EBS) when 'eu-west-1' 'ami-3d1f2b49' when 'sa-east-1' diff --git a/lib/fog/aws/rds.rb b/lib/fog/aws/rds.rb index b6a7a0759..085331576 100644 --- a/lib/fog/aws/rds.rb +++ b/lib/fog/aws/rds.rb @@ -101,7 +101,7 @@ module Fog @use_iam_profile = options[:use_iam_profile] @region = options[:region] || 'us-east-1' - unless ['ap-northeast-1', 'ap-southeast-1', 'eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'sa-east-1'].include?(@region) + unless ['ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2', 'eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'sa-east-1'].include?(@region) raise ArgumentError, "Unknown region: #{@region.inspect}" end diff --git a/lib/fog/aws/requests/compute/describe_availability_zones.rb b/lib/fog/aws/requests/compute/describe_availability_zones.rb index 5a6a18e49..4221050a0 100644 --- a/lib/fog/aws/requests/compute/describe_availability_zones.rb +++ b/lib/fog/aws/requests/compute/describe_availability_zones.rb @@ -71,6 +71,9 @@ module Fog {"messageSet" => [], "regionName" => "ap-southeast-1", "zoneName" => "ap-southeast-1a", "zoneState" => "available"}, {"messageSet" => [], "regionName" => "ap-southeast-1", "zoneName" => "ap-southeast-1b", "zoneState" => "available"}, + + {"messageSet" => [], "regionName" => "ap-southeast-2", "zoneName" => "ap-southeast-2a", "zoneState" => "available"}, + {"messageSet" => [], "regionName" => "ap-southeast-2", "zoneName" => "ap-southeast-2b", "zoneState" => "available"}, ] availability_zone_info = all_zones.select { |zoneinfo| zoneinfo["regionName"] == @region } diff --git a/lib/fog/aws/requests/dns/change_resource_record_sets.rb b/lib/fog/aws/requests/dns/change_resource_record_sets.rb index 190725adc..bd888faba 100644 --- a/lib/fog/aws/requests/dns/change_resource_record_sets.rb +++ b/lib/fog/aws/requests/dns/change_resource_record_sets.rb @@ -198,6 +198,7 @@ module Fog @elb_hosted_zone_mapping ||= { "ap-northeast-1" => "Z2YN17T5R711GT", "ap-southeast-1" => "Z1WI8VXHPB1R38", + "ap-southeast-2" => "Z1WI8VXHPB1R38", # TODO Needs updated value "eu-west-1" => "Z3NF1Z3NOM5OY2", "sa-east-1" => "Z2ES78Y61JGQKS", "us-east-1" => "Z3DZXE0Q79N41H", diff --git a/lib/fog/aws/sqs.rb b/lib/fog/aws/sqs.rb index 902456ec4..ef08d8411 100644 --- a/lib/fog/aws/sqs.rb +++ b/lib/fog/aws/sqs.rb @@ -40,7 +40,7 @@ module Fog setup_credentials(options) @region = options[:region] || 'us-east-1' - unless ['ap-northeast-1', 'ap-southeast-1', 'eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'sa-east-1'].include?(@region) + unless ['ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2', 'eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'sa-east-1'].include?(@region) raise ArgumentError, "Unknown region: #{@region.inspect}" end end diff --git a/tests/aws/requests/auto_scaling/notification_configuration_tests.rb b/tests/aws/requests/auto_scaling/notification_configuration_tests.rb index a307b3b94..74ccd42c8 100644 --- a/tests/aws/requests/auto_scaling/notification_configuration_tests.rb +++ b/tests/aws/requests/auto_scaling/notification_configuration_tests.rb @@ -3,6 +3,7 @@ Shindo.tests('AWS::AutoScaling | notification configuration requests', ['aws', ' image_id = { # Ubuntu 12.04 LTS 64-bit EBS 'ap-northeast-1' => 'ami-60c77761', 'ap-southeast-1' => 'ami-a4ca8df6', + 'ap-southeast-2' => 'ami-fb8611c1', 'eu-west-1' => 'ami-e1e8d395', 'sa-east-1' => 'ami-8cd80691', 'us-east-1' => 'ami-a29943cb', diff --git a/tests/aws/requests/auto_scaling/tag_tests.rb b/tests/aws/requests/auto_scaling/tag_tests.rb index c5d05a7fc..30e205c9d 100644 --- a/tests/aws/requests/auto_scaling/tag_tests.rb +++ b/tests/aws/requests/auto_scaling/tag_tests.rb @@ -3,6 +3,7 @@ Shindo.tests('AWS::AutoScaling | tag requests', ['aws', 'auto_scaling']) do image_id = { # Ubuntu 12.04 LTS 64-bit EBS 'ap-northeast-1' => 'ami-60c77761', 'ap-southeast-1' => 'ami-a4ca8df6', + 'ap-southeast-2' => 'ami-fb8611c1', 'eu-west-1' => 'ami-e1e8d395', 'sa-east-1' => 'ami-8cd80691', 'us-east-1' => 'ami-a29943cb', From 325a94657486b2bcf72efef909a056fe4a9a266c Mon Sep 17 00:00:00 2001 From: Amy Woodward Date: Wed, 14 Nov 2012 10:36:53 -0800 Subject: [PATCH 2/2] Add Hosted Zone ID for ap-southeast-2. --- lib/fog/aws/requests/dns/change_resource_record_sets.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fog/aws/requests/dns/change_resource_record_sets.rb b/lib/fog/aws/requests/dns/change_resource_record_sets.rb index bd888faba..e4040d90a 100644 --- a/lib/fog/aws/requests/dns/change_resource_record_sets.rb +++ b/lib/fog/aws/requests/dns/change_resource_record_sets.rb @@ -198,7 +198,7 @@ module Fog @elb_hosted_zone_mapping ||= { "ap-northeast-1" => "Z2YN17T5R711GT", "ap-southeast-1" => "Z1WI8VXHPB1R38", - "ap-southeast-2" => "Z1WI8VXHPB1R38", # TODO Needs updated value + "ap-southeast-2" => "Z2999QAZ9SRTIC", "eu-west-1" => "Z3NF1Z3NOM5OY2", "sa-east-1" => "Z2ES78Y61JGQKS", "us-east-1" => "Z3DZXE0Q79N41H",