oci.Database.Backup
Explore with Pulumi AI
This resource provides the Backup resource in Oracle Cloud Infrastructure Database service.
Creates a new backup in the specified database based on the request parameters you provide. If you previously used RMAN or dbcli to configure backups and then you switch to using the Console or the API for backups, a new backup configuration is created and associated with your database. This means that you can no longer rely on your previously configured unmanaged backups to work.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testBackup = new oci.database.Backup("test_backup", {
databaseId: testDatabase.id,
displayName: backupDisplayName,
});
import pulumi
import pulumi_oci as oci
test_backup = oci.database.Backup("test_backup",
database_id=test_database["id"],
display_name=backup_display_name)
package main
import (
"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/Database"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := Database.NewBackup(ctx, "test_backup", &Database.BackupArgs{
DatabaseId: pulumi.Any(testDatabase.Id),
DisplayName: pulumi.Any(backupDisplayName),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() =>
{
var testBackup = new Oci.Database.Backup("test_backup", new()
{
DatabaseId = testDatabase.Id,
DisplayName = backupDisplayName,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Database.Backup;
import com.pulumi.oci.Database.BackupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var testBackup = new Backup("testBackup", BackupArgs.builder()
.databaseId(testDatabase.id())
.displayName(backupDisplayName)
.build());
}
}
resources:
testBackup:
type: oci:Database:Backup
name: test_backup
properties:
databaseId: ${testDatabase.id}
displayName: ${backupDisplayName}
Create Backup Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Backup(name: string, args: BackupArgs, opts?: CustomResourceOptions);
@overload
def Backup(resource_name: str,
args: BackupArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Backup(resource_name: str,
opts: Optional[ResourceOptions] = None,
database_id: Optional[str] = None,
display_name: Optional[str] = None)
func NewBackup(ctx *Context, name string, args BackupArgs, opts ...ResourceOption) (*Backup, error)
public Backup(string name, BackupArgs args, CustomResourceOptions? opts = null)
public Backup(String name, BackupArgs args)
public Backup(String name, BackupArgs args, CustomResourceOptions options)
type: oci:Database:Backup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args BackupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args BackupArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args BackupArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BackupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BackupArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var backupResource = new Oci.Database.Backup("backupResource", new()
{
DatabaseId = "string",
DisplayName = "string",
});
example, err := Database.NewBackup(ctx, "backupResource", &Database.BackupArgs{
DatabaseId: pulumi.String("string"),
DisplayName: pulumi.String("string"),
})
var backupResource = new Backup("backupResource", BackupArgs.builder()
.databaseId("string")
.displayName("string")
.build());
backup_resource = oci.database.Backup("backupResource",
database_id="string",
display_name="string")
const backupResource = new oci.database.Backup("backupResource", {
databaseId: "string",
displayName: "string",
});
type: oci:Database:Backup
properties:
databaseId: string
displayName: string
Backup Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Backup resource accepts the following input properties:
- Database
Id string - The OCID of the database.
- Display
Name string The user-friendly name for the backup. The name does not have to be unique.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- Database
Id string - The OCID of the database.
- Display
Name string The user-friendly name for the backup. The name does not have to be unique.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- database
Id String - The OCID of the database.
- display
Name String The user-friendly name for the backup. The name does not have to be unique.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- database
Id string - The OCID of the database.
- display
Name string The user-friendly name for the backup. The name does not have to be unique.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- database_
id str - The OCID of the database.
- display_
name str The user-friendly name for the backup. The name does not have to be unique.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- database
Id String - The OCID of the database.
- display
Name String The user-friendly name for the backup. The name does not have to be unique.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
Outputs
All input properties are implicitly available as output properties. Additionally, the Backup resource produces the following output properties:
- Availability
Domain string - The name of the availability domain where the database backup is stored.
- Compartment
Id string - The OCID of the compartment.
- Database
Edition string - The Oracle Database edition of the DB system from which the database backup was taken.
- Database
Size doubleIn Gbs - The size of the database in gigabytes at the time the backup was taken.
- Id string
- The provider-assigned unique ID for this managed resource.
- Key
Store stringId - The OCID of the key store.
- Key
Store stringWallet Name - The wallet name for Oracle Key Vault.
- Kms
Key stringId - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
- Kms
Key stringVersion Id - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation.
- Lifecycle
Details string - Additional information about the current lifecycle state.
- Shape string
- Shape of the backup's source database.
- State string
- The current state of the backup.
- Time
Ended string - The date and time the backup was completed.
- Time
Started string - The date and time the backup started.
- Type string
- The type of backup.
- Vault
Id string - The OCID of the Oracle Cloud Infrastructure vault.
- Version string
- Version of the backup's source database
- Availability
Domain string - The name of the availability domain where the database backup is stored.
- Compartment
Id string - The OCID of the compartment.
- Database
Edition string - The Oracle Database edition of the DB system from which the database backup was taken.
- Database
Size float64In Gbs - The size of the database in gigabytes at the time the backup was taken.
- Id string
- The provider-assigned unique ID for this managed resource.
- Key
Store stringId - The OCID of the key store.
- Key
Store stringWallet Name - The wallet name for Oracle Key Vault.
- Kms
Key stringId - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
- Kms
Key stringVersion Id - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation.
- Lifecycle
Details string - Additional information about the current lifecycle state.
- Shape string
- Shape of the backup's source database.
- State string
- The current state of the backup.
- Time
Ended string - The date and time the backup was completed.
- Time
Started string - The date and time the backup started.
- Type string
- The type of backup.
- Vault
Id string - The OCID of the Oracle Cloud Infrastructure vault.
- Version string
- Version of the backup's source database
- availability
Domain String - The name of the availability domain where the database backup is stored.
- compartment
Id String - The OCID of the compartment.
- database
Edition String - The Oracle Database edition of the DB system from which the database backup was taken.
- database
Size DoubleIn Gbs - The size of the database in gigabytes at the time the backup was taken.
- id String
- The provider-assigned unique ID for this managed resource.
- key
Store StringId - The OCID of the key store.
- key
Store StringWallet Name - The wallet name for Oracle Key Vault.
- kms
Key StringId - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
- kms
Key StringVersion Id - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation.
- lifecycle
Details String - Additional information about the current lifecycle state.
- shape String
- Shape of the backup's source database.
- state String
- The current state of the backup.
- time
Ended String - The date and time the backup was completed.
- time
Started String - The date and time the backup started.
- type String
- The type of backup.
- vault
Id String - The OCID of the Oracle Cloud Infrastructure vault.
- version String
- Version of the backup's source database
- availability
Domain string - The name of the availability domain where the database backup is stored.
- compartment
Id string - The OCID of the compartment.
- database
Edition string - The Oracle Database edition of the DB system from which the database backup was taken.
- database
Size numberIn Gbs - The size of the database in gigabytes at the time the backup was taken.
- id string
- The provider-assigned unique ID for this managed resource.
- key
Store stringId - The OCID of the key store.
- key
Store stringWallet Name - The wallet name for Oracle Key Vault.
- kms
Key stringId - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
- kms
Key stringVersion Id - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation.
- lifecycle
Details string - Additional information about the current lifecycle state.
- shape string
- Shape of the backup's source database.
- state string
- The current state of the backup.
- time
Ended string - The date and time the backup was completed.
- time
Started string - The date and time the backup started.
- type string
- The type of backup.
- vault
Id string - The OCID of the Oracle Cloud Infrastructure vault.
- version string
- Version of the backup's source database
- availability_
domain str - The name of the availability domain where the database backup is stored.
- compartment_
id str - The OCID of the compartment.
- database_
edition str - The Oracle Database edition of the DB system from which the database backup was taken.
- database_
size_ floatin_ gbs - The size of the database in gigabytes at the time the backup was taken.
- id str
- The provider-assigned unique ID for this managed resource.
- key_
store_ strid - The OCID of the key store.
- key_
store_ strwallet_ name - The wallet name for Oracle Key Vault.
- kms_
key_ strid - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
- kms_
key_ strversion_ id - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation.
- lifecycle_
details str - Additional information about the current lifecycle state.
- shape str
- Shape of the backup's source database.
- state str
- The current state of the backup.
- time_
ended str - The date and time the backup was completed.
- time_
started str - The date and time the backup started.
- type str
- The type of backup.
- vault_
id str - The OCID of the Oracle Cloud Infrastructure vault.
- version str
- Version of the backup's source database
- availability
Domain String - The name of the availability domain where the database backup is stored.
- compartment
Id String - The OCID of the compartment.
- database
Edition String - The Oracle Database edition of the DB system from which the database backup was taken.
- database
Size NumberIn Gbs - The size of the database in gigabytes at the time the backup was taken.
- id String
- The provider-assigned unique ID for this managed resource.
- key
Store StringId - The OCID of the key store.
- key
Store StringWallet Name - The wallet name for Oracle Key Vault.
- kms
Key StringId - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
- kms
Key StringVersion Id - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation.
- lifecycle
Details String - Additional information about the current lifecycle state.
- shape String
- Shape of the backup's source database.
- state String
- The current state of the backup.
- time
Ended String - The date and time the backup was completed.
- time
Started String - The date and time the backup started.
- type String
- The type of backup.
- vault
Id String - The OCID of the Oracle Cloud Infrastructure vault.
- version String
- Version of the backup's source database
Look up Existing Backup Resource
Get an existing Backup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: BackupState, opts?: CustomResourceOptions): Backup
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
availability_domain: Optional[str] = None,
compartment_id: Optional[str] = None,
database_edition: Optional[str] = None,
database_id: Optional[str] = None,
database_size_in_gbs: Optional[float] = None,
display_name: Optional[str] = None,
key_store_id: Optional[str] = None,
key_store_wallet_name: Optional[str] = None,
kms_key_id: Optional[str] = None,
kms_key_version_id: Optional[str] = None,
lifecycle_details: Optional[str] = None,
shape: Optional[str] = None,
state: Optional[str] = None,
time_ended: Optional[str] = None,
time_started: Optional[str] = None,
type: Optional[str] = None,
vault_id: Optional[str] = None,
version: Optional[str] = None) -> Backup
func GetBackup(ctx *Context, name string, id IDInput, state *BackupState, opts ...ResourceOption) (*Backup, error)
public static Backup Get(string name, Input<string> id, BackupState? state, CustomResourceOptions? opts = null)
public static Backup get(String name, Output<String> id, BackupState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Availability
Domain string - The name of the availability domain where the database backup is stored.
- Compartment
Id string - The OCID of the compartment.
- Database
Edition string - The Oracle Database edition of the DB system from which the database backup was taken.
- Database
Id string - The OCID of the database.
- Database
Size doubleIn Gbs - The size of the database in gigabytes at the time the backup was taken.
- Display
Name string The user-friendly name for the backup. The name does not have to be unique.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- Key
Store stringId - The OCID of the key store.
- Key
Store stringWallet Name - The wallet name for Oracle Key Vault.
- Kms
Key stringId - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
- Kms
Key stringVersion Id - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation.
- Lifecycle
Details string - Additional information about the current lifecycle state.
- Shape string
- Shape of the backup's source database.
- State string
- The current state of the backup.
- Time
Ended string - The date and time the backup was completed.
- Time
Started string - The date and time the backup started.
- Type string
- The type of backup.
- Vault
Id string - The OCID of the Oracle Cloud Infrastructure vault.
- Version string
- Version of the backup's source database
- Availability
Domain string - The name of the availability domain where the database backup is stored.
- Compartment
Id string - The OCID of the compartment.
- Database
Edition string - The Oracle Database edition of the DB system from which the database backup was taken.
- Database
Id string - The OCID of the database.
- Database
Size float64In Gbs - The size of the database in gigabytes at the time the backup was taken.
- Display
Name string The user-friendly name for the backup. The name does not have to be unique.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- Key
Store stringId - The OCID of the key store.
- Key
Store stringWallet Name - The wallet name for Oracle Key Vault.
- Kms
Key stringId - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
- Kms
Key stringVersion Id - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation.
- Lifecycle
Details string - Additional information about the current lifecycle state.
- Shape string
- Shape of the backup's source database.
- State string
- The current state of the backup.
- Time
Ended string - The date and time the backup was completed.
- Time
Started string - The date and time the backup started.
- Type string
- The type of backup.
- Vault
Id string - The OCID of the Oracle Cloud Infrastructure vault.
- Version string
- Version of the backup's source database
- availability
Domain String - The name of the availability domain where the database backup is stored.
- compartment
Id String - The OCID of the compartment.
- database
Edition String - The Oracle Database edition of the DB system from which the database backup was taken.
- database
Id String - The OCID of the database.
- database
Size DoubleIn Gbs - The size of the database in gigabytes at the time the backup was taken.
- display
Name String The user-friendly name for the backup. The name does not have to be unique.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- key
Store StringId - The OCID of the key store.
- key
Store StringWallet Name - The wallet name for Oracle Key Vault.
- kms
Key StringId - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
- kms
Key StringVersion Id - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation.
- lifecycle
Details String - Additional information about the current lifecycle state.
- shape String
- Shape of the backup's source database.
- state String
- The current state of the backup.
- time
Ended String - The date and time the backup was completed.
- time
Started String - The date and time the backup started.
- type String
- The type of backup.
- vault
Id String - The OCID of the Oracle Cloud Infrastructure vault.
- version String
- Version of the backup's source database
- availability
Domain string - The name of the availability domain where the database backup is stored.
- compartment
Id string - The OCID of the compartment.
- database
Edition string - The Oracle Database edition of the DB system from which the database backup was taken.
- database
Id string - The OCID of the database.
- database
Size numberIn Gbs - The size of the database in gigabytes at the time the backup was taken.
- display
Name string The user-friendly name for the backup. The name does not have to be unique.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- key
Store stringId - The OCID of the key store.
- key
Store stringWallet Name - The wallet name for Oracle Key Vault.
- kms
Key stringId - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
- kms
Key stringVersion Id - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation.
- lifecycle
Details string - Additional information about the current lifecycle state.
- shape string
- Shape of the backup's source database.
- state string
- The current state of the backup.
- time
Ended string - The date and time the backup was completed.
- time
Started string - The date and time the backup started.
- type string
- The type of backup.
- vault
Id string - The OCID of the Oracle Cloud Infrastructure vault.
- version string
- Version of the backup's source database
- availability_
domain str - The name of the availability domain where the database backup is stored.
- compartment_
id str - The OCID of the compartment.
- database_
edition str - The Oracle Database edition of the DB system from which the database backup was taken.
- database_
id str - The OCID of the database.
- database_
size_ floatin_ gbs - The size of the database in gigabytes at the time the backup was taken.
- display_
name str The user-friendly name for the backup. The name does not have to be unique.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- key_
store_ strid - The OCID of the key store.
- key_
store_ strwallet_ name - The wallet name for Oracle Key Vault.
- kms_
key_ strid - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
- kms_
key_ strversion_ id - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation.
- lifecycle_
details str - Additional information about the current lifecycle state.
- shape str
- Shape of the backup's source database.
- state str
- The current state of the backup.
- time_
ended str - The date and time the backup was completed.
- time_
started str - The date and time the backup started.
- type str
- The type of backup.
- vault_
id str - The OCID of the Oracle Cloud Infrastructure vault.
- version str
- Version of the backup's source database
- availability
Domain String - The name of the availability domain where the database backup is stored.
- compartment
Id String - The OCID of the compartment.
- database
Edition String - The Oracle Database edition of the DB system from which the database backup was taken.
- database
Id String - The OCID of the database.
- database
Size NumberIn Gbs - The size of the database in gigabytes at the time the backup was taken.
- display
Name String The user-friendly name for the backup. The name does not have to be unique.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- key
Store StringId - The OCID of the key store.
- key
Store StringWallet Name - The wallet name for Oracle Key Vault.
- kms
Key StringId - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
- kms
Key StringVersion Id - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation.
- lifecycle
Details String - Additional information about the current lifecycle state.
- shape String
- Shape of the backup's source database.
- state String
- The current state of the backup.
- time
Ended String - The date and time the backup was completed.
- time
Started String - The date and time the backup started.
- type String
- The type of backup.
- vault
Id String - The OCID of the Oracle Cloud Infrastructure vault.
- version String
- Version of the backup's source database
Import
Backups can be imported using the id
, e.g.
$ pulumi import oci:Database/backup:Backup test_backup "id"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
oci
Terraform Provider.