./lib/stacco/stack.rb in stacco-0.1.17 vs ./lib/stacco/stack.rb in stacco-0.1.18
- old
+ new
@@ -1,21 +1,24 @@
require 'set'
require 'ostruct'
require 'yaml'
+require 'pathname'
require 'aws/with-stacco-patches'
require 'stacco/base'
require 'stacco/template/old'
class Stacco::Stack
- def initialize(config_object)
- @config_object = config_object
+ def initialize(stack_bucket)
+ @bucket = stack_bucket
+ @bucket.cache_dir = Pathname.new(ENV['HOME']) + '.config' + 'stacco' + 'stack' + @bucket.name
- aws_creds = self.aws_credentials
+ @config_object = @bucket.objects['stack.yml']
+ aws_creds = self.aws_credentials
@services = {
ec2: AWS::EC2.new(aws_creds),
s3: AWS::S3.new(aws_creds),
cloudformation: AWS::CloudFormation.new(aws_creds),
cloudfront: AWS::CloudFront.new(aws_creds),
@@ -146,13 +149,9 @@
@config_object.bucket.objects.with_prefix("sshkey/#{self.name}-").to_a.sort_by{ |obj| obj.key.split('/').last.split('-').last.to_i }.last
end
def iam_keypair_name
"stacco-" + self.iam_private_key.key.split('/').last
- end
-
- def iam_private_key_material
- self.iam_private_key.read
end
def stream_events
Enumerator.new do |out|
known_events = Set.new