Class: AWSCDK::Config::RuleScope

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

Overview

Determines which resources trigger an evaluation of an AWS Config rule.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ RuleScope

Returns a new instance of RuleScope.

Raises:

  • (NoMethodError)


8
9
10
# File 'config/rule_scope.rb', line 8

def initialize(*args)
  raise NoMethodError, "aws-cdk-lib.aws_config.RuleScope does not have a visible constructor; use the provided factory methods"
end

Class Method Details

.from_resource(resource_type, resource_id = nil) ⇒ AWSCDK::Config::RuleScope

restricts scope of changes to a specific resource type or resource identifier.

Parameters:

Returns:

  • (AWSCDK::Config::RuleScope)


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

def self.from_resource(resource_type, resource_id = nil)
  Jsii::Type.check_type(resource_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29uZmlnLlJlc291cmNlVHlwZSJ9")), "resourceType")
  Jsii::Type.check_type(resource_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourceId") unless resource_id.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_config.RuleScope", "fromResource", [resource_type, resource_id])
end

.from_resources(resource_types) ⇒ AWSCDK::Config::RuleScope

restricts scope of changes to specific resource types.

Parameters:

Returns:

  • (AWSCDK::Config::RuleScope)


36
37
38
39
# File 'config/rule_scope.rb', line 36

def self.from_resources(resource_types)
  Jsii::Type.check_type(resource_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb25maWcuUmVzb3VyY2VUeXBlIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "resourceTypes")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_config.RuleScope", "fromResources", [resource_types])
end

.from_tag(key, value = nil) ⇒ AWSCDK::Config::RuleScope

restricts scope of changes to a specific tag.

Parameters:

  • key (String)
  • value (String, nil) (defaults to: nil)

Returns:

  • (AWSCDK::Config::RuleScope)


46
47
48
49
50
# File 'config/rule_scope.rb', line 46

def self.from_tag(key, value = nil)
  Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value") unless value.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_config.RuleScope", "fromTag", [key, value])
end

.jsii_overridable_methodsObject



12
13
14
15
16
17
18
19
# File 'config/rule_scope.rb', line 12

def self.jsii_overridable_methods
  {
    :key => { kind: :property, name: "key", is_optional: true },
    :resource_id => { kind: :property, name: "resourceId", is_optional: true },
    :resource_types => { kind: :property, name: "resourceTypes", is_optional: true },
    :value => { kind: :property, name: "value", is_optional: true },
  }
end

Instance Method Details

#keyString?

tag key applied to resources that will trigger evaluation of a rule.

Returns:

  • (String, nil)


55
56
57
# File 'config/rule_scope.rb', line 55

def key()
  jsii_get_property("key")
end

#resource_idString?

ID of the only AWS resource that will trigger evaluation of a rule.

Returns:

  • (String, nil)


62
63
64
# File 'config/rule_scope.rb', line 62

def resource_id()
  jsii_get_property("resourceId")
end

#resource_typesArray<AWSCDK::Config::ResourceType>?

Resource types that will trigger evaluation of a rule.

Returns:



69
70
71
# File 'config/rule_scope.rb', line 69

def resource_types()
  jsii_get_property("resourceTypes")
end

#valueString?

tag value applied to resources that will trigger evaluation of a rule.

Returns:

  • (String, nil)


76
77
78
# File 'config/rule_scope.rb', line 76

def value()
  jsii_get_property("value")
end