Class: AWSCDK::Backup::CfnFramework::ControlScopeProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
backup/cfn_framework.rb

Overview

A framework consists of one or more controls.

Each control has its own control scope. The control scope can include one or more resource types, a combination of a tag key and value, or a combination of one resource type and one resource ID. If no scope is specified, evaluations for the rule are triggered when any resource in your recording group changes in configuration.

To set a control scope that includes all of a particular resource, leave the ControlScope empty or do not pass it when calling CreateFramework .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(compliance_resource_ids: nil, compliance_resource_types: nil, tags: nil) ⇒ ControlScopeProperty

Returns a new instance of ControlScopeProperty.

Parameters:

  • compliance_resource_ids (Array<String>, nil) (defaults to: nil)

    The ID of the only AWS resource that you want your control scope to contain.

  • compliance_resource_types (Array<String>, nil) (defaults to: nil)

    Describes whether the control scope includes one or more types of resources, such as EFS or RDS .

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

    The tag key-value pair applied to those AWS resources that you want to trigger an evaluation for a rule.



639
640
641
642
643
644
645
646
# File 'backup/cfn_framework.rb', line 639

def initialize(compliance_resource_ids: nil, compliance_resource_types: nil, tags: nil)
  @compliance_resource_ids = compliance_resource_ids
  Jsii::Type.check_type(@compliance_resource_ids, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "complianceResourceIds") unless @compliance_resource_ids.nil?
  @compliance_resource_types = compliance_resource_types
  Jsii::Type.check_type(@compliance_resource_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "complianceResourceTypes") unless @compliance_resource_types.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

#compliance_resource_idsArray<String>? (readonly)

The ID of the only AWS resource that you want your control scope to contain.



652
653
654
# File 'backup/cfn_framework.rb', line 652

def compliance_resource_ids
  @compliance_resource_ids
end

#compliance_resource_typesArray<String>? (readonly)

Describes whether the control scope includes one or more types of resources, such as EFS or RDS .



657
658
659
# File 'backup/cfn_framework.rb', line 657

def compliance_resource_types
  @compliance_resource_types
end

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

The tag key-value pair applied to those AWS resources that you want to trigger an evaluation for a rule.

A maximum of one key-value pair can be provided. The tag value is optional, but it cannot be an empty string if you are creating or editing a framework from the console (though the value can be an empty string when included in a CloudFormation template).

The structure to assign a tag is: [{"Key":"string","Value":"string"}] .



666
667
668
# File 'backup/cfn_framework.rb', line 666

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



668
669
670
671
672
673
674
# File 'backup/cfn_framework.rb', line 668

def self.jsii_properties
  {
    :compliance_resource_ids => "complianceResourceIds",
    :compliance_resource_types => "complianceResourceTypes",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



676
677
678
679
680
681
682
683
684
# File 'backup/cfn_framework.rb', line 676

def to_jsii
  result = {}
  result.merge!({
    "complianceResourceIds" => @compliance_resource_ids,
    "complianceResourceTypes" => @compliance_resource_types,
    "tags" => @tags,
  })
  result.compact
end