File tree Expand file tree Collapse file tree 4 files changed +26
-0
lines changed
examples/compute/instance Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -42,3 +42,10 @@ resource "oci_core_volume_attachment" "TFBlockAttachParavirtualized" {
4242 # Set this to attach the volume as read-only.
4343 # is_read_only = true
4444}
45+
46+ // Backup Policy assignment
47+ resource "oci_core_volume_backup_policy_assignment" "policy" {
48+ count = 2
49+ asset_id = " ${ oci_core_instance . TFInstance . * . boot_volume_id [count . index ]} "
50+ policy_id = " ${ data . oci_core_volume_backup_policies . test_predefined_volume_backup_policies . volume_backup_policies . 0 . id } "
51+ }
Original file line number Diff line number Diff line change @@ -18,3 +18,13 @@ data "oci_core_boot_volume_attachments" "TFBootVolumeAttachments" {
1818data "oci_core_instance_devices" "TFInstanceDevices" {
1919 instance_id = " ${ oci_core_instance . TFInstance . * . id [count . index ]} "
2020}
21+
22+ data "oci_core_volume_backup_policies" "test_predefined_volume_backup_policies" {
23+ filter {
24+ name = " display_name"
25+
26+ values = [
27+ " silver" ,
28+ ]
29+ }
30+ }
Original file line number Diff line number Diff line change @@ -28,3 +28,11 @@ output "InstanceDevices" {
2828# value = ["${oci_core_volume_attachment.TFBlockAttach.*.chap_secret}"]
2929# }
3030
31+ // Outputs
32+ output "silver_policy_id" {
33+ value = " ${ data . oci_core_volume_backup_policies . test_predefined_volume_backup_policies . volume_backup_policies . 0 . id } "
34+ }
35+
36+ output "attachment_instance_id" {
37+ value = " ${ data . oci_core_boot_volume_attachments . TFBootVolumeAttachments . * . instance_id } "
38+ }
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ data "oci_core_boot_volume_attachments" "test_boot_volume_attachments" {
2626 instance_id = "${oci_core_instance.test_instance.id}"
2727}
2828```
29+ For more detailed implementation refer the [ instance example] ( https://github.com/oracle/terraform-provider-oci/tree/master/examples/compute/instance )
2930
3031## Argument Reference
3132
You can’t perform that action at this time.
0 commit comments