Class: AWSCDK::EC2::RuleScope

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/rule_scope.rb

Overview

The scope and id in which a given SecurityGroup rule should be defined.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, scope:) ⇒ RuleScope

Returns a new instance of RuleScope.

Parameters:

  • id (String)

    The construct ID to use for the rule.

  • scope (AWSCDK::EC2::ISecurityGroup)

    The SecurityGroup in which a rule should be scoped.



9
10
11
12
13
14
# File 'ec2/rule_scope.rb', line 9

def initialize(id:, scope:)
  @id = id
  Jsii::Type.check_type(@id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  @scope = scope
  Jsii::Type.check_type(@scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklTZWN1cml0eUdyb3VwIn0=")), "scope")
end

Instance Attribute Details

#idString (readonly)

The construct ID to use for the rule.

Returns:

  • (String)


19
20
21
# File 'ec2/rule_scope.rb', line 19

def id
  @id
end

#scopeAWSCDK::EC2::ISecurityGroup (readonly)

The SecurityGroup in which a rule should be scoped.



23
24
25
# File 'ec2/rule_scope.rb', line 23

def scope
  @scope
end

Class Method Details

.jsii_propertiesObject



25
26
27
28
29
30
# File 'ec2/rule_scope.rb', line 25

def self.jsii_properties
  {
    :id => "id",
    :scope => "scope",
  }
end

Instance Method Details

#to_jsiiObject



32
33
34
35
36
37
38
39
# File 'ec2/rule_scope.rb', line 32

def to_jsii
  result = {}
  result.merge!({
    "id" => @id,
    "scope" => @scope,
  })
  result.compact
end