|
| 1 | +variable "tenancy_ocid" { |
| 2 | +} |
| 3 | + |
| 4 | +variable "ssh_public_key" { |
| 5 | +} |
| 6 | + |
| 7 | +variable "region" { |
| 8 | +} |
| 9 | + |
| 10 | +variable "compartment_id" { |
| 11 | +} |
| 12 | + |
| 13 | +variable "gi_target_1" { |
| 14 | +} |
| 15 | + |
| 16 | +variable "gi_target_2" { |
| 17 | +} |
| 18 | + |
| 19 | +variable "db_grid_software_image_1" { |
| 20 | +} |
| 21 | + |
| 22 | +variable "InstanceImageOCID" { |
| 23 | + type = "map" |
| 24 | + default = { |
| 25 | + // See https://docs.us-phoenix-1.oraclecloud.com/images/ |
| 26 | + // Oracle-provided image "Oracle-Linux-7.5-2018.10.16-0" |
| 27 | + } |
| 28 | +} |
| 29 | +// Gets a list of all Oracle Linux 7.5 images that support a given Instance shape |
| 30 | +data "oci_core_images" "supported_shape_images" { |
| 31 | + compartment_id = "${var.tenancy_ocid}" |
| 32 | + shape = "VM.Standard2.1" |
| 33 | + operating_system = "Oracle Linux" |
| 34 | +} |
| 35 | + |
| 36 | + |
| 37 | +resource "oci_fleet_software_update_fsu_collection" "test_fsu_collection" { |
| 38 | + compartment_id = "${var.compartment_id}" |
| 39 | + fleet_discovery { |
| 40 | + strategy = "TARGET_LIST" |
| 41 | + targets = ["${var.gi_target_1}"] |
| 42 | + } |
| 43 | + lifecycle { |
| 44 | + ignore_changes = ["defined_tags", "system_tags", "freeform_tags"] |
| 45 | + } |
| 46 | + service_type = "EXACS" |
| 47 | + source_major_version = "GI_19" |
| 48 | + type = "GI" |
| 49 | +} |
| 50 | + |
| 51 | +variable defined_tag_namespace_name { |
| 52 | + default = "" |
| 53 | +} |
| 54 | + |
| 55 | +resource "oci_identity_tag_namespace" "tag-namespace1" { |
| 56 | + #Required |
| 57 | + compartment_id = "${var.tenancy_ocid}" |
| 58 | + description = "example tag namespace" |
| 59 | + name = "${var.defined_tag_namespace_name != "" ? var.defined_tag_namespace_name : "example-tag-namespace-all"}" |
| 60 | + |
| 61 | + is_retired = false |
| 62 | +} |
| 63 | + |
| 64 | +resource "oci_identity_tag" "tag1" { |
| 65 | + #Required |
| 66 | + description = "example tag" |
| 67 | + name = "example-tag" |
| 68 | + tag_namespace_id = "${oci_identity_tag_namespace.tag-namespace1.id}" |
| 69 | + |
| 70 | + is_retired = false |
| 71 | +} |
| 72 | + |
| 73 | +resource "oci_fleet_software_update_fsu_cycle" "test_fsu_cycle" { |
| 74 | + compartment_id = "${var.compartment_id}" |
| 75 | + fsu_collection_id = "${oci_fleet_software_update_fsu_collection.test_fsu_collection.id}" |
| 76 | + goal_version_details { |
| 77 | + software_image_id = "${var.db_grid_software_image_1}" |
| 78 | + type = "IMAGE_ID" |
| 79 | + } |
| 80 | + lifecycle { |
| 81 | + ignore_changes = ["defined_tags", "system_tags", "freeform_tags"] |
| 82 | + } |
| 83 | + type = "PATCH" |
| 84 | +} |
0 commit comments