on init, connect to AWS and check for the AS group

This commit is contained in:
Anuj Biyani
2013-05-31 13:08:23 -07:00
parent 2bdaca25bb
commit 4f466e1a19
5 changed files with 59 additions and 3 deletions

View File

@@ -1,2 +1,12 @@
class AwsHaRelease
def initialize(opts)
AWS.config(access_key_id: opts[:aws_access_key], secret_access_key: opts[:aws_secret_key], region: opts[:region])
@as = AWS::AutoScaling.new
@group = @as.groups[opts[:as_group_name]]
if @group.nil?
raise ArgumentError, "The Auto Scaling Group named #{opts[:as_group_name]} does not exist in #{opts[:region]}."
end
end
end