train-aws 0.1.1 → 0.1.5
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.
- checksums.yaml +5 -5
- data/Gemfile +9 -17
- data/lib/train-aws.rb +4 -4
- data/lib/train-aws/connection.rb +22 -22
- data/lib/train-aws/platform.rb +5 -3
- data/lib/train-aws/transport.rb +10 -10
- data/lib/train-aws/version.rb +1 -1
- data/train-aws.gemspec +31 -29
- metadata +31 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5ea53450765e6c3beedff5183f5ea2dc29bbc64b1c46369edcf5f51956cccdae
|
4
|
+
data.tar.gz: 6141a26ab4b50f6032239067a5aef6d5a5217af54953fc959089118570321ad4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78257871832226f1755ef870b583da2b4b7646fc7f7181ae9743b4caa7a49379ee9b7de1b0cff1276931370ea815e6fb8e3816049ce40d6db51f92ab3ba552ff
|
7
|
+
data.tar.gz: 07c216c8f87cce171adeeac9d875040529b0f274879f76819bc892d06695617a29468f026ebaf50d778a61561915632141616bf56df8a864a447d4870d99bcc8
|
data/Gemfile
CHANGED
@@ -1,22 +1,14 @@
|
|
1
|
-
|
2
|
-
source 'https://rubygems.org'
|
1
|
+
source "https://rubygems.org"
|
3
2
|
|
4
|
-
# This is Gemfile, which is used by bundler
|
5
|
-
# to ensure a coherent set of gems is installed.
|
6
|
-
# This file lists dependencies needed when outside
|
7
|
-
# of a gem (the gemspec lists deps for gem deployment)
|
8
|
-
|
9
|
-
# Bundler should refer to the gemspec for any dependencies.
|
10
3
|
gemspec
|
11
4
|
|
12
|
-
# Remaining group is only used for development.
|
13
5
|
group :development do
|
14
|
-
gem
|
15
|
-
gem
|
16
|
-
gem
|
17
|
-
gem
|
18
|
-
gem
|
19
|
-
gem
|
20
|
-
gem
|
21
|
-
gem
|
6
|
+
gem "pry"
|
7
|
+
gem "bundler"
|
8
|
+
gem "byebug"
|
9
|
+
gem "minitest"
|
10
|
+
gem "mocha"
|
11
|
+
gem "m"
|
12
|
+
gem "rake"
|
13
|
+
gem "chefstyle"
|
22
14
|
end
|
data/lib/train-aws.rb
CHANGED
@@ -12,10 +12,10 @@ libdir = File.dirname(__FILE__)
|
|
12
12
|
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
|
13
13
|
|
14
14
|
# It's traditonal to keep your gem version in a separate file, so CI can find it easier.
|
15
|
-
require
|
15
|
+
require "train-aws/version"
|
16
16
|
|
17
17
|
# A train plugin has three components: Transport, Connection, and Platform.
|
18
18
|
# Transport acts as the glue.
|
19
|
-
require
|
20
|
-
require
|
21
|
-
require
|
19
|
+
require "train-aws/transport"
|
20
|
+
require "train-aws/platform"
|
21
|
+
require "train-aws/connection"
|
data/lib/train-aws/connection.rb
CHANGED
@@ -14,27 +14,27 @@
|
|
14
14
|
|
15
15
|
# Push platform detection out to a mixin, as it tends
|
16
16
|
# to develop at a different cadence than the rest
|
17
|
-
require
|
18
|
-
require
|
19
|
-
require
|
17
|
+
require "train-aws/platform"
|
18
|
+
require "train"
|
19
|
+
require "train/plugins"
|
20
20
|
|
21
|
-
require
|
21
|
+
require "aws-sdk-core"
|
22
22
|
|
23
|
-
require
|
24
|
-
require
|
25
|
-
require
|
26
|
-
require
|
27
|
-
require
|
28
|
-
require
|
29
|
-
require
|
30
|
-
require
|
31
|
-
require
|
32
|
-
require
|
33
|
-
require
|
34
|
-
require
|
35
|
-
require
|
36
|
-
require
|
37
|
-
require
|
23
|
+
require "aws-sdk-cloudtrail"
|
24
|
+
require "aws-sdk-cloudwatch"
|
25
|
+
require "aws-sdk-cloudwatchlogs"
|
26
|
+
require "aws-sdk-costandusagereportservice"
|
27
|
+
require "aws-sdk-configservice"
|
28
|
+
require "aws-sdk-ec2"
|
29
|
+
require "aws-sdk-ecs"
|
30
|
+
require "aws-sdk-eks"
|
31
|
+
require "aws-sdk-elasticloadbalancing"
|
32
|
+
require "aws-sdk-iam"
|
33
|
+
require "aws-sdk-kms"
|
34
|
+
require "aws-sdk-rds"
|
35
|
+
require "aws-sdk-s3"
|
36
|
+
require "aws-sdk-sqs"
|
37
|
+
require "aws-sdk-sns"
|
38
38
|
|
39
39
|
module TrainPlugins
|
40
40
|
module Aws
|
@@ -58,7 +58,7 @@ module TrainPlugins
|
|
58
58
|
options[:region] = options[:host] || options[:region]
|
59
59
|
if options[:path]
|
60
60
|
# string the leading / from path
|
61
|
-
options[:profile] = options[:path].sub(%r{^/},
|
61
|
+
options[:profile] = options[:path].sub(%r{^/}, "")
|
62
62
|
end
|
63
63
|
|
64
64
|
# Now let the BaseConnection have a chance to configure itself.
|
@@ -69,8 +69,8 @@ module TrainPlugins
|
|
69
69
|
|
70
70
|
# Why are we doing this?
|
71
71
|
# Why aren't we calling the AWS config system?
|
72
|
-
ENV[
|
73
|
-
ENV[
|
72
|
+
ENV["AWS_PROFILE"] = @options[:profile] if @options[:profile]
|
73
|
+
ENV["AWS_REGION"] = @options[:region] if @options[:region]
|
74
74
|
end
|
75
75
|
|
76
76
|
# We support caching on the aws_client call, but not the aws_resource call
|
data/lib/train-aws/platform.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require "train-aws/version"
|
2
|
+
|
1
3
|
# Platform definition file. This is a good place to separate out any
|
2
4
|
# logic regarding the identification of the OS or API at the far end
|
3
5
|
# of the connection.
|
@@ -18,7 +20,7 @@ module TrainPlugins::Aws
|
|
18
20
|
# of the cloud family.
|
19
21
|
|
20
22
|
# This plugin defines a new platform.
|
21
|
-
Train::Platforms.name(
|
23
|
+
Train::Platforms.name("aws").in_family("cloud")
|
22
24
|
|
23
25
|
# When you know you will only ever run on your dedicated platform
|
24
26
|
# force_platform! lets you bypass platform detection.
|
@@ -27,11 +29,11 @@ module TrainPlugins::Aws
|
|
27
29
|
# Use release to report a version number. You might use the version
|
28
30
|
# of the plugin, or a version of an important underlying SDK, or a
|
29
31
|
# version of a remote API.
|
30
|
-
aws_version = Gem.loaded_specs[
|
32
|
+
aws_version = Gem.loaded_specs["aws-sdk-core"].version
|
31
33
|
aws_version = "aws-sdk-core: v#{aws_version}"
|
32
34
|
plugin_version = "train-aws: v#{TrainPlugins::Aws::VERSION}"
|
33
35
|
|
34
|
-
force_platform!(
|
36
|
+
force_platform!("aws", release: "#{plugin_version}, #{aws_version}")
|
35
37
|
end
|
36
38
|
end
|
37
39
|
end
|
data/lib/train-aws/transport.rb
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
2
|
+
require "train"
|
3
|
+
require "train/plugins"
|
4
|
+
require "aws-sdk-core"
|
5
5
|
|
6
6
|
# Train Plugins v1 are usually declared under the TrainPlugins namespace.
|
7
7
|
# Each plugin has three components: Transport, Connection, and Platform.
|
8
8
|
# We'll only define the Transport here, but we'll refer to the others.
|
9
|
-
require
|
9
|
+
require "train-aws/connection"
|
10
10
|
|
11
11
|
module TrainPlugins
|
12
12
|
module Aws
|
13
13
|
class Transport < Train.plugin(1)
|
14
|
-
name
|
14
|
+
name "aws"
|
15
15
|
|
16
16
|
# Pass ENV vars in using a block to `option`. This causes `
|
17
17
|
# option to lazy-evaluate the block to provide a default value.`
|
18
18
|
# Otherwise, we would read the ENV var (and set the default)
|
19
19
|
# once at compile time, which would make testing difficult.
|
20
20
|
# TODO: convert to thor-style defaults
|
21
|
-
option(:region, required: true) { ENV[
|
22
|
-
option(:access_key_id) { ENV[
|
23
|
-
option(:secret_access_key) { ENV[
|
24
|
-
option(:session_token) { ENV[
|
21
|
+
option(:region, required: true) { ENV["AWS_REGION"] }
|
22
|
+
option(:access_key_id) { ENV["AWS_ACCESS_KEY_ID"] }
|
23
|
+
option(:secret_access_key) { ENV["AWS_SECRET_ACCESS_KEY"] }
|
24
|
+
option(:session_token) { ENV["AWS_SESSION_TOKEN"] }
|
25
25
|
|
26
26
|
# This can provide the access key id and secret access key
|
27
|
-
option(:profile) { ENV[
|
27
|
+
option(:profile) { ENV["AWS_PROFILE"] }
|
28
28
|
|
29
29
|
# The only thing you MUST do in a transport is a define a
|
30
30
|
# connection() method that returns a instance that is a
|
data/lib/train-aws/version.rb
CHANGED
data/train-aws.gemspec
CHANGED
@@ -4,22 +4,22 @@
|
|
4
4
|
|
5
5
|
# It is traditional in a gemspec to dynamically load the current version
|
6
6
|
# from a file in the source tree. The next three lines make that happen.
|
7
|
-
lib = File.expand_path(
|
7
|
+
lib = File.expand_path("../lib", __FILE__)
|
8
8
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
9
|
-
require
|
9
|
+
require "train-aws/version"
|
10
10
|
|
11
11
|
Gem::Specification.new do |spec|
|
12
12
|
# Importantly, all Train plugins must be prefixed with `train-`
|
13
|
-
spec.name =
|
13
|
+
spec.name = "train-aws"
|
14
14
|
|
15
15
|
# It is polite to namespace your plugin under InspecPlugins::YourPluginInCamelCase
|
16
16
|
spec.version = TrainPlugins::Aws::VERSION
|
17
|
-
spec.authors = [
|
18
|
-
spec.email = [
|
17
|
+
spec.authors = ["Chef InSpec Team"]
|
18
|
+
spec.email = ["inspec@chef.io"]
|
19
19
|
spec.summary = "AWS API Transport for Train"
|
20
|
-
spec.description =
|
21
|
-
spec.homepage =
|
22
|
-
spec.license =
|
20
|
+
spec.description = "Allows applictaions using Train to speak to AWS; handles authentication, cacheing, and SDK dependency management."
|
21
|
+
spec.homepage = "https://github.com/inspec/train-aws"
|
22
|
+
spec.license = "Apache-2.0"
|
23
23
|
|
24
24
|
# Though complicated-looking, this is pretty standard for a gemspec.
|
25
25
|
# It just filters what will actually be packaged in the gem (leaving
|
@@ -27,9 +27,9 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.files = %w{
|
28
28
|
README.md train-aws.gemspec Gemfile
|
29
29
|
} + Dir.glob(
|
30
|
-
|
30
|
+
"lib/**/*", File::FNM_DOTMATCH
|
31
31
|
).reject { |f| File.directory?(f) }
|
32
|
-
spec.require_paths = [
|
32
|
+
spec.require_paths = ["lib"]
|
33
33
|
|
34
34
|
# If you rely on any other gems, list them here with any constraints.
|
35
35
|
# This is how `inspec plugin install` is able to manage your dependencies.
|
@@ -39,23 +39,25 @@ Gem::Specification.new do |spec|
|
|
39
39
|
|
40
40
|
# Do not list inspec as a dependency of a train plugin.
|
41
41
|
|
42
|
-
spec.add_dependency
|
43
|
-
spec.add_dependency
|
44
|
-
spec.add_dependency
|
45
|
-
spec.add_dependency
|
46
|
-
spec.add_dependency
|
47
|
-
spec.add_dependency
|
48
|
-
spec.add_dependency
|
49
|
-
spec.add_dependency
|
50
|
-
spec.add_dependency
|
51
|
-
spec.add_dependency
|
52
|
-
spec.add_dependency
|
53
|
-
spec.add_dependency
|
54
|
-
spec.add_dependency
|
55
|
-
spec.add_dependency
|
56
|
-
spec.add_dependency
|
57
|
-
spec.add_dependency
|
58
|
-
spec.add_dependency
|
59
|
-
spec.add_dependency
|
60
|
-
spec.add_dependency
|
42
|
+
spec.add_dependency "train", "~> 2.0"
|
43
|
+
spec.add_dependency "aws-sdk-autoscaling", "~> 1.22.0"
|
44
|
+
spec.add_dependency "aws-sdk-core", "~> 3.0"
|
45
|
+
spec.add_dependency "aws-sdk-cloudtrail", "~> 1.8"
|
46
|
+
spec.add_dependency "aws-sdk-cloudwatch", "~> 1.13"
|
47
|
+
spec.add_dependency "aws-sdk-cloudwatchlogs", "~> 1.13"
|
48
|
+
spec.add_dependency "aws-sdk-configservice", "~> 1.21"
|
49
|
+
spec.add_dependency "aws-sdk-costandusagereportservice", "~> 1.6"
|
50
|
+
spec.add_dependency "aws-sdk-dynamodb", "~> 1.31"
|
51
|
+
spec.add_dependency "aws-sdk-ec2", "~> 1.70"
|
52
|
+
spec.add_dependency "aws-sdk-ecr", "~> 1.18"
|
53
|
+
spec.add_dependency "aws-sdk-ecs", "~> 1.30"
|
54
|
+
spec.add_dependency "aws-sdk-eks", "~> 1.9"
|
55
|
+
spec.add_dependency "aws-sdk-elasticloadbalancing", "~> 1.8"
|
56
|
+
spec.add_dependency "aws-sdk-iam", "~> 1.13"
|
57
|
+
spec.add_dependency "aws-sdk-kms", "~> 1.13"
|
58
|
+
spec.add_dependency "aws-sdk-organizations", "~> 1.17.0"
|
59
|
+
spec.add_dependency "aws-sdk-rds", "~> 1.43"
|
60
|
+
spec.add_dependency "aws-sdk-s3", "~> 1.30"
|
61
|
+
spec.add_dependency "aws-sdk-sns", "~> 1.9"
|
62
|
+
spec.add_dependency "aws-sdk-sqs", "~> 1.10"
|
61
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: train-aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef InSpec Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: train
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '1.6'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: aws-sdk-dynamodb
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '1.31'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '1.31'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: aws-sdk-ec2
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,6 +150,20 @@ dependencies:
|
|
136
150
|
- - "~>"
|
137
151
|
- !ruby/object:Gem::Version
|
138
152
|
version: '1.70'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: aws-sdk-ecr
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '1.18'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '1.18'
|
139
167
|
- !ruby/object:Gem::Dependency
|
140
168
|
name: aws-sdk-ecs
|
141
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -311,8 +339,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
311
339
|
- !ruby/object:Gem::Version
|
312
340
|
version: '0'
|
313
341
|
requirements: []
|
314
|
-
|
315
|
-
rubygems_version: 2.6.14.3
|
342
|
+
rubygems_version: 3.0.3
|
316
343
|
signing_key:
|
317
344
|
specification_version: 4
|
318
345
|
summary: AWS API Transport for Train
|