build-cloud 1.0.0 → 1.0.1

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
  SHA256:
3
- metadata.gz: 633788e810570a47b97cd9e92b742f3a382c1ead7605513d9c03059f50159dc2
4
- data.tar.gz: eedad5d41f0f6f3b1ae03f5b706f99a9decf14cc6d5eb7ccf57c8db02f297d12
3
+ metadata.gz: 39aa180c26085846c7d4e2aaba7f84415d52cb47c2ec250cc492961c0f83188f
4
+ data.tar.gz: a6caef57c83912476052187c9eecac72de9763bb30100bf7d92a245884332d3b
5
5
  SHA512:
6
- metadata.gz: 3ea3f656bf081aeccb3524ba2055cf9475cf57a74e3a377658491b60c218addf85418068ce44de47cc1b244ee48757fbcd25e9c0670697ea2a3d7e4b6b3c66e4
7
- data.tar.gz: e3fb79b1cdab4ada5a5178afe18aea1ccea496f69552475dd61513081113b5bb02b13d25ddbbb6e94b94a9777a4ca30066fa537f8d8505fb954012c0e6af16d4
6
+ metadata.gz: ff2c446f7bee23d38d51b221da0cd6badc644eadfc6ca5fa32f4ed251eb97a91d4cc21fcdad315cc59a49bf808c5a99e34581350879c220299855f1303eed6f5
7
+ data.tar.gz: 95dfa911a13abacfd75831add16fccacc2c21e717bba4633d910da984bb963e36bb6facccdf74076fbbb6924a278dcc69f25cf37830b1d55a66490489ea75603
data/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Changelog
2
2
 
3
+ 2018-04-12 - version 1.0.1 - VPC's now lifecycle tags.
4
+
3
5
  2017-11-13 - version 0.0.24 - Fix a bug which prevented working with IAM roles in AWS accounts with more than 100 roles. Thank you @markchalloner!
4
6
 
5
7
  2017-03-01 - version 0.0.23 - Fix a bug where non-string values for interpolated variables caused a crash.
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  # Build::Cloud
2
+ [![Build Status](https://travis-ci.org/scalefactory/build-cloud.svg?branch=master)](https://travis-ci.org/scalefactory/build-cloud)
3
+ [![Gem Version](https://badge.fury.io/rb/build-cloud.svg)](https://badge.fury.io/rb/build-cloud)
2
4
 
3
5
  Tools for building resources in AWS
4
6
 
data/build-cloud.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "build-cloud"
7
- spec.version = "1.0.0"
7
+ spec.version = "1.0.1"
8
8
  spec.authors = ["The Scale Factory"]
9
9
  spec.email = ["info@scalefactory.com"]
10
10
  spec.summary = %q{Tools for building resources in AWS}
@@ -86,9 +86,8 @@ class BuildCloud::R53RecordSet
86
86
 
87
87
  def read
88
88
  if zone
89
- return zone.records.select { |r| r.name == @options[:name] }.first
89
+ zone.records.get @options[:name]
90
90
  end
91
- nil
92
91
  end
93
92
 
94
93
  alias_method :fog_object, :read
@@ -35,19 +35,27 @@ class BuildCloud::VPC
35
35
  end
36
36
 
37
37
  def create
38
-
39
- return if exists?
40
-
41
- @log.info( "Creating new VPC for #{@options[:cidr_block]}" )
42
38
 
43
39
  options = @options.dup
40
+ tag_name = options.delete(:name)
41
+
42
+ if !options[:tags]
43
+ options[:tags] = { 'Name' => tag_name }
44
+ end
45
+
46
+ if exists?
47
+ # If exists update tags
48
+ create_tags(options[:tags])
49
+ return
50
+ end
44
51
 
45
- options[:tags] = { 'Name' => options.delete(:name) }
52
+
53
+ @log.info( "Creating new VPC for #{@options[:cidr_block]}" )
46
54
 
47
55
  vpc = @compute.vpcs.new( options )
48
56
  vpc.save
49
57
 
50
- @compute.create_tags( vpc.id, options[:tags] )
58
+ create_tags(tags)
51
59
 
52
60
  wait_until_ready
53
61
 
@@ -84,5 +92,11 @@ class BuildCloud::VPC
84
92
  @options[key]
85
93
  end
86
94
 
87
- end
95
+ def create_tags(tags)
96
+ if tags != fog_object.tags
97
+ @log.info("Updating tags")
98
+ @compute.create_tags( fog_object.id, tags )
99
+ end
100
+ end
88
101
 
102
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build-cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Scale Factory
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-09 00:00:00.000000000 Z
11
+ date: 2018-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler