sfn 3.0.0 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 189a8f6f45b7c8e21e0736702c1b3491a575a19a
4
- data.tar.gz: 2b45e84280906712c07a932087be8ef583b01afc
3
+ metadata.gz: ff21ffb339f3f1e06331e13f7766efc450968c8d
4
+ data.tar.gz: 80fad1d08580b2d49cd5d8b78faf863cd81675b4
5
5
  SHA512:
6
- metadata.gz: aee4b5d4a44cb4bdcd821522b1b302f9d480ad761a5e2de375a4699d758d9dabce84a488ab514cc65f0c9b83c1d0fd83f7418fcb0e9fccc553547e5f88070f21
7
- data.tar.gz: e81546c3197913706bc5b15551fd63fd6a2ba058262fe04df59e27f6e52ec2e9674a599ca5960aab23f4184e0414ab1bbe7d9af64ddcc998b935674e0fa2ac20
6
+ metadata.gz: 8f292c003150464857fa0ce03605704d67a27f5d7f867d23fe9c4ac839c2797ed18e325bb85b393ce6f379b4c41087bb738ce4fa2b8f8b60256c4c7f7a34730c
7
+ data.tar.gz: 18c983f3de8d5319be07f723e10e7cfde201e2330b03508b3cba6af0b81f0b27f7ee0c937c64f456c7f0b48a55772e7af65802faf95126eb0b4f1c614f045329
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # v3.0.2
2
+ * [fix] Properly scrub nested stack pseudo property on update (#189)
3
+ * [fix] Process nested stacks before removal within AWS planner (#190)
4
+ * [enhancement] Add configuration options for Google cloud (#188)
5
+
1
6
  # v3.0.0
2
7
  _Major release includes breaking changes!_
3
8
  * [feature] Add support for Google Cloud Deployment Manager (#181)
data/README.md CHANGED
@@ -8,9 +8,11 @@ with orchestration APIs.
8
8
  ## API Compatibility
9
9
 
10
10
  * AWS
11
- * Rackspace
12
- * OpenStack
13
11
  * Azure
12
+ * Google
13
+ * Heat
14
+ * OpenStack
15
+ * Rackspace
14
16
 
15
17
  ## Documentation
16
18
 
@@ -81,7 +81,7 @@ Configuration.new do
81
81
  # nesting_prefix 'nested-templates'
82
82
  # Remote provider credentials
83
83
  credentials do
84
- # Remote provider name (:aws, :azure, :open_stack, :rackspace)
84
+ # Remote provider name (:aws, :azure, :google, :open_stack, :rackspace)
85
85
  provider :aws
86
86
  # AWS credentials information
87
87
  aws_access_key_id ENV['AWS_ACCESS_KEY_ID']
@@ -117,6 +117,10 @@ Configuration.new do
117
117
  rackspace_api_key ENV['RACKSPACE_API_KEY']
118
118
  rackspace_username ENV['RACKSPACE_USERNAME']
119
119
  rackspace_region ENV['RACKSPACE_REGION']
120
+ # Google Cloud Deployment Manager credentials
121
+ google_service_account_email ENV['GOOGLE_SERVICE_ACCOUNT_EMAIL']
122
+ google_service_account_private_key ENV['GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY']
123
+ google_project ENV['GOOGLE_PROJECT']
120
124
  end
121
125
  end
122
126
  EOF
@@ -274,7 +274,7 @@ module Sfn
274
274
  if(diff[:updated].nil?)
275
275
  ui.puts
276
276
  else
277
- ui.puts ui.color("+#{diff[:updated]}", :green)
277
+ ui.puts ui.color("+#{diff[:updated].to_s.gsub('__MODIFIED_REFERENCE_VALUE__', '<Dependency Modified>')}", :green)
278
278
  end
279
279
  end
280
280
  end
@@ -312,13 +312,13 @@ module Sfn
312
312
 
313
313
  # Extract currently defined parameters for nested template
314
314
  #
315
- # @param stack [SparkleFormation]
315
+ # @param template [SparkleFormation]
316
316
  # @param stack_name [String]
317
317
  # @param c_stack [Miasma::Models::Orchestration::Stack]
318
318
  # @return [Hash]
319
- def extract_current_nested_template_parameters(stack, stack_name, c_stack=nil)
320
- if(stack.parent)
321
- current_parameters = stack.parent.compile.resources.set!(stack_name).properties.parameters
319
+ def extract_current_nested_template_parameters(template, stack_name, c_stack=nil)
320
+ if(template.parent)
321
+ current_parameters = template.parent.compile.resources.set!(stack_name).properties.parameters
322
322
  current_parameters.nil? ? Smash.new : current_parameters._dump
323
323
  else
324
324
  Smash.new
@@ -328,11 +328,11 @@ module Sfn
328
328
  # Store template in remote bucket and update given result hash
329
329
  #
330
330
  # @param full_stack_name [String] unique resource name for template
331
- # @param stack [SparkleFormation] template instance
331
+ # @param template [SparkleFormation, Hash] template instance
332
332
  # @param result [Hash]
333
333
  # @return [Hash]
334
- def store_template(full_stack_name, stack, result)
335
- stack_definition = stack.is_a?(SparkleFormation) ? dump_stack_for_storage(stack) : stack
334
+ def store_template(full_stack_name, template, result)
335
+ stack_definition = template.is_a?(SparkleFormation) ? dump_stack_for_storage(template) : template
336
336
  bucket = provider.connection.api_for(:storage).buckets.get(
337
337
  config[:nesting_bucket]
338
338
  )
@@ -352,16 +352,16 @@ module Sfn
352
352
  # Remove internally used `Stack` property from Stack resources and
353
353
  # and generate compiled Hash
354
354
  #
355
- # @param stack [SparkleFormation]
355
+ # @param template [SparkleFormation]
356
356
  # @return [Hash]
357
- def dump_stack_for_storage(stack)
358
- nested_stacks = stack.nested_stacks.map do |nested_resource|
359
- [nested_resource.resource_name!, stack.compile.resources.set!(nested_resource.resource_name!).properties.delete!(:stack)]
357
+ def dump_stack_for_storage(template)
358
+ nested_stacks = template.nested_stacks(:with_resource, :with_name).map do |nested_stack, nested_resource, nested_name|
359
+ [nested_name, nested_resource, nested_resource.properties.delete!(:stack)]
360
360
  end
361
- stack_definition = stack.compile.dump!
361
+ stack_definition = template.dump
362
362
  if(config[:plan])
363
- nested_stacks.each do |nested_name, nested_data|
364
- stack.compile.resources.set!(nested_name).properties.stack nested_data
363
+ nested_stacks.each do |nested_name, nested_resource, nested_data|
364
+ nested_resource.properties.set!(:stack, nested_data)
365
365
  end
366
366
  end
367
367
  stack_definition
@@ -272,10 +272,10 @@ module Sfn
272
272
  end
273
273
  new_parameters.merge!(get_global_parameters(stack))
274
274
  new_template_hash = new_template.to_smash
275
- scrub_stack_properties(new_template_hash)
276
275
 
277
276
  plan_nested_stacks(stack, translator, origin_template, new_template_hash, plan_results)
278
277
 
278
+ scrub_stack_properties(new_template_hash)
279
279
  update_template = dereference_template(
280
280
  t_key, new_template_hash, new_parameters,
281
281
  plan_results[:replace].keys + plan_results[:unavailable].keys
@@ -315,7 +315,7 @@ module Sfn
315
315
  stk.data[:logical_id] == stack_name
316
316
  end
317
317
  new_stack_exists = is_stack?(new_template_hash.get('Resources', stack_name, 'Type'))
318
- new_stack_template = new_template_hash.get('Resources', stack_name, 'Properties', 'Stack')
318
+ new_stack_template = new_template_hash.fetch('Resources', stack_name, 'Properties', 'Stack', Smash.new)
319
319
  new_stack_parameters = new_stack_template.fetch('Parameters', Smash.new)
320
320
  new_stack_type = new_template_hash.fetch('Resources', stack_name, 'Type',
321
321
  origin_template.get('Resources', stack_name, 'Type')
data/lib/sfn/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Sfn
2
2
  # Current library version
3
- VERSION = Gem::Version.new('3.0.0')
3
+ VERSION = Gem::Version.new('3.0.2')
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sfn
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-23 00:00:00.000000000 Z
11
+ date: 2016-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bogo-cli