ibm.CosBackupPolicy
Explore with Pulumi AI
Creates a backup policy on a given source bucket.
Note:
The source bucket must have object versioning enabled.
Note:
Backup policies require a service-to-service IAM policy granting sync permissions from the source to the target bucket. Adding a depends_on
for ibm_iam_authorization_policy.policy
ensures that this policy is in place.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const cosGroup = ibm.getResourceGroup({
name: "cos-resource-group",
});
const backup_source_bucket = new ibm.CosBucket("backup-source-bucket", {
bucketName: "bucket-name",
resourceInstanceId: "cos_instance_id",
crossRegionLocation: "us",
storageClass: "standard",
objectVersioning: {
enable: true,
},
});
const backup_vault = new ibm.CosBackupVault("backup-vault", {
backupVaultName: "backup_vault_name",
serviceInstanceId: "cos_instance_id to create backup vault",
region: "us",
activityTrackingManagementEvents: true,
metricsMonitoringUsageMetrics: true,
kmsKeyCrn: "crn:v1:staging:public:kms:us-south:a/997xxxxxxxxxxxxxxxxxxxxxx54:5xxxxxxxa-fxxb-4xx8-9xx4-f1xxxxxxxxx5:key:af5667d5-dxx5-4xxf-8xxf-exxxxxxxf1d",
});
const policyIamAuthorizationPolicy = new ibm.IamAuthorizationPolicy("policyIamAuthorizationPolicy", {
roles: [
"Backup Manager",
"Writer",
"Manager",
],
subjectAttributes: [
{
name: "accountId",
value: "account_id of the cos account",
},
{
name: "serviceName",
value: "cloud-object-storage",
},
{
name: "serviceInstance",
value: "exxxxx34-xxxx-xxxx-xxxx-d6xxxxxxxx9",
},
{
name: "resource",
value: "source-bucket-name",
},
{
name: "resourceType",
value: "bucket",
},
],
resourceAttributes: [
{
name: "accountId",
operator: "stringEquals",
value: "account id of the cos account of backup vault",
},
{
name: "serviceName",
operator: "stringEquals",
value: "cloud-object-storage",
},
{
name: "serviceInstance",
operator: "stringEquals",
value: "exxxxx34-xxxx-xxxx-xxxx-d6xxxxxxxx9",
},
{
name: "resource",
operator: "stringEquals",
value: "backup-vault-name",
},
{
name: "resourceType",
operator: "stringEquals",
value: "backup-vault",
},
],
});
const policyCosBackupPolicy = new ibm.CosBackupPolicy("policyCosBackupPolicy", {
bucketCrn: ibm_cos_bucket.bucket.crn,
initialDeleteAfterDays: 2,
policyName: "policy_name",
targetBackupVaultCrn: backup_vault.backupVaultCrn,
backupType: "continuous",
});
import pulumi
import pulumi_ibm as ibm
cos_group = ibm.get_resource_group(name="cos-resource-group")
backup_source_bucket = ibm.CosBucket("backup-source-bucket",
bucket_name="bucket-name",
resource_instance_id="cos_instance_id",
cross_region_location="us",
storage_class="standard",
object_versioning={
"enable": True,
})
backup_vault = ibm.CosBackupVault("backup-vault",
backup_vault_name="backup_vault_name",
service_instance_id="cos_instance_id to create backup vault",
region="us",
activity_tracking_management_events=True,
metrics_monitoring_usage_metrics=True,
kms_key_crn="crn:v1:staging:public:kms:us-south:a/997xxxxxxxxxxxxxxxxxxxxxx54:5xxxxxxxa-fxxb-4xx8-9xx4-f1xxxxxxxxx5:key:af5667d5-dxx5-4xxf-8xxf-exxxxxxxf1d")
policy_iam_authorization_policy = ibm.IamAuthorizationPolicy("policyIamAuthorizationPolicy",
roles=[
"Backup Manager",
"Writer",
"Manager",
],
subject_attributes=[
{
"name": "accountId",
"value": "account_id of the cos account",
},
{
"name": "serviceName",
"value": "cloud-object-storage",
},
{
"name": "serviceInstance",
"value": "exxxxx34-xxxx-xxxx-xxxx-d6xxxxxxxx9",
},
{
"name": "resource",
"value": "source-bucket-name",
},
{
"name": "resourceType",
"value": "bucket",
},
],
resource_attributes=[
{
"name": "accountId",
"operator": "stringEquals",
"value": "account id of the cos account of backup vault",
},
{
"name": "serviceName",
"operator": "stringEquals",
"value": "cloud-object-storage",
},
{
"name": "serviceInstance",
"operator": "stringEquals",
"value": "exxxxx34-xxxx-xxxx-xxxx-d6xxxxxxxx9",
},
{
"name": "resource",
"operator": "stringEquals",
"value": "backup-vault-name",
},
{
"name": "resourceType",
"operator": "stringEquals",
"value": "backup-vault",
},
])
policy_cos_backup_policy = ibm.CosBackupPolicy("policyCosBackupPolicy",
bucket_crn=ibm_cos_bucket["bucket"]["crn"],
initial_delete_after_days=2,
policy_name="policy_name",
target_backup_vault_crn=backup_vault.backup_vault_crn,
backup_type="continuous")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ibm.LookupResourceGroup(ctx, &ibm.LookupResourceGroupArgs{
Name: pulumi.StringRef("cos-resource-group"),
}, nil)
if err != nil {
return err
}
_, err = ibm.NewCosBucket(ctx, "backup-source-bucket", &ibm.CosBucketArgs{
BucketName: pulumi.String("bucket-name"),
ResourceInstanceId: pulumi.String("cos_instance_id"),
CrossRegionLocation: pulumi.String("us"),
StorageClass: pulumi.String("standard"),
ObjectVersioning: &ibm.CosBucketObjectVersioningArgs{
Enable: pulumi.Bool(true),
},
})
if err != nil {
return err
}
backup_vault, err := ibm.NewCosBackupVault(ctx, "backup-vault", &ibm.CosBackupVaultArgs{
BackupVaultName: pulumi.String("backup_vault_name"),
ServiceInstanceId: pulumi.String("cos_instance_id to create backup vault"),
Region: pulumi.String("us"),
ActivityTrackingManagementEvents: pulumi.Bool(true),
MetricsMonitoringUsageMetrics: pulumi.Bool(true),
KmsKeyCrn: pulumi.String("crn:v1:staging:public:kms:us-south:a/997xxxxxxxxxxxxxxxxxxxxxx54:5xxxxxxxa-fxxb-4xx8-9xx4-f1xxxxxxxxx5:key:af5667d5-dxx5-4xxf-8xxf-exxxxxxxf1d"),
})
if err != nil {
return err
}
_, err = ibm.NewIamAuthorizationPolicy(ctx, "policyIamAuthorizationPolicy", &ibm.IamAuthorizationPolicyArgs{
Roles: pulumi.StringArray{
pulumi.String("Backup Manager"),
pulumi.String("Writer"),
pulumi.String("Manager"),
},
SubjectAttributes: ibm.IamAuthorizationPolicySubjectAttributeArray{
&ibm.IamAuthorizationPolicySubjectAttributeArgs{
Name: pulumi.String("accountId"),
Value: pulumi.String("account_id of the cos account"),
},
&ibm.IamAuthorizationPolicySubjectAttributeArgs{
Name: pulumi.String("serviceName"),
Value: pulumi.String("cloud-object-storage"),
},
&ibm.IamAuthorizationPolicySubjectAttributeArgs{
Name: pulumi.String("serviceInstance"),
Value: pulumi.String("exxxxx34-xxxx-xxxx-xxxx-d6xxxxxxxx9"),
},
&ibm.IamAuthorizationPolicySubjectAttributeArgs{
Name: pulumi.String("resource"),
Value: pulumi.String("source-bucket-name"),
},
&ibm.IamAuthorizationPolicySubjectAttributeArgs{
Name: pulumi.String("resourceType"),
Value: pulumi.String("bucket"),
},
},
ResourceAttributes: ibm.IamAuthorizationPolicyResourceAttributeArray{
&ibm.IamAuthorizationPolicyResourceAttributeArgs{
Name: pulumi.String("accountId"),
Operator: pulumi.String("stringEquals"),
Value: pulumi.String("account id of the cos account of backup vault"),
},
&ibm.IamAuthorizationPolicyResourceAttributeArgs{
Name: pulumi.String("serviceName"),
Operator: pulumi.String("stringEquals"),
Value: pulumi.String("cloud-object-storage"),
},
&ibm.IamAuthorizationPolicyResourceAttributeArgs{
Name: pulumi.String("serviceInstance"),
Operator: pulumi.String("stringEquals"),
Value: pulumi.String("exxxxx34-xxxx-xxxx-xxxx-d6xxxxxxxx9"),
},
&ibm.IamAuthorizationPolicyResourceAttributeArgs{
Name: pulumi.String("resource"),
Operator: pulumi.String("stringEquals"),
Value: pulumi.String("backup-vault-name"),
},
&ibm.IamAuthorizationPolicyResourceAttributeArgs{
Name: pulumi.String("resourceType"),
Operator: pulumi.String("stringEquals"),
Value: pulumi.String("backup-vault"),
},
},
})
if err != nil {
return err
}
_, err = ibm.NewCosBackupPolicy(ctx, "policyCosBackupPolicy", &ibm.CosBackupPolicyArgs{
BucketCrn: pulumi.Any(ibm_cos_bucket.Bucket.Crn),
InitialDeleteAfterDays: pulumi.Float64(2),
PolicyName: pulumi.String("policy_name"),
TargetBackupVaultCrn: backup_vault.BackupVaultCrn,
BackupType: pulumi.String("continuous"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var cosGroup = Ibm.GetResourceGroup.Invoke(new()
{
Name = "cos-resource-group",
});
var backup_source_bucket = new Ibm.CosBucket("backup-source-bucket", new()
{
BucketName = "bucket-name",
ResourceInstanceId = "cos_instance_id",
CrossRegionLocation = "us",
StorageClass = "standard",
ObjectVersioning = new Ibm.Inputs.CosBucketObjectVersioningArgs
{
Enable = true,
},
});
var backup_vault = new Ibm.CosBackupVault("backup-vault", new()
{
BackupVaultName = "backup_vault_name",
ServiceInstanceId = "cos_instance_id to create backup vault",
Region = "us",
ActivityTrackingManagementEvents = true,
MetricsMonitoringUsageMetrics = true,
KmsKeyCrn = "crn:v1:staging:public:kms:us-south:a/997xxxxxxxxxxxxxxxxxxxxxx54:5xxxxxxxa-fxxb-4xx8-9xx4-f1xxxxxxxxx5:key:af5667d5-dxx5-4xxf-8xxf-exxxxxxxf1d",
});
var policyIamAuthorizationPolicy = new Ibm.IamAuthorizationPolicy("policyIamAuthorizationPolicy", new()
{
Roles = new[]
{
"Backup Manager",
"Writer",
"Manager",
},
SubjectAttributes = new[]
{
new Ibm.Inputs.IamAuthorizationPolicySubjectAttributeArgs
{
Name = "accountId",
Value = "account_id of the cos account",
},
new Ibm.Inputs.IamAuthorizationPolicySubjectAttributeArgs
{
Name = "serviceName",
Value = "cloud-object-storage",
},
new Ibm.Inputs.IamAuthorizationPolicySubjectAttributeArgs
{
Name = "serviceInstance",
Value = "exxxxx34-xxxx-xxxx-xxxx-d6xxxxxxxx9",
},
new Ibm.Inputs.IamAuthorizationPolicySubjectAttributeArgs
{
Name = "resource",
Value = "source-bucket-name",
},
new Ibm.Inputs.IamAuthorizationPolicySubjectAttributeArgs
{
Name = "resourceType",
Value = "bucket",
},
},
ResourceAttributes = new[]
{
new Ibm.Inputs.IamAuthorizationPolicyResourceAttributeArgs
{
Name = "accountId",
Operator = "stringEquals",
Value = "account id of the cos account of backup vault",
},
new Ibm.Inputs.IamAuthorizationPolicyResourceAttributeArgs
{
Name = "serviceName",
Operator = "stringEquals",
Value = "cloud-object-storage",
},
new Ibm.Inputs.IamAuthorizationPolicyResourceAttributeArgs
{
Name = "serviceInstance",
Operator = "stringEquals",
Value = "exxxxx34-xxxx-xxxx-xxxx-d6xxxxxxxx9",
},
new Ibm.Inputs.IamAuthorizationPolicyResourceAttributeArgs
{
Name = "resource",
Operator = "stringEquals",
Value = "backup-vault-name",
},
new Ibm.Inputs.IamAuthorizationPolicyResourceAttributeArgs
{
Name = "resourceType",
Operator = "stringEquals",
Value = "backup-vault",
},
},
});
var policyCosBackupPolicy = new Ibm.CosBackupPolicy("policyCosBackupPolicy", new()
{
BucketCrn = ibm_cos_bucket.Bucket.Crn,
InitialDeleteAfterDays = 2,
PolicyName = "policy_name",
TargetBackupVaultCrn = backup_vault.BackupVaultCrn,
BackupType = "continuous",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.IbmFunctions;
import com.pulumi.ibm.inputs.GetResourceGroupArgs;
import com.pulumi.ibm.CosBucket;
import com.pulumi.ibm.CosBucketArgs;
import com.pulumi.ibm.inputs.CosBucketObjectVersioningArgs;
import com.pulumi.ibm.CosBackupVault;
import com.pulumi.ibm.CosBackupVaultArgs;
import com.pulumi.ibm.IamAuthorizationPolicy;
import com.pulumi.ibm.IamAuthorizationPolicyArgs;
import com.pulumi.ibm.inputs.IamAuthorizationPolicySubjectAttributeArgs;
import com.pulumi.ibm.inputs.IamAuthorizationPolicyResourceAttributeArgs;
import com.pulumi.ibm.CosBackupPolicy;
import com.pulumi.ibm.CosBackupPolicyArgs;
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) {
final var cosGroup = IbmFunctions.getResourceGroup(GetResourceGroupArgs.builder()
.name("cos-resource-group")
.build());
var backup_source_bucket = new CosBucket("backup-source-bucket", CosBucketArgs.builder()
.bucketName("bucket-name")
.resourceInstanceId("cos_instance_id")
.crossRegionLocation("us")
.storageClass("standard")
.objectVersioning(CosBucketObjectVersioningArgs.builder()
.enable(true)
.build())
.build());
var backup_vault = new CosBackupVault("backup-vault", CosBackupVaultArgs.builder()
.backupVaultName("backup_vault_name")
.serviceInstanceId("cos_instance_id to create backup vault")
.region("us")
.activityTrackingManagementEvents(true)
.metricsMonitoringUsageMetrics(true)
.kmsKeyCrn("crn:v1:staging:public:kms:us-south:a/997xxxxxxxxxxxxxxxxxxxxxx54:5xxxxxxxa-fxxb-4xx8-9xx4-f1xxxxxxxxx5:key:af5667d5-dxx5-4xxf-8xxf-exxxxxxxf1d")
.build());
var policyIamAuthorizationPolicy = new IamAuthorizationPolicy("policyIamAuthorizationPolicy", IamAuthorizationPolicyArgs.builder()
.roles(
"Backup Manager",
"Writer",
"Manager")
.subjectAttributes(
IamAuthorizationPolicySubjectAttributeArgs.builder()
.name("accountId")
.value("account_id of the cos account")
.build(),
IamAuthorizationPolicySubjectAttributeArgs.builder()
.name("serviceName")
.value("cloud-object-storage")
.build(),
IamAuthorizationPolicySubjectAttributeArgs.builder()
.name("serviceInstance")
.value("exxxxx34-xxxx-xxxx-xxxx-d6xxxxxxxx9")
.build(),
IamAuthorizationPolicySubjectAttributeArgs.builder()
.name("resource")
.value("source-bucket-name")
.build(),
IamAuthorizationPolicySubjectAttributeArgs.builder()
.name("resourceType")
.value("bucket")
.build())
.resourceAttributes(
IamAuthorizationPolicyResourceAttributeArgs.builder()
.name("accountId")
.operator("stringEquals")
.value("account id of the cos account of backup vault")
.build(),
IamAuthorizationPolicyResourceAttributeArgs.builder()
.name("serviceName")
.operator("stringEquals")
.value("cloud-object-storage")
.build(),
IamAuthorizationPolicyResourceAttributeArgs.builder()
.name("serviceInstance")
.operator("stringEquals")
.value("exxxxx34-xxxx-xxxx-xxxx-d6xxxxxxxx9")
.build(),
IamAuthorizationPolicyResourceAttributeArgs.builder()
.name("resource")
.operator("stringEquals")
.value("backup-vault-name")
.build(),
IamAuthorizationPolicyResourceAttributeArgs.builder()
.name("resourceType")
.operator("stringEquals")
.value("backup-vault")
.build())
.build());
var policyCosBackupPolicy = new CosBackupPolicy("policyCosBackupPolicy", CosBackupPolicyArgs.builder()
.bucketCrn(ibm_cos_bucket.bucket().crn())
.initialDeleteAfterDays(2)
.policyName("policy_name")
.targetBackupVaultCrn(backup_vault.backupVaultCrn())
.backupType("continuous")
.build());
}
}
resources:
backup-source-bucket:
type: ibm:CosBucket
properties:
bucketName: bucket-name
resourceInstanceId: cos_instance_id
crossRegionLocation: us
storageClass: standard
objectVersioning:
enable: true
backup-vault:
type: ibm:CosBackupVault
properties:
backupVaultName: backup_vault_name
serviceInstanceId: cos_instance_id to create backup vault
region: us
activityTrackingManagementEvents: true
metricsMonitoringUsageMetrics: true
kmsKeyCrn: crn:v1:staging:public:kms:us-south:a/997xxxxxxxxxxxxxxxxxxxxxx54:5xxxxxxxa-fxxb-4xx8-9xx4-f1xxxxxxxxx5:key:af5667d5-dxx5-4xxf-8xxf-exxxxxxxf1d
policyIamAuthorizationPolicy:
type: ibm:IamAuthorizationPolicy
properties:
roles:
- Backup Manager
- Writer
- Manager
subjectAttributes:
- name: accountId
value: account_id of the cos account
- name: serviceName
value: cloud-object-storage
- name: serviceInstance
value: exxxxx34-xxxx-xxxx-xxxx-d6xxxxxxxx9
- name: resource
value: source-bucket-name
- name: resourceType
value: bucket
resourceAttributes:
- name: accountId
operator: stringEquals
value: account id of the cos account of backup vault
- name: serviceName
operator: stringEquals
value: cloud-object-storage
- name: serviceInstance
operator: stringEquals
value: exxxxx34-xxxx-xxxx-xxxx-d6xxxxxxxx9
- name: resource
operator: stringEquals
value: backup-vault-name
- name: resourceType
operator: stringEquals
value: backup-vault
policyCosBackupPolicy:
type: ibm:CosBackupPolicy
properties:
bucketCrn: ${ibm_cos_bucket.bucket.crn}
initialDeleteAfterDays: 2
policyName: policy_name
targetBackupVaultCrn: ${["backup-vault"].backupVaultCrn}
backupType: continuous
variables:
cosGroup:
fn::invoke:
function: ibm:getResourceGroup
arguments:
name: cos-resource-group
Create CosBackupPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CosBackupPolicy(name: string, args: CosBackupPolicyArgs, opts?: CustomResourceOptions);
@overload
def CosBackupPolicy(resource_name: str,
args: CosBackupPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CosBackupPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
backup_type: Optional[str] = None,
bucket_crn: Optional[str] = None,
initial_delete_after_days: Optional[float] = None,
policy_name: Optional[str] = None,
target_backup_vault_crn: Optional[str] = None,
cos_backup_policy_id: Optional[str] = None,
timeouts: Optional[CosBackupPolicyTimeoutsArgs] = None)
func NewCosBackupPolicy(ctx *Context, name string, args CosBackupPolicyArgs, opts ...ResourceOption) (*CosBackupPolicy, error)
public CosBackupPolicy(string name, CosBackupPolicyArgs args, CustomResourceOptions? opts = null)
public CosBackupPolicy(String name, CosBackupPolicyArgs args)
public CosBackupPolicy(String name, CosBackupPolicyArgs args, CustomResourceOptions options)
type: ibm:CosBackupPolicy
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 CosBackupPolicyArgs
- 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 CosBackupPolicyArgs
- 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 CosBackupPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CosBackupPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CosBackupPolicyArgs
- 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 cosBackupPolicyResource = new Ibm.CosBackupPolicy("cosBackupPolicyResource", new()
{
BackupType = "string",
BucketCrn = "string",
InitialDeleteAfterDays = 0,
PolicyName = "string",
TargetBackupVaultCrn = "string",
CosBackupPolicyId = "string",
Timeouts = new Ibm.Inputs.CosBackupPolicyTimeoutsArgs
{
Create = "string",
Delete = "string",
Update = "string",
},
});
example, err := ibm.NewCosBackupPolicy(ctx, "cosBackupPolicyResource", &ibm.CosBackupPolicyArgs{
BackupType: pulumi.String("string"),
BucketCrn: pulumi.String("string"),
InitialDeleteAfterDays: pulumi.Float64(0),
PolicyName: pulumi.String("string"),
TargetBackupVaultCrn: pulumi.String("string"),
CosBackupPolicyId: pulumi.String("string"),
Timeouts: &ibm.CosBackupPolicyTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
Update: pulumi.String("string"),
},
})
var cosBackupPolicyResource = new CosBackupPolicy("cosBackupPolicyResource", CosBackupPolicyArgs.builder()
.backupType("string")
.bucketCrn("string")
.initialDeleteAfterDays(0.0)
.policyName("string")
.targetBackupVaultCrn("string")
.cosBackupPolicyId("string")
.timeouts(CosBackupPolicyTimeoutsArgs.builder()
.create("string")
.delete("string")
.update("string")
.build())
.build());
cos_backup_policy_resource = ibm.CosBackupPolicy("cosBackupPolicyResource",
backup_type="string",
bucket_crn="string",
initial_delete_after_days=0,
policy_name="string",
target_backup_vault_crn="string",
cos_backup_policy_id="string",
timeouts={
"create": "string",
"delete": "string",
"update": "string",
})
const cosBackupPolicyResource = new ibm.CosBackupPolicy("cosBackupPolicyResource", {
backupType: "string",
bucketCrn: "string",
initialDeleteAfterDays: 0,
policyName: "string",
targetBackupVaultCrn: "string",
cosBackupPolicyId: "string",
timeouts: {
create: "string",
"delete": "string",
update: "string",
},
});
type: ibm:CosBackupPolicy
properties:
backupType: string
bucketCrn: string
cosBackupPolicyId: string
initialDeleteAfterDays: 0
policyName: string
targetBackupVaultCrn: string
timeouts:
create: string
delete: string
update: string
CosBackupPolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The CosBackupPolicy resource accepts the following input properties:
- Backup
Type string - Backup type. Currently only
continuous
is supported. - Bucket
Crn string - CRN of the source bucket.
- Initial
Delete doubleAfter Days Number of days after which the data contained within the RecoveryRange will be deleted.
Note: Once set the value of
initial_delete_after_days
cannot be updated.- Policy
Name string - Name of the policy.
- Target
Backup stringVault Crn - CRN of the target backup vault.
- Cos
Backup stringPolicy Id - (String) The ID of the backup policy.
- Timeouts
Cos
Backup Policy Timeouts
- Backup
Type string - Backup type. Currently only
continuous
is supported. - Bucket
Crn string - CRN of the source bucket.
- Initial
Delete float64After Days Number of days after which the data contained within the RecoveryRange will be deleted.
Note: Once set the value of
initial_delete_after_days
cannot be updated.- Policy
Name string - Name of the policy.
- Target
Backup stringVault Crn - CRN of the target backup vault.
- Cos
Backup stringPolicy Id - (String) The ID of the backup policy.
- Timeouts
Cos
Backup Policy Timeouts Args
- backup
Type String - Backup type. Currently only
continuous
is supported. - bucket
Crn String - CRN of the source bucket.
- initial
Delete DoubleAfter Days Number of days after which the data contained within the RecoveryRange will be deleted.
Note: Once set the value of
initial_delete_after_days
cannot be updated.- policy
Name String - Name of the policy.
- target
Backup StringVault Crn - CRN of the target backup vault.
- cos
Backup StringPolicy Id - (String) The ID of the backup policy.
- timeouts
Cos
Backup Policy Timeouts
- backup
Type string - Backup type. Currently only
continuous
is supported. - bucket
Crn string - CRN of the source bucket.
- initial
Delete numberAfter Days Number of days after which the data contained within the RecoveryRange will be deleted.
Note: Once set the value of
initial_delete_after_days
cannot be updated.- policy
Name string - Name of the policy.
- target
Backup stringVault Crn - CRN of the target backup vault.
- cos
Backup stringPolicy Id - (String) The ID of the backup policy.
- timeouts
Cos
Backup Policy Timeouts
- backup_
type str - Backup type. Currently only
continuous
is supported. - bucket_
crn str - CRN of the source bucket.
- initial_
delete_ floatafter_ days Number of days after which the data contained within the RecoveryRange will be deleted.
Note: Once set the value of
initial_delete_after_days
cannot be updated.- policy_
name str - Name of the policy.
- target_
backup_ strvault_ crn - CRN of the target backup vault.
- cos_
backup_ strpolicy_ id - (String) The ID of the backup policy.
- timeouts
Cos
Backup Policy Timeouts Args
- backup
Type String - Backup type. Currently only
continuous
is supported. - bucket
Crn String - CRN of the source bucket.
- initial
Delete NumberAfter Days Number of days after which the data contained within the RecoveryRange will be deleted.
Note: Once set the value of
initial_delete_after_days
cannot be updated.- policy
Name String - Name of the policy.
- target
Backup StringVault Crn - CRN of the target backup vault.
- cos
Backup StringPolicy Id - (String) The ID of the backup policy.
- timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the CosBackupPolicy resource produces the following output properties:
Look up Existing CosBackupPolicy Resource
Get an existing CosBackupPolicy 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?: CosBackupPolicyState, opts?: CustomResourceOptions): CosBackupPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
backup_type: Optional[str] = None,
bucket_crn: Optional[str] = None,
cos_backup_policy_id: Optional[str] = None,
initial_delete_after_days: Optional[float] = None,
policy_id: Optional[str] = None,
policy_name: Optional[str] = None,
target_backup_vault_crn: Optional[str] = None,
timeouts: Optional[CosBackupPolicyTimeoutsArgs] = None) -> CosBackupPolicy
func GetCosBackupPolicy(ctx *Context, name string, id IDInput, state *CosBackupPolicyState, opts ...ResourceOption) (*CosBackupPolicy, error)
public static CosBackupPolicy Get(string name, Input<string> id, CosBackupPolicyState? state, CustomResourceOptions? opts = null)
public static CosBackupPolicy get(String name, Output<String> id, CosBackupPolicyState state, CustomResourceOptions options)
resources: _: type: ibm:CosBackupPolicy get: id: ${id}
- 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.
- Backup
Type string - Backup type. Currently only
continuous
is supported. - Bucket
Crn string - CRN of the source bucket.
- Cos
Backup stringPolicy Id - (String) The ID of the backup policy.
- Initial
Delete doubleAfter Days Number of days after which the data contained within the RecoveryRange will be deleted.
Note: Once set the value of
initial_delete_after_days
cannot be updated.- Policy
Id string - Id of the backup policy applied on the source bucket
- Policy
Name string - Name of the policy.
- Target
Backup stringVault Crn - CRN of the target backup vault.
- Timeouts
Cos
Backup Policy Timeouts
- Backup
Type string - Backup type. Currently only
continuous
is supported. - Bucket
Crn string - CRN of the source bucket.
- Cos
Backup stringPolicy Id - (String) The ID of the backup policy.
- Initial
Delete float64After Days Number of days after which the data contained within the RecoveryRange will be deleted.
Note: Once set the value of
initial_delete_after_days
cannot be updated.- Policy
Id string - Id of the backup policy applied on the source bucket
- Policy
Name string - Name of the policy.
- Target
Backup stringVault Crn - CRN of the target backup vault.
- Timeouts
Cos
Backup Policy Timeouts Args
- backup
Type String - Backup type. Currently only
continuous
is supported. - bucket
Crn String - CRN of the source bucket.
- cos
Backup StringPolicy Id - (String) The ID of the backup policy.
- initial
Delete DoubleAfter Days Number of days after which the data contained within the RecoveryRange will be deleted.
Note: Once set the value of
initial_delete_after_days
cannot be updated.- policy
Id String - Id of the backup policy applied on the source bucket
- policy
Name String - Name of the policy.
- target
Backup StringVault Crn - CRN of the target backup vault.
- timeouts
Cos
Backup Policy Timeouts
- backup
Type string - Backup type. Currently only
continuous
is supported. - bucket
Crn string - CRN of the source bucket.
- cos
Backup stringPolicy Id - (String) The ID of the backup policy.
- initial
Delete numberAfter Days Number of days after which the data contained within the RecoveryRange will be deleted.
Note: Once set the value of
initial_delete_after_days
cannot be updated.- policy
Id string - Id of the backup policy applied on the source bucket
- policy
Name string - Name of the policy.
- target
Backup stringVault Crn - CRN of the target backup vault.
- timeouts
Cos
Backup Policy Timeouts
- backup_
type str - Backup type. Currently only
continuous
is supported. - bucket_
crn str - CRN of the source bucket.
- cos_
backup_ strpolicy_ id - (String) The ID of the backup policy.
- initial_
delete_ floatafter_ days Number of days after which the data contained within the RecoveryRange will be deleted.
Note: Once set the value of
initial_delete_after_days
cannot be updated.- policy_
id str - Id of the backup policy applied on the source bucket
- policy_
name str - Name of the policy.
- target_
backup_ strvault_ crn - CRN of the target backup vault.
- timeouts
Cos
Backup Policy Timeouts Args
- backup
Type String - Backup type. Currently only
continuous
is supported. - bucket
Crn String - CRN of the source bucket.
- cos
Backup StringPolicy Id - (String) The ID of the backup policy.
- initial
Delete NumberAfter Days Number of days after which the data contained within the RecoveryRange will be deleted.
Note: Once set the value of
initial_delete_after_days
cannot be updated.- policy
Id String - Id of the backup policy applied on the source bucket
- policy
Name String - Name of the policy.
- target
Backup StringVault Crn - CRN of the target backup vault.
- timeouts Property Map
Supporting Types
CosBackupPolicyTimeouts, CosBackupPolicyTimeoutsArgs
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibm
Terraform Provider.