stemcell 0.12.1 → 0.12.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +3 -0
- data/examples/stemcell.json +6 -2
- data/lib/stemcell/launcher.rb +7 -6
- data/lib/stemcell/metadata_launcher.rb +1 -0
- data/lib/stemcell/option_parser.rb +6 -0
- data/lib/stemcell/version.rb +1 -1
- data/spec/lib/stemcell/launcher_spec.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42199bc80153e575d437ce9c618b662e6861af3e
|
4
|
+
data.tar.gz: 53e93477347e08429b03e74b4580d4cc714c424d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67d1742a36a3f003a849651d9f7b899414a738ce2ea2a684efaf77bee1399fc65d824c174a28abdf981c2aa739e137d973589d29b2a15ef8e94dfcc94e9f1b3d
|
7
|
+
data.tar.gz: 0e916fa0c134eb26ff01cba67c6b1e90ae921fa932940f3596a5d09b0607a52abae2b99099d3569e3cf4b67ac4e2a91226666e32af9a250af0a33f081bbd4f71
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/examples/stemcell.json
CHANGED
@@ -9,10 +9,14 @@
|
|
9
9
|
|
10
10
|
"backing_store": {
|
11
11
|
"ebs": {
|
12
|
-
"
|
12
|
+
"us-east-1": {
|
13
|
+
"image_id": "ami-23d9a94a"
|
14
|
+
}
|
13
15
|
},
|
14
16
|
"instance_store": {
|
15
|
-
"
|
17
|
+
"us-east-1": {
|
18
|
+
"image_id": "ami-d9d6a6b0"
|
19
|
+
}
|
16
20
|
}
|
17
21
|
},
|
18
22
|
|
data/lib/stemcell/launcher.rb
CHANGED
@@ -75,6 +75,7 @@ module Stemcell
|
|
75
75
|
|
76
76
|
@region = opts['region']
|
77
77
|
@vpc_id = opts['vpc_id']
|
78
|
+
@ec2_endpoint = opts['ec2_endpoint']
|
78
79
|
@aws_access_key = opts['aws_access_key']
|
79
80
|
@aws_secret_key = opts['aws_secret_key']
|
80
81
|
@aws_session_token = opts['aws_session_token']
|
@@ -315,7 +316,7 @@ module Stemcell
|
|
315
316
|
def get_vpc_security_group_ids(vpc_id, group_names)
|
316
317
|
group_map = {}
|
317
318
|
@log.info "resolving security groups #{group_names} in #{vpc_id}"
|
318
|
-
vpc = AWS::EC2::VPC.new(vpc_id
|
319
|
+
vpc = AWS::EC2::VPC.new(vpc_id)
|
319
320
|
vpc.security_groups.each do |sg|
|
320
321
|
next if sg.vpc_id != vpc_id
|
321
322
|
group_map[sg.name] = sg.group_id
|
@@ -433,13 +434,10 @@ module Stemcell
|
|
433
434
|
def ec2
|
434
435
|
return @ec2 if @ec2
|
435
436
|
|
436
|
-
# calculate our ec2 url
|
437
|
-
ec2_url = "ec2.#{@region}.amazonaws.com"
|
438
|
-
|
439
437
|
if @vpc_id
|
440
|
-
@ec2 = AWS::EC2::VPC.new(@vpc_id
|
438
|
+
@ec2 = AWS::EC2::VPC.new(@vpc_id)
|
441
439
|
else
|
442
|
-
@ec2 = AWS::EC2.new
|
440
|
+
@ec2 = AWS::EC2.new
|
443
441
|
end
|
444
442
|
|
445
443
|
@ec2
|
@@ -457,6 +455,9 @@ module Stemcell
|
|
457
455
|
def configure_aws_creds_and_region
|
458
456
|
# configure AWS with creds/region
|
459
457
|
aws_configs = {:region => @region}
|
458
|
+
aws_configs.merge!({
|
459
|
+
:ec2_endpoint => @ec2_endpoint
|
460
|
+
}) if @ec2_endpoint
|
460
461
|
aws_configs.merge!({
|
461
462
|
:access_key_id => @aws_access_key,
|
462
463
|
:secret_access_key => @aws_secret_key
|
@@ -101,6 +101,7 @@ module Stemcell
|
|
101
101
|
'region' => options['region'],
|
102
102
|
'vpc_id' => options['vpc_id'],
|
103
103
|
'max_attempts' => options['batch_operation_retries'],
|
104
|
+
'ec2_endpoint' => options['ec2_endpoint'],
|
104
105
|
})
|
105
106
|
# Slice off just the options used for launching.
|
106
107
|
launch_options = {}
|
data/lib/stemcell/version.rb
CHANGED
@@ -195,4 +195,18 @@ describe Stemcell::Launcher do
|
|
195
195
|
expect(AWS.config.region).to be_eql('ap-northeast-1')
|
196
196
|
end
|
197
197
|
end
|
198
|
+
|
199
|
+
describe '#ec2' do
|
200
|
+
it 'can return a client with regional endpoint' do
|
201
|
+
launcher = Stemcell::Launcher.new({'region' => 'region1', 'ec2_endpoint' => nil})
|
202
|
+
client = launcher.send(:ec2)
|
203
|
+
expect(client.config.ec2_endpoint).to be_eql('ec2.region1.amazonaws.com')
|
204
|
+
end
|
205
|
+
|
206
|
+
it 'can return a client with custom endpoint' do
|
207
|
+
launcher = Stemcell::Launcher.new({'region' => 'region1', 'ec2_endpoint' => 'endpoint1'})
|
208
|
+
client = launcher.send(:ec2)
|
209
|
+
expect(client.config.ec2_endpoint).to be_eql('endpoint1')
|
210
|
+
end
|
211
|
+
end
|
198
212
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stemcell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Rhoads
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2019-06-18 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: aws-sdk-v1
|