Class: AWSCDK::Backup::BackupSelectionOptions

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

Overview

Options for a BackupSelection.

Direct Known Subclasses

BackupSelectionProps

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) ⇒ BackupSelectionOptions

Returns a new instance of BackupSelectionOptions.

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.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'backup/backup_selection_options.rb', line 12

def initialize(resources:, allow_restores: nil, backup_selection_name: nil, disable_default_backup_policy: nil, role: nil)
  @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?
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)


38
39
40
# File 'backup/backup_selection_options.rb', line 38

def allow_restores
  @allow_restores
end

#backup_selection_nameString? (readonly)

Note:

Default: - a CDK generated name

The name for this selection.

Returns:

  • (String, nil)


43
44
45
# File 'backup/backup_selection_options.rb', line 43

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)


51
52
53
# File 'backup/backup_selection_options.rb', line 51

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:



30
31
32
# File 'backup/backup_selection_options.rb', line 30

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:



60
61
62
# File 'backup/backup_selection_options.rb', line 60

def role
  @role
end

Class Method Details

.jsii_propertiesObject



62
63
64
65
66
67
68
69
70
# File 'backup/backup_selection_options.rb', line 62

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

Instance Method Details

#to_jsiiObject



72
73
74
75
76
77
78
79
80
81
82
# File 'backup/backup_selection_options.rb', line 72

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