Class: AWSCDK::VPCLattice::CfnListenerProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
vpc_lattice/cfn_listener_props.rb

Overview

Properties for defining a CfnListener.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(default_action:, protocol:, name: nil, port: nil, service_identifier: nil, tags: nil) ⇒ CfnListenerProps

Returns a new instance of CfnListenerProps.

Parameters:

  • default_action (AWSCDK::IResolvable, AWSCDK::VPCLattice::CfnListener::DefaultActionProperty)

    The action for the default rule.

  • protocol (String)

    The listener protocol.

  • name (String, nil) (defaults to: nil)

    The name of the listener.

  • port (Numeric, nil) (defaults to: nil)

    The listener port.

  • service_identifier (String, nil) (defaults to: nil)

    The ID or ARN of the service.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    The tags for the listener.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'vpc_lattice/cfn_listener_props.rb', line 15

def initialize(default_action:, protocol:, name: nil, port: nil, service_identifier: nil, tags: nil)
  @default_action = default_action.is_a?(Hash) ? ::AWSCDK::VPCLattice::CfnListener::DefaultActionProperty.new(**default_action.transform_keys(&:to_sym)) : default_action
  Jsii::Type.check_type(@default_action, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c192cGNsYXR0aWNlLkNmbkxpc3RlbmVyLkRlZmF1bHRBY3Rpb25Qcm9wZXJ0eSJ9XX19")), "defaultAction")
  @protocol = protocol
  Jsii::Type.check_type(@protocol, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "protocol")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @port = port
  Jsii::Type.check_type(@port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "port") unless @port.nil?
  @service_identifier = service_identifier
  Jsii::Type.check_type(@service_identifier, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "serviceIdentifier") unless @service_identifier.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#default_actionAWSCDK::IResolvable, AWSCDK::VPCLattice::CfnListener::DefaultActionProperty (readonly)

The action for the default rule.

Each listener has a default rule. The default rule is used if no other rules match.



36
37
38
# File 'vpc_lattice/cfn_listener_props.rb', line 36

def default_action
  @default_action
end

#nameString? (readonly)

The name of the listener.

A listener name must be unique within a service. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.

If you don't specify a name, CloudFormation generates one. However, if you specify a name, and later want to replace the resource, you must specify a new name.



50
51
52
# File 'vpc_lattice/cfn_listener_props.rb', line 50

def name
  @name
end

#portNumeric? (readonly)

The listener port.

You can specify a value from 1 to 65535. For HTTP, the default is 80. For HTTPS, the default is 443.



57
58
59
# File 'vpc_lattice/cfn_listener_props.rb', line 57

def port
  @port
end

#protocolString (readonly)

The listener protocol.



41
42
43
# File 'vpc_lattice/cfn_listener_props.rb', line 41

def protocol
  @protocol
end

#service_identifierString? (readonly)

The ID or ARN of the service.



62
63
64
# File 'vpc_lattice/cfn_listener_props.rb', line 62

def service_identifier
  @service_identifier
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

The tags for the listener.



67
68
69
# File 'vpc_lattice/cfn_listener_props.rb', line 67

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



69
70
71
72
73
74
75
76
77
78
# File 'vpc_lattice/cfn_listener_props.rb', line 69

def self.jsii_properties
  {
    :default_action => "defaultAction",
    :protocol => "protocol",
    :name => "name",
    :port => "port",
    :service_identifier => "serviceIdentifier",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



80
81
82
83
84
85
86
87
88
89
90
91
# File 'vpc_lattice/cfn_listener_props.rb', line 80

def to_jsii
  result = {}
  result.merge!({
    "defaultAction" => @default_action,
    "protocol" => @protocol,
    "name" => @name,
    "port" => @port,
    "serviceIdentifier" => @service_identifier,
    "tags" => @tags,
  })
  result.compact
end