inspec-cloudformation 0.0.2 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4b001d6d0b1267f8fde5b01ea3e5e65ae9d20cf1e23f373f2ca60dbab3b4b9a
4
- data.tar.gz: 17bf672a61199c52d39f1d738f1feb257b7015dd9f57cfd2ac7faff681d07ed2
3
+ metadata.gz: e96908dc7e410048189fb3e7e4ddd8ddcde32109204a2f2b4cb3e792907bdd47
4
+ data.tar.gz: a4dd5efe5c88c82778eb421627df4fd0ff8daf454a08d49a466143563036c6e9
5
5
  SHA512:
6
- metadata.gz: 546860726e04ee883b2930c3abe8134591e2d2b76496aacdb4d9ed328f8f872aef1b0471ad6bb718de193b647a3a39d8e03a042ab961685bb51edcf84bc8f814
7
- data.tar.gz: 1141c69e4fe9266a06b1d517fd6831928d0f638703ad4bc996f1ff7527a93b1e4f33e4c2bb91981cf1b9ef063c3a8b59262a3718a448d46d7e8a8b65db7a982c
6
+ metadata.gz: df1da2ff6388e562e048f9f73ec6f495a24e339483021895d0d5048abfc309723492ab5fed8e3013e33d041b778e981ddd01ebe4e25d38e7bff1f778d90e4bc6
7
+ data.tar.gz: 3512c44a93d000d5f6acca4cbb050ad0e632adab8eb585b4f175f5124fdb4cfeca392f3bbbc8c67c05f0c75401c29b545d38c46e6958389e9d3576820b8427cc
data/Gemfile CHANGED
@@ -3,6 +3,8 @@ source "https://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  gem 'rake-release'
6
+ gem 'gem-release'
7
+ gem 'rubygems-update'
6
8
 
7
9
  group :development do
8
10
  gem "chefstyle", "2.2.0"
data/README.md CHANGED
@@ -1 +1,10 @@
1
1
  # inspec-cloudformation
2
+
3
+
4
+ ## Release Process
5
+
6
+ - make your changes
7
+ - `git ca`
8
+ - `gem tag`
9
+ - `gem release`
10
+ - `gem bump`
@@ -5,10 +5,10 @@ require 'aws-sdk-cloudformation'
5
5
  module InspecPlugins::CloudFormation
6
6
  class Input < Inspec.plugin(2, :input)
7
7
 
8
- VALID_PATTERNS = [
9
- Regexp.new("^databag://[^/]+/[^/]+/.+$"),
10
- Regexp.new("^node://[^/]*/attributes/.+$"),
11
- ].freeze
8
+ # VALID_PATTERNS = [
9
+ # Regexp.new("^databag://[^/]+/[^/]+/.+$"),
10
+ # Regexp.new("^node://[^/]*/attributes/.+$"),
11
+ # ].freeze
12
12
 
13
13
  attr_reader :plugin_conf
14
14
  attr_reader :priority
@@ -41,15 +41,16 @@ module InspecPlugins::CloudFormation
41
41
  def fetch(profile_name, input_name)
42
42
  # skip any input name that is an invalid cloudformation stack name to keep things quick...no need to make the AWS API call.
43
43
  return nil if input_name.include?('_')
44
-
45
- cf = Aws::CloudFormation::Client.new
44
+ return nil unless input_name.include?('/')
46
45
 
47
46
  # input format will be "cloudformation stack name / output name"
48
47
  stack_name = input_name.split('/').first
49
48
  output_name = input_name.split('/').last
50
49
 
51
- logger.info format("The stack name is %s", stack_name)
52
- logger.info format("The output name is %s", output_name)
50
+ logger.debug format("The stack name is %s", stack_name)
51
+ logger.debug format("The output name is %s", output_name)
52
+
53
+ cf = Aws::CloudFormation::Client.new
53
54
 
54
55
  name = { stack_name: stack_name }
55
56
  resp = cf.describe_stacks(name)
@@ -59,13 +60,16 @@ module InspecPlugins::CloudFormation
59
60
  next unless output['output_key'] == output_name
60
61
  return output['output_value']
61
62
  end
63
+
64
+ # if no CloudFormation output found
65
+ return nil
62
66
  end
63
67
 
64
68
  private
65
69
 
66
- def valid_plugin_input?(input)
67
- VALID_PATTERNS.any? { |regex| regex.match? input }
68
- end
70
+ # def valid_plugin_input?(input)
71
+ # VALID_PATTERNS.any? { |regex| regex.match? input }
72
+ # end
69
73
 
70
74
  def fetch_plugin_setting(setting_name, default = nil)
71
75
  env_var_name = "INSPEC_CLOUDFORMATION_#{setting_name.upcase}"
@@ -3,6 +3,6 @@
3
3
  # to learn the current version.
4
4
  module InspecPlugins
5
5
  module CloudFormation
6
- VERSION = "0.0.2".freeze
6
+ VERSION = "0.0.5".freeze
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inspec-cloudformation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Boutte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-01 00:00:00.000000000 Z
11
+ date: 2022-07-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This plugin allows InSpec 'inputs' to be provided by CloudFormation Outputs.
14
14
  email: