Class: AWSCDK::Backup::BackupSelectionProps

Inherits:
BackupSelectionOptions
  • Object
show all
Defined in:
backup/backup_selection_props.rb

Overview

Properties for a BackupSelection.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resources:, allow_restores: nil, backup_selection_name: nil, disable_default_backup_policy: nil, role: nil, backup_plan:) ⇒ BackupSelectionProps

Returns a new instance of BackupSelectionProps.

Parameters:

  • resources (Array<AWSCDK::Backup::BackupResource>)

    The resources to backup.

  • allow_restores (Boolean, nil) (defaults to: nil)

    Whether to automatically give restores permissions to the role that AWS Backup uses.

  • backup_selection_name (String, nil) (defaults to: nil)

    The name for this selection.

  • disable_default_backup_policy (Boolean, nil) (defaults to: nil)

    Whether to disable automatically assigning default backup permissions to the role that AWS Backup uses.

  • role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The role that AWS Backup uses to authenticate when backuping or restoring the resources.

  • backup_plan (AWSCDK::Interfaces::AWSBackup::IBackupPlanRef)

    The backup plan for this selection.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'backup/backup_selection_props.rb', line 13

def initialize(resources:, allow_restores: nil, backup_selection_name: nil, disable_default_backup_policy: nil, role: nil, backup_plan:)
  @resources = resources
  Jsii::Type.check_type(@resources, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iYWNrdXAuQmFja3VwUmVzb3VyY2UifSwia2luZCI6ImFycmF5In19")), "resources")
  @allow_restores = allow_restores
  Jsii::Type.check_type(@allow_restores, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "allowRestores") unless @allow_restores.nil?
  @backup_selection_name = backup_selection_name
  Jsii::Type.check_type(@backup_selection_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "backupSelectionName") unless @backup_selection_name.nil?
  @disable_default_backup_policy = disable_default_backup_policy
  Jsii::Type.check_type(@disable_default_backup_policy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "disableDefaultBackupPolicy") unless @disable_default_backup_policy.nil?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil?
  @backup_plan = backup_plan
  Jsii::Type.check_type(@backup_plan, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19iYWNrdXAuSUJhY2t1cFBsYW5SZWYifQ==")), "backupPlan")
end

Instance Attribute Details

#allow_restoresBoolean? (readonly)

Note:

Default: false

Whether to automatically give restores permissions to the role that AWS Backup uses.

If true, the AWSBackupServiceRolePolicyForRestores managed policy will be attached to the role.

Returns:

  • (Boolean, nil)


41
42
43
# File 'backup/backup_selection_props.rb', line 41

def allow_restores
  @allow_restores
end

#backup_planAWSCDK::Interfaces::AWSBackup::IBackupPlanRef (readonly)

The backup plan for this selection.



67
68
69
# File 'backup/backup_selection_props.rb', line 67

def backup_plan
  @backup_plan
end

#backup_selection_nameString? (readonly)

Note:

Default: - a CDK generated name

The name for this selection.

Returns:

  • (String, nil)


46
47
48
# File 'backup/backup_selection_props.rb', line 46

def backup_selection_name
  @backup_selection_name
end

#disable_default_backup_policyBoolean? (readonly)

Note:

Default: false

Whether to disable automatically assigning default backup permissions to the role that AWS Backup uses.

If false, the AWSBackupServiceRolePolicyForBackup managed policy will be attached to the role.

Returns:

  • (Boolean, nil)


54
55
56
# File 'backup/backup_selection_props.rb', line 54

def disable_default_backup_policy
  @disable_default_backup_policy
end

#resourcesArray<AWSCDK::Backup::BackupResource> (readonly)

The resources to backup.

Use the helper static methods defined on BackupResource.

Returns:



33
34
35
# File 'backup/backup_selection_props.rb', line 33

def resources
  @resources
end

#roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - a new role will be created

The role that AWS Backup uses to authenticate when backuping or restoring the resources.

The AWSBackupServiceRolePolicyForBackup managed policy will be attached to this role unless disable_default_backup_policy is set to true.

Returns:



63
64
65
# File 'backup/backup_selection_props.rb', line 63

def role
  @role
end

Class Method Details

.jsii_propertiesObject



69
70
71
72
73
74
75
76
77
78
# File 'backup/backup_selection_props.rb', line 69

def self.jsii_properties
  {
    :resources => "resources",
    :allow_restores => "allowRestores",
    :backup_selection_name => "backupSelectionName",
    :disable_default_backup_policy => "disableDefaultBackupPolicy",
    :role => "role",
    :backup_plan => "backupPlan",
  }
end

Instance Method Details

#to_jsiiObject



80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'backup/backup_selection_props.rb', line 80

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "resources" => @resources,
    "allowRestores" => @allow_restores,
    "backupSelectionName" => @backup_selection_name,
    "disableDefaultBackupPolicy" => @disable_default_backup_policy,
    "role" => @role,
    "backupPlan" => @backup_plan,
  })
  result.compact
end