You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,7 @@ You need the following permissions to run this module.
49
49
-[ Basic example](examples/basic)
50
50
-[ Complete example with BYOK encryption and CBR rules](examples/complete)
51
51
-[ Financial Services Cloud profile example with autoscaling enabled](examples/fscloud)
52
+
-[ Point in time recovery example (PITR)](examples/pitr)
52
53
<!-- END EXAMPLES HOOK -->
53
54
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
54
55
### Requirements
@@ -98,6 +99,8 @@ You need the following permissions to run this module.
98
99
| <aname="input_members"></a> [members](#input\_members)| The number of members that are allocated. [Learn more](https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-resources-scaling)|`number`|`3`| no |
99
100
| <aname="input_mongodb_version"></a> [mongodb\_version](#input\_mongodb\_version)| The version of the MongoDB to provision. If no value passed, the current ICD preferred version is used. For our version policy, see https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-versioning-policy for more details |`string`|`null`| no |
100
101
| <aname="input_name"></a> [name](#input\_name)| The name to give the MongoDB instance. |`string`| n/a | yes |
102
+
| <aname="input_pitr_id"></a> [pitr\_id](#input\_pitr\_id)| (Optional) The ID of the source deployment MongoDB instance that you want to recover back to. The MongoDB instance is expected to be in an up and in running state. |`string`|`null`| no |
103
+
| <aname="input_pitr_time"></a> [pitr\_time](#input\_pitr\_time)| (Optional) The timestamp in UTC format (%Y-%m-%dT%H:%M:%SZ) for any time in the last 7 days that you want to restore to. If empty string ("") is passed, earliest\_point\_in\_time\_recovery\_time will be used as pitr\_time. To retrieve the timestamp, run the command (ibmcloud cdb MongoDB earliest-pitr-timestamp <deploymentnameorCRN>). For more info on Point-in-time Recovery, see https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-pitr&interface=ui|`string`|`null`| no |
101
104
| <aname="input_plan"></a> [plan](#input\_plan)| The name of the service plan that you choose for your MongoDB instance |`string`|`"standard"`| no |
102
105
| <aname="input_region"></a> [region](#input\_region)| The region where you want to deploy your instance. |`string`|`"us-south"`| no |
103
106
| <aname="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id)| The resource group ID where the MongoDB instance will be created. |`string`| n/a | yes |
description="Region to provision all resources created by this example."
10
+
}
11
+
12
+
variable"prefix" {
13
+
type=string
14
+
description="Prefix to append to all resources created by this example"
15
+
}
16
+
17
+
variable"resource_group" {
18
+
type=string
19
+
description="An existing resource group name to use for this example, if unset a new resource group will be created"
20
+
default=null
21
+
}
22
+
23
+
variable"mongodb_version" {
24
+
description="Version of the mongodb instance. If no value passed, the current ICD preferred version is used."
25
+
type=string
26
+
default=null
27
+
}
28
+
29
+
variable"resource_tags" {
30
+
type=list(string)
31
+
description="Optional list of tags to be added to created resources"
32
+
default=[]
33
+
}
34
+
35
+
variable"access_tags" {
36
+
type=list(string)
37
+
description="Optional list of access management tags to add to resources that are created"
38
+
default=[]
39
+
}
40
+
41
+
variable"pitr_id" {
42
+
type=string
43
+
description="The ID of the source deployment MongoDB instance that you want to recover back to. The MongoDB instance is expected to be in an up and in running state."
44
+
}
45
+
46
+
variable"pitr_time" {
47
+
type=string
48
+
description="The timestamp in UTC format (%Y-%m-%dT%H:%M:%SZ) for any time in the last 7 days that you want to restore to. If empty string (\"\") is passed, earliest_in_time_recovery_time will be used as pitr_time. To retrieve the timestamp, run the command (ibmcloud cdb MongoDB earliest-pitr-timestamp <deployment name or CRN>). For more info on Point-in-time Recovery, see https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-pitr&interface=ui"
Copy file name to clipboardExpand all lines: main.tf
+27-16Lines changed: 27 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,10 @@ locals {
12
12
validate_backup_key=!var.use_ibm_owned_encryption_key&& var.backup_encryption_key_crn!=null&& (var.use_default_backup_encryption_key|| var.use_same_kms_key_for_backups) ?tobool("When passing a value for 'backup_encryption_key_crn' you cannot set 'use_default_backup_encryption_key' to true or 'use_ibm_owned_encryption_key' to false.") :true
13
13
# tflint-ignore: terraform_unused_declarations
14
14
validate_backup_key_2=!var.use_ibm_owned_encryption_key&& var.backup_encryption_key_crn==null&&!var.use_same_kms_key_for_backups?tobool("When 'use_same_kms_key_for_backups' is set to false, a value needs to be passed for 'backup_encryption_key_crn'.") :true
15
+
# tflint-ignore: terraform_unused_declarations
16
+
validate_pitr_vars=(var.pitr_id!=null&& var.pitr_time==null) || (var.pitr_time!=null&& var.pitr_id==null) ?tobool("To use Point-In-Time Recovery (PITR), values for both var.pitr_id and var.pitr_time need to be set. Otherwise, unset both of these.") :true
17
+
# Determine if restore, from backup or point in time recovery
0 commit comments