./lib/stacco/stack.rb in stacco-0.1.53 vs ./lib/stacco/stack.rb in stacco-0.1.57
- old
+ new
@@ -23,10 +23,11 @@
s3: AWS::S3.new(aws_creds),
autoscaling: AWS::AutoScaling.new(aws_creds),
route53: AWS::Route53.new(aws_creds),
cloudformation: AWS::CloudFormation.new(aws_creds),
cloudfront: AWS::CloudFront.new(aws_creds),
+ rds: AWS::RDS.new(aws_creds),
iam: AWS::IAM.new(aws_creds)
}
@aws_stack = @services[:cloudformation].stacks[self.name]
@aws_stack.service_registry = @services
@@ -37,10 +38,17 @@
running_instances = @aws_stack.instances.find_all{ |i| i.status == :running }
running_instances.each{ |i| connections[i.tags["aws:cloudformation:logical-id"]] = i }
connections
end
+ def databases
+ @aws_stack.rds_instances.inject({}) do |dbs, (k, v)|
+ (dbs[k] = v) if v.status == "available"
+ dbs
+ end
+ end
+
def resource_summaries
@aws_stack.resource_summaries
end
def must_be_up!
@@ -168,11 +176,11 @@
"source /etc/environment.local"
].flatten.map{ |ln| ln + "\n" }
parameters = {
'IAMKeypairNameVar' => self.iam_keypair_name,
- 'DBAdminUsernameVar' => self.secrets['db_admin_username'],
- 'DBAdminPasswordVar' => self.secrets['db_admin_password'],
+ 'MainDBAdminUsernameVar' => self.secrets['db_admin_username'],
+ 'MainDBAdminPasswordVar' => self.secrets['db_admin_password'],
'EnvironmentTypeVar' => self.config['environment'],
'UserDataEnvironmentVar' => env_lns.join
}
scaling_groups = self.config['scale']