vominator 0.0.15 → 0.0.16

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: '039151bd01fe9100bc10aefd43f1d2a61f07376683c7986ccb40c6f46538fca9'
4
- data.tar.gz: 1b19eb736330f50b85aa48b60e1c79b2ced9ec0453275b4f5dc4b376aaf7da21
3
+ metadata.gz: bd74e5361fd321678260247c2db92d354b699e527b5f60598a34d54f819be3ca
4
+ data.tar.gz: 113e17a4250699011d8b09dfe87d1797371194c64f235b514af0d660bf2fa3ce
5
5
  SHA512:
6
- metadata.gz: dafd8d8ca6d1ea6114ba5e0c6e17a4628f46164d1081c92e656a3cf8d0ec9a611521a0d1f4cc6620e9e4762c1eb7d91bb5a4077ea66a473a3adf96b2d32bdf48
7
- data.tar.gz: 0dedfdbd7736cba735cec380d139360bdbabb3c00e617f5d57cf8c4f0d115118e78e170d412c790ccb6c559238555a71cc592c2a8f3e582448b9a6e3e8afd923
6
+ metadata.gz: a6a17e0303d0e0f7130a9efeeb0030f0a4181daf419bf20369dd5f2ea3bd95fc807afbe5ca50f78fdc6a60931692a1b59de76b3f0d76ce9197e5ff602de23c6a
7
+ data.tar.gz: 6752c0df2646c65c6f2a6d75d56c70067f4d63ec761bae3ceb329cd8c921154a51007e766b2a3134a2ad7d1331219bc186b770e86b372bd89917623a0c7a07a2
data/README.md CHANGED
@@ -21,8 +21,11 @@ See Usage for details about puke
21
21
  configuration_path: Location to puke
22
22
  key_pair_name: infrastructure@example.com
23
23
  instances_file: Location for cache file IE /Users/foo/.vominator/instances-metadata
24
+ use_profiles: false
24
25
  ```
25
26
 
27
+ use_profiles: false will cause the AWS SDK to use the default credential provider chain.
28
+
26
29
  ## Usage
27
30
 
28
31
  Everything with Vominator revolves around the concept of defining products. These products are a logical grouping of resources that describe how your product is deployed and accessed. These products are then associated with an environment so that you can quickly replicate resources between VPCs.
@@ -110,7 +110,10 @@ unless instances
110
110
  end
111
111
 
112
112
  #Get ec2 connection, which is then passed to specific functions. Maybe a better way to do this?
113
- Aws.config[:credentials] = Aws::SharedCredentials.new(:profile_name => puke_config['account'])
113
+ if VOMINATOR_CONFIG['use_profiles']
114
+ Aws.config[:credentials] = Aws::SharedCredentials.new(:profile_name => puke_config['account'])
115
+ end
116
+
114
117
  ec2 = Aws::EC2::Resource.new(region: puke_config['region_name'])
115
118
  ec2_client = Aws::EC2::Client.new(region: puke_config['region_name'])
116
119
 
@@ -135,6 +138,19 @@ vpc_security_groups = Vominator::EC2.get_security_group_name_ids_hash(ec2, puke_
135
138
  instances.each do |instance|
136
139
  hostname = instance.keys[0]
137
140
  fqdn = "#{hostname}.#{puke_config['domain']}"
141
+
142
+ LOGGER.info("Working on #{fqdn}")
143
+
144
+ if instance['not_environment'] && instance['not_environment'].include?(options[:environment])
145
+ LOGGER.info("#{fqdn} is not marked for deployment in #{options[:environment]}")
146
+ next
147
+ end
148
+
149
+ if instance['environment'] && !instance['environment'].include?(options[:environment])
150
+ LOGGER.info("#{fqdn} is not marked for deployment in #{options[:environment]}")
151
+ next
152
+ end
153
+
138
154
  instance_type = instance['type'][options[:environment]] || instance['type']
139
155
  instance_ip = (instance['ip'][options[:environment]] || instance['ip']).sub('OCTET',puke_config['octet'])
140
156
  instance_security_groups = instance['security_groups'].map { |sg| sg}.uniq.sort
@@ -146,13 +162,6 @@ instances.each do |instance|
146
162
  instance_az = instance['az'][options[:environment]] || instance['az']
147
163
  instance_tags = instance['tags']
148
164
 
149
- LOGGER.info("Working on #{fqdn}")
150
-
151
- if instance['environment'] && !instance['environment'].include?(options[:environment])
152
- LOGGER.info("#{fqdn} is not marked for deployment in #{options[:environment]}")
153
- next
154
- end
155
-
156
165
  if instance_type.nil?
157
166
  LOGGER.error("No instance size definition for #{fqdn}")
158
167
  next
@@ -103,8 +103,10 @@ end
103
103
  unless puke_security_groups
104
104
  LOGGER.fatal('Unable to load security groups . Make sure the product is correctly defined for the environment you have selected and that a security_groups.yaml file exists with at least one group defined.')
105
105
  end
106
+ if VOMINATOR_CONFIG['use_profiles']
107
+ Aws.config[:credentials] = Aws::SharedCredentials.new(:profile_name => puke_config['account'])
108
+ end
106
109
 
107
- Aws.config[:credentials] = Aws::SharedCredentials.new(:profile_name => puke_config['account'])
108
110
  ec2_client = Aws::EC2::Client.new(region: puke_config['region_name'])
109
111
 
110
112
 
@@ -58,7 +58,9 @@ unless test?('Vominator is running in test mode. It will NOT make any changes.')
58
58
  end
59
59
  end
60
60
 
61
- Aws.config[:credentials] = Aws::SharedCredentials.new(:profile_name => puke_config['account'])
61
+ if VOMINATOR_CONFIG['use_profiles']
62
+ Aws.config[:credentials] = Aws::SharedCredentials.new(:profile_name => puke_config['account'])
63
+ end
62
64
  ssm = Aws::SSM::Client.new(region: puke_config['region_name'])
63
65
 
64
66
  aws_documents = Vominator::SSM.get_documents(ssm)
@@ -1,3 +1,3 @@
1
1
  module Vominator
2
- VERSION = "0.0.15"
2
+ VERSION = "0.0.16"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vominator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Kelly
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-12-13 00:00:00.000000000 Z
13
+ date: 2020-02-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: aws-sdk
@@ -266,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
266
266
  - !ruby/object:Gem::Version
267
267
  version: '0'
268
268
  requirements: []
269
- rubygems_version: 3.0.1
269
+ rubygems_version: 3.0.6
270
270
  signing_key:
271
271
  specification_version: 4
272
272
  summary: Manage AWS resources from JSON templates and CLI.