inspec-cloudformation 0.0.2 → 0.0.3

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: cc44cb77b21af4d0d5ead072f8a99e48b89c6eb5ec93d733ac93d25112ca48ba
4
+ data.tar.gz: 97e11a09e36df18ca8101467cbef53298e07ec9028129f854c8922ba451cb6df
5
5
  SHA512:
6
- metadata.gz: 546860726e04ee883b2930c3abe8134591e2d2b76496aacdb4d9ed328f8f872aef1b0471ad6bb718de193b647a3a39d8e03a042ab961685bb51edcf84bc8f814
7
- data.tar.gz: 1141c69e4fe9266a06b1d517fd6831928d0f638703ad4bc996f1ff7527a93b1e4f33e4c2bb91981cf1b9ef063c3a8b59262a3718a448d46d7e8a8b65db7a982c
6
+ metadata.gz: fcca86119259e91f48d28555f9348f4525fedcd04d36fcadf71c9a9a818b81d072d42036d6c17371225f3e0b0821beb8a0b731c3ede4b496cfe32bd42bd3c68f
7
+ data.tar.gz: '08ffc015af0c10ddd2e3b5c58b194cb29c06f43e749f01792c91e6161a407cc4f9b2910213bc4269cfae166aeef7c26700a0b0a412265a0be3d134ae983430d2'
@@ -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,6 +60,9 @@ 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
@@ -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.3".freeze
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
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.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Boutte