Sha256: 4e0407d91070e7a472deab3f849b863fda214d09bfd94eeda07aa8a80c914efe

Contents?: true

Size: 786 Bytes

Versions: 8

Compression:

Stored size: 786 Bytes

Contents

class Ufo::Stack::Builder::Resources
  class Listener < Base
    def build
      {
        Type: "AWS::ElasticLoadBalancingV2::Listener",
        Condition: "CreateElbIsTrue",
        Properties: properties,
      }
    end

    def properties
      props = {
        DefaultActions: [
          {
            Type: "forward",
            TargetGroupArn: {
              "Fn::If": [
                "ElbTargetGroupIsBlank",
                {Ref: "TargetGroup"},
                {Ref: "ElbTargetGroup"}
              ]
            }
          }
        ],
        LoadBalancerArn: {Ref: "Elb"},
        Protocol: protocol,
      }

      props[:Port] = port if port

      props
    end

    def protocol
      @default_listener_protocol
    end

    def port
      80
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ufo-5.0.7 lib/ufo/stack/builder/resources/listener.rb
ufo-5.0.6 lib/ufo/stack/builder/resources/listener.rb
ufo-5.0.5 lib/ufo/stack/builder/resources/listener.rb
ufo-5.0.4 lib/ufo/stack/builder/resources/listener.rb
ufo-5.0.3 lib/ufo/stack/builder/resources/listener.rb
ufo-5.0.2 lib/ufo/stack/builder/resources/listener.rb
ufo-5.0.1 lib/ufo/stack/builder/resources/listener.rb
ufo-5.0.0 lib/ufo/stack/builder/resources/listener.rb