cai-ecs-entrypoint 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0630113f7925e53febcb4c142feb28942a00d77632dd1938ed503bd831425766
4
+ data.tar.gz: f0cbd6b6f4f809a8e30a5b5492b40f85987b5aab5b5c77f48a0e89511a0eb388
5
+ SHA512:
6
+ metadata.gz: 29268da1f2b9067cace85fed78eefb3dac1d84ca352afed17e3843ffe7ca85e81a68462a6c4379e97da1f596eed659c22eb14341db9765f07cb516bcbbb83fd3
7
+ data.tar.gz: 46f104e6cdc6707b5383a4daf5b5b4729d80a5c9c42a21006b80a3f3259c69760cb4f88c4e152b8279079f35bc2f5e5a1a332b27942edae8bfb7950c7a55f769
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ /*.gem
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in cai-ecs-entrypoint.gemspec
6
+ gemspec
@@ -0,0 +1,48 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cai-ecs-entrypoint (0.1.0)
5
+ aws-sdk-ssm (~> 1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ aws-eventstream (1.0.1)
11
+ aws-partitions (1.127.0)
12
+ aws-sdk-core (3.44.1)
13
+ aws-eventstream (~> 1.0)
14
+ aws-partitions (~> 1.0)
15
+ aws-sigv4 (~> 1.0)
16
+ jmespath (~> 1.0)
17
+ aws-sdk-ssm (1.34.0)
18
+ aws-sdk-core (~> 3, >= 3.39.0)
19
+ aws-sigv4 (~> 1.0)
20
+ aws-sigv4 (1.0.3)
21
+ diff-lcs (1.3)
22
+ jmespath (1.4.0)
23
+ rake (10.5.0)
24
+ rspec (3.8.0)
25
+ rspec-core (~> 3.8.0)
26
+ rspec-expectations (~> 3.8.0)
27
+ rspec-mocks (~> 3.8.0)
28
+ rspec-core (3.8.0)
29
+ rspec-support (~> 3.8.0)
30
+ rspec-expectations (3.8.2)
31
+ diff-lcs (>= 1.2.0, < 2.0)
32
+ rspec-support (~> 3.8.0)
33
+ rspec-mocks (3.8.0)
34
+ diff-lcs (>= 1.2.0, < 2.0)
35
+ rspec-support (~> 3.8.0)
36
+ rspec-support (3.8.0)
37
+
38
+ PLATFORMS
39
+ ruby
40
+
41
+ DEPENDENCIES
42
+ bundler (~> 1.16)
43
+ cai-ecs-entrypoint!
44
+ rake (~> 10.0)
45
+ rspec (~> 3.0)
46
+
47
+ BUNDLED WITH
48
+ 1.16.6
@@ -0,0 +1,35 @@
1
+ # Cai::Ecs::Entrypoint
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cai/ecs/entrypoint`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'cai-ecs-entrypoint'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install cai-ecs-entrypoint
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cai-ecs-entrypoint.
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'aws-sdk-ssm'
4
+
5
+ env = {}
6
+ puts 'Injecting application secrets...'
7
+
8
+ begin
9
+ client = Aws::SSM::Client.new
10
+
11
+ next_token = nil
12
+ loop do
13
+ secrets = client.get_parameters_by_path(
14
+ path: ENV.fetch('SSM_KEY_PATH'),
15
+ with_decryption: true,
16
+ next_token: next_token
17
+ )
18
+
19
+ secrets.parameters.map do |parameter|
20
+ key = parameter.name.split('/').last
21
+ value = parameter.value
22
+ env[key] = value
23
+ end
24
+
25
+ next_token = secrets.next_token
26
+ break unless next_token
27
+
28
+ sleep 1 # don't overrun the API rate limit
29
+ end
30
+ rescue Aws::Errors::MissingRegionError
31
+ puts 'ERROR! Unable to fetch SSM parameters!'
32
+ puts 'In production environments, this should fail startup!'
33
+ end
34
+
35
+ exec env, *ARGV
@@ -0,0 +1,23 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "cai/ecs/entrypoint/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "cai-ecs-entrypoint"
8
+ spec.version = Cai::Ecs::Entrypoint::VERSION
9
+ spec.authors = ["Jarrod Carlson"]
10
+ spec.email = ["jarrod.carlson@coxautoinc.com"]
11
+
12
+ spec.summary = %q{Entrypoint script for ECS containers }
13
+ spec.description = %q{Injects SSM paramters into Docker containers running on AWS ECS}
14
+ spec.homepage = "https://ghe.coxautoinc.com/Transportation/cai-ecs-entrypoint"
15
+
16
+ # Specify which files should be added to the gem when it is released.
17
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
18
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
19
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ end
21
+ spec.executables = "ssm-entrypoint"
22
+ spec.add_dependency "aws-sdk-ssm", "~>1"
23
+ end
@@ -0,0 +1,7 @@
1
+ module Cai
2
+ module Ecs
3
+ module Entrypoint
4
+ VERSION = "1.0.0"
5
+ end
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cai-ecs-entrypoint
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Jarrod Carlson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-12-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sdk-ssm
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1'
27
+ description: Injects SSM paramters into Docker containers running on AWS ECS
28
+ email:
29
+ - jarrod.carlson@coxautoinc.com
30
+ executables:
31
+ - ssm-entrypoint
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - ".gitignore"
36
+ - Gemfile
37
+ - Gemfile.lock
38
+ - README.md
39
+ - bin/ssm-entrypoint
40
+ - cai-ecs-entrypoint.gemspec
41
+ - lib/cai/ecs/entrypoint/version.rb
42
+ homepage: https://ghe.coxautoinc.com/Transportation/cai-ecs-entrypoint
43
+ licenses: []
44
+ metadata: {}
45
+ post_install_message:
46
+ rdoc_options: []
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ requirements: []
60
+ rubyforge_project:
61
+ rubygems_version: 2.7.6
62
+ signing_key:
63
+ specification_version: 4
64
+ summary: Entrypoint script for ECS containers
65
+ test_files: []