Sha256: 6bc6c64796bb6c45d63fcb0ae8379d2704e645647651f8dc1d4c964e3d19bc6c

Contents?: true

Size: 420 Bytes

Versions: 5

Compression:

Stored size: 420 Bytes

Contents

require 'cloud_shaped/core_methods'

module CloudShaped

  module SnsMethods

    include CoreMethods

    def sns_topic(target)
      resource "AWS::SNS::Topic", "Subscription" => [
        { "Protocol" => sns_protocol(target), "Endpoint" => target }
      ]
    end

    private

    def sns_protocol(target)
      case target
      when /^(https?):/
        $1.upcase
      else "email"
      end
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cloud_shaped-0.1.2 lib/cloud_shaped/sns_methods.rb
cloud_shaped-0.1.1 lib/cloud_shaped/sns_methods.rb
cloud_shaped-0.1.0 lib/cloud_shaped/sns_methods.rb
cloud_shaped-0.0.2 lib/cloud_shaped/sns_methods.rb
cloud_shaped-0.0.1 lib/cloud_shaped/sns_methods.rb