Class: AWSCDK::Backup::BackupSelectionOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Backup::BackupSelectionOptions
- Defined in:
- backup/backup_selection_options.rb
Overview
Options for a BackupSelection.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#allow_restores ⇒ Boolean?
readonly
Whether to automatically give restores permissions to the role that AWS Backup uses.
-
#backup_selection_name ⇒ String?
readonly
The name for this selection.
-
#disable_default_backup_policy ⇒ Boolean?
readonly
Whether to disable automatically assigning default backup permissions to the role that AWS Backup uses.
-
#resources ⇒ Array<AWSCDK::Backup::BackupResource>
readonly
The resources to backup.
-
#role ⇒ AWSCDK::IAM::IRole?
readonly
The role that AWS Backup uses to authenticate when backuping or restoring the resources.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(resources:, allow_restores: nil, backup_selection_name: nil, disable_default_backup_policy: nil, role: nil) ⇒ BackupSelectionOptions
constructor
A new instance of BackupSelectionOptions.
- #to_jsii ⇒ Object
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.
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_restores ⇒ Boolean? (readonly)
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.
38 39 40 |
# File 'backup/backup_selection_options.rb', line 38 def allow_restores @allow_restores end |
#backup_selection_name ⇒ String? (readonly)
Default: - a CDK generated name
The name for this selection.
43 44 45 |
# File 'backup/backup_selection_options.rb', line 43 def backup_selection_name @backup_selection_name end |
#disable_default_backup_policy ⇒ Boolean? (readonly)
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.
51 52 53 |
# File 'backup/backup_selection_options.rb', line 51 def disable_default_backup_policy @disable_default_backup_policy end |
#resources ⇒ Array<AWSCDK::Backup::BackupResource> (readonly)
The resources to backup.
Use the helper static methods defined on BackupResource.
30 31 32 |
# File 'backup/backup_selection_options.rb', line 30 def resources @resources end |
#role ⇒ AWSCDK::IAM::IRole? (readonly)
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.
60 61 62 |
# File 'backup/backup_selection_options.rb', line 60 def role @role end |
Class Method Details
.jsii_properties ⇒ Object
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_jsii ⇒ Object
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 |