Class: AWSCDK::Backup::CfnBackupSelection::BackupSelectionResourceTypeProperty

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

Overview

Specifies an object containing properties used to assign a set of resources to a backup plan.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(iam_role_arn:, selection_name:, conditions: nil, list_of_tags: nil, not_resources: nil, resources: nil) ⇒ BackupSelectionResourceTypeProperty

Returns a new instance of BackupSelectionResourceTypeProperty.

Parameters:

  • iam_role_arn (String)

    The ARN of the IAM role that AWS Backup uses to authenticate when backing up the target resource;

  • selection_name (String)

    The display name of a resource selection document.

  • conditions (Object, nil) (defaults to: nil)

    A list of conditions that you define to assign resources to your backup plans using tags.

  • list_of_tags (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Backup::CfnBackupSelection::ConditionResourceTypeProperty>, nil) (defaults to: nil)

    A list of conditions that you define to assign resources to your backup plans using tags.

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

    A list of Amazon Resource Names (ARNs) to exclude from a backup plan.

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

    An array of strings that contain Amazon Resource Names (ARNs) of resources to assign to a backup plan.



537
538
539
540
541
542
543
544
545
546
547
548
549
550
# File 'backup/cfn_backup_selection.rb', line 537

def initialize(iam_role_arn:, selection_name:, conditions: nil, list_of_tags: nil, not_resources: nil, resources: nil)
  @iam_role_arn = iam_role_arn
  Jsii::Type.check_type(@iam_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "iamRoleArn")
  @selection_name = selection_name
  Jsii::Type.check_type(@selection_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "selectionName")
  @conditions = conditions
  Jsii::Type.check_type(@conditions, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "conditions") unless @conditions.nil?
  @list_of_tags = list_of_tags
  Jsii::Type.check_type(@list_of_tags, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmFja3VwLkNmbkJhY2t1cFNlbGVjdGlvbi5Db25kaXRpb25SZXNvdXJjZVR5cGVQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "listOfTags") unless @list_of_tags.nil?
  @not_resources = not_resources
  Jsii::Type.check_type(@not_resources, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "notResources") unless @not_resources.nil?
  @resources = resources
  Jsii::Type.check_type(@resources, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "resources") unless @resources.nil?
end

Instance Attribute Details

#conditionsObject? (readonly)

A list of conditions that you define to assign resources to your backup plans using tags.

For example, "StringEquals": { "ConditionKey": "aws:ResourceTag/CreatedByCryo", "ConditionValue": "true" }, . Condition operators are case sensitive.

Conditions differs from ListOfTags as follows:

  • When you specify more than one condition, you only assign the resources that match ALL conditions (using AND logic).
  • Conditions supports StringEquals , StringLike , StringNotEquals , and StringNotLike . ListOfTags only supports StringEquals .


575
576
577
# File 'backup/cfn_backup_selection.rb', line 575

def conditions
  @conditions
end

#iam_role_arnString (readonly)

The ARN of the IAM role that AWS Backup uses to authenticate when backing up the target resource;

for example, arn:aws:iam::123456789012:role/S3Access .



558
559
560
# File 'backup/cfn_backup_selection.rb', line 558

def iam_role_arn
  @iam_role_arn
end

#list_of_tagsAWSCDK::IResolvable, ... (readonly)

A list of conditions that you define to assign resources to your backup plans using tags.

For example, "StringEquals": { "ConditionKey": "aws:ResourceTag/CreatedByCryo", "ConditionValue": "true" }, . Condition operators are case sensitive.

ListOfTags differs from Conditions as follows:

  • When you specify more than one condition, you assign all resources that match AT LEAST ONE condition (using OR logic).
  • ListOfTags only supports StringEquals . Conditions supports StringEquals , StringLike , StringNotEquals , and StringNotLike .


587
588
589
# File 'backup/cfn_backup_selection.rb', line 587

def list_of_tags
  @list_of_tags
end

#not_resourcesArray<String>? (readonly)

A list of Amazon Resource Names (ARNs) to exclude from a backup plan.

The maximum number of ARNs is 500 without wildcards, or 30 ARNs with wildcards.

If you need to exclude many resources from a backup plan, consider a different resource selection strategy, such as assigning only one or a few resource types or refining your resource selection using tags.



596
597
598
# File 'backup/cfn_backup_selection.rb', line 596

def not_resources
  @not_resources
end

#resourcesArray<String>? (readonly)

An array of strings that contain Amazon Resource Names (ARNs) of resources to assign to a backup plan.



601
602
603
# File 'backup/cfn_backup_selection.rb', line 601

def resources
  @resources
end

#selection_nameString (readonly)

The display name of a resource selection document.



563
564
565
# File 'backup/cfn_backup_selection.rb', line 563

def selection_name
  @selection_name
end

Class Method Details

.jsii_propertiesObject



603
604
605
606
607
608
609
610
611
612
# File 'backup/cfn_backup_selection.rb', line 603

def self.jsii_properties
  {
    :iam_role_arn => "iamRoleArn",
    :selection_name => "selectionName",
    :conditions => "conditions",
    :list_of_tags => "listOfTags",
    :not_resources => "notResources",
    :resources => "resources",
  }
end

Instance Method Details

#to_jsiiObject



614
615
616
617
618
619
620
621
622
623
624
625
# File 'backup/cfn_backup_selection.rb', line 614

def to_jsii
  result = {}
  result.merge!({
    "iamRoleArn" => @iam_role_arn,
    "selectionName" => @selection_name,
    "conditions" => @conditions,
    "listOfTags" => @list_of_tags,
    "notResources" => @not_resources,
    "resources" => @resources,
  })
  result.compact
end