Class: AWSCDK::Backup::BackupVaultProps

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

Overview

Properties for a BackupVault.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_policy: nil, backup_vault_name: nil, block_recovery_point_deletion: nil, encryption_key: nil, lock_configuration: nil, notification_events: nil, notification_topic: nil, removal_policy: nil) ⇒ BackupVaultProps

Returns a new instance of BackupVaultProps.

Parameters:

  • access_policy (AWSCDK::IAM::PolicyDocument, nil) (defaults to: nil)

    A resource-based policy that is used to manage access permissions on the backup vault.

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

    The name of a logical container where backups are stored.

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

    Whether to add statements to the vault access policy that prevents anyone from deleting a recovery point.

  • encryption_key (AWSCDK::Interfaces::AWSKMS::IKeyRef, nil) (defaults to: nil)

    The server-side encryption key to use to protect your backups.

  • lock_configuration (AWSCDK::Backup::LockConfiguration, nil) (defaults to: nil)

    Configuration for AWS Backup Vault Lock.

  • notification_events (Array<AWSCDK::Backup::BackupVaultEvents>, nil) (defaults to: nil)

    The vault events to send.

  • notification_topic (AWSCDK::SNS::ITopic, nil) (defaults to: nil)

    A SNS topic to send vault events to.

  • removal_policy (AWSCDK::RemovalPolicy, nil) (defaults to: nil)

    The removal policy to apply to the vault.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'backup/backup_vault_props.rb', line 15

def initialize(access_policy: nil, backup_vault_name: nil, block_recovery_point_deletion: nil, encryption_key: nil, lock_configuration: nil, notification_events: nil, notification_topic: nil, removal_policy: nil)
  @access_policy = access_policy
  Jsii::Type.check_type(@access_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeURvY3VtZW50In0=")), "accessPolicy") unless @access_policy.nil?
  @backup_vault_name = backup_vault_name
  Jsii::Type.check_type(@backup_vault_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "backupVaultName") unless @backup_vault_name.nil?
  @block_recovery_point_deletion = block_recovery_point_deletion
  Jsii::Type.check_type(@block_recovery_point_deletion, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "blockRecoveryPointDeletion") unless @block_recovery_point_deletion.nil?
  @encryption_key = encryption_key
  Jsii::Type.check_type(@encryption_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19rbXMuSUtleVJlZiJ9")), "encryptionKey") unless @encryption_key.nil?
  @lock_configuration = lock_configuration.is_a?(Hash) ? ::AWSCDK::Backup::LockConfiguration.new(**lock_configuration.transform_keys(&:to_sym)) : lock_configuration
  Jsii::Type.check_type(@lock_configuration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmFja3VwLkxvY2tDb25maWd1cmF0aW9uIn0=")), "lockConfiguration") unless @lock_configuration.nil?
  @notification_events = notification_events
  Jsii::Type.check_type(@notification_events, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iYWNrdXAuQmFja3VwVmF1bHRFdmVudHMifSwia2luZCI6ImFycmF5In19")), "notificationEvents") unless @notification_events.nil?
  @notification_topic = notification_topic
  Jsii::Type.check_type(@notification_topic, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc25zLklUb3BpYyJ9")), "notificationTopic") unless @notification_topic.nil?
  @removal_policy = removal_policy
  Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil?
end

Instance Attribute Details

#access_policyAWSCDK::IAM::PolicyDocument? (readonly)

Note:

Default: - access is not restricted

A resource-based policy that is used to manage access permissions on the backup vault.

Returns:



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

def access_policy
  @access_policy
end

#backup_vault_nameString? (readonly)

Note:

Default: - A CDK generated name

The name of a logical container where backups are stored.

Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created.

Returns:

  • (String, nil)


47
48
49
# File 'backup/backup_vault_props.rb', line 47

def backup_vault_name
  @backup_vault_name
end

#block_recovery_point_deletionBoolean? (readonly)

Note:

Default: false

Whether to add statements to the vault access policy that prevents anyone from deleting a recovery point.

Returns:

  • (Boolean, nil)


52
53
54
# File 'backup/backup_vault_props.rb', line 52

def block_recovery_point_deletion
  @block_recovery_point_deletion
end

#encryption_keyAWSCDK::Interfaces::AWSKMS::IKeyRef? (readonly)

Note:

Default: - an Amazon managed KMS key

The server-side encryption key to use to protect your backups.



57
58
59
# File 'backup/backup_vault_props.rb', line 57

def encryption_key
  @encryption_key
end

#lock_configurationAWSCDK::Backup::LockConfiguration? (readonly)

Note:

Default: - AWS Backup Vault Lock is disabled

Configuration for AWS Backup Vault Lock.



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

def lock_configuration
  @lock_configuration
end

#notification_eventsArray<AWSCDK::Backup::BackupVaultEvents>? (readonly)

Note:

Default: - all vault events if notificationTopic is defined

The vault events to send.



69
70
71
# File 'backup/backup_vault_props.rb', line 69

def notification_events
  @notification_events
end

#notification_topicAWSCDK::SNS::ITopic? (readonly)

Note:

Default: - no notifications

A SNS topic to send vault events to.



75
76
77
# File 'backup/backup_vault_props.rb', line 75

def notification_topic
  @notification_topic
end

#removal_policyAWSCDK::RemovalPolicy? (readonly)

Note:

Default: RemovalPolicy.RETAIN

The removal policy to apply to the vault.

Note that removing a vault that contains recovery points will fail.

Returns:



83
84
85
# File 'backup/backup_vault_props.rb', line 83

def removal_policy
  @removal_policy
end

Class Method Details

.jsii_propertiesObject



85
86
87
88
89
90
91
92
93
94
95
96
# File 'backup/backup_vault_props.rb', line 85

def self.jsii_properties
  {
    :access_policy => "accessPolicy",
    :backup_vault_name => "backupVaultName",
    :block_recovery_point_deletion => "blockRecoveryPointDeletion",
    :encryption_key => "encryptionKey",
    :lock_configuration => "lockConfiguration",
    :notification_events => "notificationEvents",
    :notification_topic => "notificationTopic",
    :removal_policy => "removalPolicy",
  }
end

Instance Method Details

#to_jsiiObject



98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'backup/backup_vault_props.rb', line 98

def to_jsii
  result = {}
  result.merge!({
    "accessPolicy" => @access_policy,
    "backupVaultName" => @backup_vault_name,
    "blockRecoveryPointDeletion" => @block_recovery_point_deletion,
    "encryptionKey" => @encryption_key,
    "lockConfiguration" => @lock_configuration,
    "notificationEvents" => @notification_events,
    "notificationTopic" => @notification_topic,
    "removalPolicy" => @removal_policy,
  })
  result.compact
end