ec2i3 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4713074966cedb85f955c832c5ab44eb09c17993
4
+ data.tar.gz: 4308ea736b821bbe1dfb60e9afb9faaf60ac6239
5
+ SHA512:
6
+ metadata.gz: 4bde22876b63da9c03cd1f9a7ca8310fed15431d41327683b2eddaa557c859c9c8060235753fca37f117c542ed127b5b78201c3af05efa3628d1955ac8f5628a
7
+ data.tar.gz: 266eb058719f8b50d7ee704ce0cfffc7c1da19f8bd013a718e6997b7075cae5b30d70eacf818dd35178d23def53301b022a977000025f5b3e68fb98409ac0a65
Binary file
Binary file
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: ec2i3.rb
4
+
5
+
6
+ require 'sps-pub'
7
+ require 'encrypt'
8
+ require 'instant_ec2'
9
+ require 'xml-registry'
10
+ require 'dynarex-password'
11
+
12
+
13
+ class EC2i3 < InstantEC2
14
+
15
+ def initialize(reg, address: '127.0.0.1', port: '59000')
16
+
17
+ @address, @port = address, port
18
+
19
+ entry = reg.get_key('hkey_apps/ec2i3')
20
+
21
+ dp = DynarexPassword.new
22
+ passphrase = dp.reverse_lookup(entry.text('passphrase'),
23
+ entry.text('lookup_file'))
24
+ enc_priv_key = entry.text('private_key').split(' ').map(&:to_i).pack('C*')
25
+ private_key = Encrypt.load(enc_priv_key, passphrase)
26
+
27
+ super credentials: [entry.text('access_key_id'), private_key]
28
+ @sps = SPSPub.new address: @address, port: @port
29
+
30
+ @hooks = {
31
+ running: ->(ip){
32
+
33
+ msg = "EC2i3: the instance is now accessible from %s" % [ip]
34
+ @sps.notice msg
35
+
36
+ },
37
+ stopping: ->(){
38
+ msg = "EC2i3: the instance is now stopping"
39
+ @sps.notice msg
40
+ }
41
+ }
42
+
43
+ end
44
+
45
+ end
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ec2i3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
+ YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
+ 8ixkARkWAmV1MB4XDTE1MTIyMDIwNTM1MVoXDTE2MTIxOTIwNTM1MVowSDESMBAG
16
+ A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
+ EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
+ ggEBANnE/DLbLdIh5x6MUGc2Lwt8S7yuzaFCs8xlMMgFeTkpn0sIROJa9Eo/yI0G
19
+ 8ENWIp8j0fb5dhTY5HOc2RBLKKbeV1zCnlplhyjYEN8lZgiZKCfN4nVymP00LClH
20
+ FS6TfEOsuWQe2YYl5SzB8uuzc2YfGM2vJd0DUnRzcAbM4yLOPphAu8DOA5ZpdawE
21
+ dGRvFcI19dmnJ3EbdtjMLa+ZMMsCiz2hbEMBQNEZYPWR5PTZLddKEohYHTjTvueN
22
+ e2w/URmJBzlPo4gGL4n9wyzC8YBICbKPyYAyy307TEeUkXZ7LJZcMzITB5h4j7/O
23
+ OHWpSy9AJ+Fvt+DucRzdkdsBfVsCAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
24
+ DwQEAwIEsDAdBgNVHQ4EFgQU5KtZLZu7EHY99GlDeNowVxmMTZwwJgYDVR0RBB8w
25
+ HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAu2lvqci3
27
+ /nC3zezlhLaRZl66b0nnWg/jDK7mpeKIukMFU/DaJQQ1D25CKtnis4hBeWk3BJi+
28
+ HHsXR0MgkEhX/Cx5Ds8oYh+hfdnPqDG7UsAuMngNF+uQo1zDmOSs93mC7w2yfTq0
29
+ IbTzPWDAvB+vnr1IBWfJYgTCSWhbD5Njrodas/LjHKZn/eDgSSwX44lCF1RZGHk+
30
+ eaFxzRsRtefs8kkbb5bLY1hMub/Hwj0+rUXxsRtxnh754HxzaOHuTAuujPVP6fPq
31
+ qh4VdS4gVfe5ThX9kb74xS3rBWXT6oqy2up2L78UfuiHgTKGOnZ0+qRlBoQSd7Mr
32
+ LhGrBNqALoCFTQ==
33
+ -----END CERTIFICATE-----
34
+ date: 2015-12-20 00:00:00.000000000 Z
35
+ dependencies:
36
+ - !ruby/object:Gem::Dependency
37
+ name: instant_ec2
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '0.1'
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 0.1.2
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '0.1'
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 0.1.2
56
+ description:
57
+ email: james@r0bertson.co.uk
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - lib/ec2i3.rb
63
+ homepage: https://github.com/jrobertson/ec2i3
64
+ licenses:
65
+ - MIT
66
+ metadata: {}
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubyforge_project:
83
+ rubygems_version: 2.4.8
84
+ signing_key:
85
+ specification_version: 4
86
+ summary: 'EC2 in 3 steps: step 1. register the AWS account details in the XML registry,
87
+ step 2. launch the EC2 instance, step 3. Publish the status of the instance using
88
+ SimplePubSub.'
89
+ test_files: []
Binary file