jackal-cfn 0.1.0 → 0.1.2
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.
- data/CHANGELOG.md +6 -0
 - data/lib/jackal-cfn/resource/hash_extractor.rb +5 -5
 - data/lib/jackal-cfn/resource.rb +6 -3
 - data/lib/jackal-cfn/version.rb +1 -1
 - metadata +2 -2
 
    
        data/CHANGELOG.md
    CHANGED
    
    
| 
         @@ -25,11 +25,11 @@ module Jackal 
     | 
|
| 
       25 
25 
     | 
    
         
             
                    #
         
     | 
| 
       26 
26 
     | 
    
         
             
                    # @param message [Carnivore::Message]
         
     | 
| 
       27 
27 
     | 
    
         
             
                    # @return [Truthy, Falsey]
         
     | 
| 
       28 
     | 
    
         
            -
                    def valid?(message)
         
     | 
| 
       29 
     | 
    
         
            -
                      super do |payload|
         
     | 
| 
       30 
     | 
    
         
            -
                        payload.get('ResourceProperties', 'Action') == 'hash_extractor'
         
     | 
| 
       31 
     | 
    
         
            -
                      end
         
     | 
| 
       32 
     | 
    
         
            -
                    end
         
     | 
| 
      
 28 
     | 
    
         
            +
            #        def valid?(message)
         
     | 
| 
      
 29 
     | 
    
         
            +
            #          super do |payload|
         
     | 
| 
      
 30 
     | 
    
         
            +
            #            payload.get('ResourceProperties', 'Action') == 'hash_extractor'
         
     | 
| 
      
 31 
     | 
    
         
            +
            #          end
         
     | 
| 
      
 32 
     | 
    
         
            +
            #        end
         
     | 
| 
       33 
33 
     | 
    
         | 
| 
       34 
34 
     | 
    
         
             
                    # Process message, send value back to CFN
         
     | 
| 
       35 
35 
     | 
    
         
             
                    #
         
     | 
    
        data/lib/jackal-cfn/resource.rb
    CHANGED
    
    | 
         @@ -28,8 +28,9 @@ module Jackal 
     | 
|
| 
       28 
28 
     | 
    
         
             
                      'LogicalResourceId' => args[:logical_resource_id],
         
     | 
| 
       29 
29 
     | 
    
         
             
                      'PhysicalResourceId' => args.fetch(:physical_resource_id, physical_resource_id),
         
     | 
| 
       30 
30 
     | 
    
         
             
                      'StackId' => args[:stack_id],
         
     | 
| 
      
 31 
     | 
    
         
            +
                      'RequestId' => args[:request_id],
         
     | 
| 
       31 
32 
     | 
    
         
             
                      'Status' => 'SUCCESS',
         
     | 
| 
       32 
     | 
    
         
            -
                      'Reason' =>  
     | 
| 
      
 33 
     | 
    
         
            +
                      'Reason' => 'Not provided',
         
     | 
| 
       33 
34 
     | 
    
         
             
                      'Data' => Smash.new
         
     | 
| 
       34 
35 
     | 
    
         
             
                    )
         
     | 
| 
       35 
36 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -64,7 +65,7 @@ module Jackal 
     | 
|
| 
       64 
65 
     | 
    
         
             
                    connection = response_endpoint(url.host, url.scheme)
         
     | 
| 
       65 
66 
     | 
    
         
             
                    path = "#{url.path}?#{url.query}"
         
     | 
| 
       66 
67 
     | 
    
         
             
                    debug "Custom resource response data: #{response.inspect}"
         
     | 
| 
       67 
     | 
    
         
            -
                    complete = connection. 
     | 
| 
      
 68 
     | 
    
         
            +
                    complete = connection.put(path, JSON.dump(response))
         
     | 
| 
       68 
69 
     | 
    
         
             
                    case complete.status
         
     | 
| 
       69 
70 
     | 
    
         
             
                    when 200
         
     | 
| 
       70 
71 
     | 
    
         
             
                      info "Custom resource response complete! (Sent to: #{url})"
         
     | 
| 
         @@ -102,8 +103,10 @@ module Jackal 
     | 
|
| 
       102 
103 
     | 
    
         
             
                  # @return [TrueClass, FalseClass]
         
     | 
| 
       103 
104 
     | 
    
         
             
                  def valid?(message)
         
     | 
| 
       104 
105 
     | 
    
         
             
                    super do |payload|
         
     | 
| 
      
 106 
     | 
    
         
            +
                      resource_type = payload['ResourceType'].split('::').last
         
     | 
| 
       105 
107 
     | 
    
         
             
                      result = payload[:origin_type] == 'Notification' &&
         
     | 
| 
       106 
     | 
    
         
            -
                        payload[:origin_subject].downcase.include?('cloudformation custom resource')
         
     | 
| 
      
 108 
     | 
    
         
            +
                        payload[:origin_subject].downcase.include?('cloudformation custom resource') &&
         
     | 
| 
      
 109 
     | 
    
         
            +
                        (resource_type == 'CustomResource' || resource_type == self.class.name.split('::').last)
         
     | 
| 
       107 
110 
     | 
    
         
             
                      if(result && block_given?)
         
     | 
| 
       108 
111 
     | 
    
         
             
                        yield payload
         
     | 
| 
       109 
112 
     | 
    
         
             
                      else
         
     | 
    
        data/lib/jackal-cfn/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: jackal-cfn
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.2
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2014-07- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2014-07-04 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: jackal
         
     |