Class: AWSCDK::EC2::ConnectionRule
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EC2::ConnectionRule
- Defined in:
- ec2/connection_rule.rb
Instance Attribute Summary collapse
-
#description ⇒ String?
readonly
Description of this connection.
-
#from_port ⇒ Numeric
readonly
Start of port range for the TCP and UDP protocols, or an ICMP type number.
-
#protocol ⇒ String?
readonly
The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers).
-
#to_port ⇒ Numeric?
readonly
End of port range for the TCP and UDP protocols, or an ICMP code.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(from_port:, description: nil, protocol: nil, to_port: nil) ⇒ ConnectionRule
constructor
A new instance of ConnectionRule.
- #to_jsii ⇒ Object
Constructor Details
#initialize(from_port:, description: nil, protocol: nil, to_port: nil) ⇒ ConnectionRule
Returns a new instance of ConnectionRule.
10 11 12 13 14 15 16 17 18 19 |
# File 'ec2/connection_rule.rb', line 10 def initialize(from_port:, description: nil, protocol: nil, to_port: nil) @from_port = from_port Jsii::Type.check_type(@from_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "fromPort") @description = description Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil? @protocol = protocol Jsii::Type.check_type(@protocol, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "protocol") unless @protocol.nil? @to_port = to_port Jsii::Type.check_type(@to_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "toPort") unless @to_port.nil? end |
Instance Attribute Details
#description ⇒ String? (readonly)
Default: No description
Description of this connection.
It is applied to both the ingress rule and the egress rule.
35 36 37 |
# File 'ec2/connection_rule.rb', line 35 def description @description end |
#from_port ⇒ Numeric (readonly)
Start of port range for the TCP and UDP protocols, or an ICMP type number.
If you specify icmp for the IpProtocol property, you can specify -1 as a wildcard (i.e., any ICMP type number).
27 28 29 |
# File 'ec2/connection_rule.rb', line 27 def from_port @from_port end |
#protocol ⇒ String? (readonly)
Default: tcp
The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers).
Use -1 to specify all protocols. If you specify -1, or a protocol number other than tcp, udp, icmp, or 58 (ICMPv6), traffic on all ports is allowed, regardless of any ports you specify. For tcp, udp, and icmp, you must specify a port range. For protocol 58 (ICMPv6), you can optionally specify a port range; if you don't, traffic for all types and codes is allowed.
47 48 49 |
# File 'ec2/connection_rule.rb', line 47 def protocol @protocol end |
#to_port ⇒ Numeric? (readonly)
Default: If toPort is not specified, it will be the same as fromPort.
End of port range for the TCP and UDP protocols, or an ICMP code.
If you specify icmp for the IpProtocol property, you can specify -1 as a wildcard (i.e., any ICMP code).
55 56 57 |
# File 'ec2/connection_rule.rb', line 55 def to_port @to_port end |
Class Method Details
.jsii_properties ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'ec2/connection_rule.rb', line 57 def self.jsii_properties { :from_port => "fromPort", :description => "description", :protocol => "protocol", :to_port => "toPort", } end |
Instance Method Details
#to_jsii ⇒ Object
66 67 68 69 70 71 72 73 74 75 |
# File 'ec2/connection_rule.rb', line 66 def to_jsii result = {} result.merge!({ "fromPort" => @from_port, "description" => @description, "protocol" => @protocol, "toPort" => @to_port, }) result.compact end |