I really need some guidance here…
I have created the DC environment for an application. Now I have a DR region which is getting everyday volume backups copied from the DC region automatically. I am retaining the last 5 backups for every boot and block Volume.
Now I am working on to create some tf scripts for DR region which when run, should:
1- First create all the boot and block volumes using the latest respective backup files.
2- Use them in order to create the new VMs.
The part where I need guidance is “1” above. I can’t seem to find a way to refer to the right backup files using Data Source: oci_core_boot_volume_backup and oci_core_boot_volume_backups.
I think the solution may lie in using data source or locals and some regex filtering, but my knowledge is limited on those areas.
The cloud is OCI however I think the terraform logic in broader sense should be same as any other cloud.
terraform plan shows that that source details are found but the apply fails… both snippets below…
terraform plan
+ source_details {
+ id = "ocid1.bootvolume.oc1.uk-london-1.abwgiljr2y44ssfsokein7v7kgku3x6n7mpvugbwxxxxxxxxxxxxxxxxxxxx"
+ type = "bootVolumeBackup"
terraform apply
oci_core_boot_volume.test_boot_volume: Still creating... [2m0s elapsed]
Error: Service error:NotAuthorizedOrNotFound. Authorization failed or requested resource not found.. http status code: 404. Opc request id: 77c95b4cc7494a22b284558c37b9f277/2F538776FBBA341FBEE69BA2710B9273/09A381E6BEF64107234CB6296D07D6
on zvolume.tf line 2, in resource "oci_core_boot_volume" "test_boot_volume":
2: resource "oci_core_boot_volume" "test_boot_volume" {
PS: The source region is london and the destination region is frankfurt
Sorry for the delay. First quick question, you have the providers right with the different regions?
Yes I would use boot_volume_backups. Regex wise I have not done this with backups, I have done some with Images. I do think regex is right because when it transfers the backup over, it does have a standard naming convention if i remember right.
For example this pulls the latest Oracle Linux image. Maybe that regex will help?
data “oci_core_images” “ol7” {