BackupVault
- class aws_cdk.aws_backup.BackupVault(scope, id, *, access_policy=None, backup_vault_name=None, block_recovery_point_deletion=None, encryption_key=None, notification_events=None, notification_topic=None, removal_policy=None)
Bases:
Resource
A backup vault.
- ExampleMetadata:
infused
Example:
imported_vault = backup.BackupVault.from_backup_vault_name(self, "Vault", "myVaultName") role = iam.Role(self, "Access Role", assumed_by=iam.ServicePrincipal("lambda.amazonaws.com")) imported_vault.grant(role, "backup:StartBackupJob")
- Parameters:
scope (
Construct
)id (
str
)access_policy (
Optional
[PolicyDocument
]) – A resource-based policy that is used to manage access permissions on the backup vault. Default: - access is not restrictedbackup_vault_name (
Optional
[str
]) – 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. Default: - A CDK generated nameblock_recovery_point_deletion (
Optional
[bool
]) – Whether to add statements to the vault access policy that prevents anyone from deleting a recovery point. Default: falseencryption_key (
Optional
[IKey
]) – The server-side encryption key to use to protect your backups. Default: - an Amazon managed KMS keynotification_events (
Optional
[Sequence
[BackupVaultEvents
]]) – The vault events to send. Default: - all vault events ifnotificationTopic
is definednotification_topic (
Optional
[ITopic
]) – A SNS topic to send vault events to. Default: - no notificationsremoval_policy (
Optional
[RemovalPolicy
]) – The removal policy to apply to the vault. Note that removing a vault that contains recovery points will fail. Default: RemovalPolicy.RETAIN
Methods
- add_to_access_policy(statement)
Adds a statement to the vault access policy.
- Parameters:
statement (
PolicyStatement
)- Return type:
None
- apply_removal_policy(policy)
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
).- Parameters:
policy (
RemovalPolicy
)- Return type:
None
- block_recovery_point_deletion()
Adds a statement to the vault access policy that prevents anyone from deleting a recovery point.
- Return type:
None
- grant(grantee, *actions)
Grant the actions defined in actions to the given grantee on this Backup Vault resource.
- Parameters:
grantee (
IGrantable
) – Principal to grant right to.actions (
str
) – The actions to grant.
- Return type:
- to_string()
Returns a string representation of this construct.
- Return type:
str
Attributes
- backup_vault_arn
The ARN of the backup vault.
- backup_vault_name
The name of a logical container where backups are stored.
- env
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
- node
The construct tree node associated with this construct.
- stack
The stack in which this resource is defined.
Static Methods
- classmethod from_backup_vault_arn(scope, id, backup_vault_arn)
Import an existing backup vault by arn.
- Parameters:
scope (
Construct
)id (
str
)backup_vault_arn (
str
)
- Return type:
- classmethod from_backup_vault_name(scope, id, backup_vault_name)
Import an existing backup vault by name.
- Parameters:
scope (
Construct
)id (
str
)backup_vault_name (
str
)
- Return type:
- classmethod is_construct(x)
Return whether the given object is a Construct.
- Parameters:
x (
Any
)- Return type:
bool
- classmethod is_resource(construct)
Check whether the given construct is a Resource.
- Parameters:
construct (
IConstruct
)- Return type:
bool