|
| 1 | +variable "tenancy_ocid" {} |
| 2 | +variable "user_ocid" {} |
| 3 | +variable "fingerprint" {} |
| 4 | +variable "private_key_path" {} |
| 5 | +variable "region" {} |
| 6 | +variable "compartment_ocid" {} |
| 7 | +variable "kms_vault_ocid" {} |
| 8 | +variable "kms_key_ocid" {} |
| 9 | + |
| 10 | + |
| 11 | +variable "database_registration_alias_name" { |
| 12 | + default = "aliasName" |
| 13 | +} |
| 14 | + |
| 15 | +variable "database_registration_connection_string" { |
| 16 | + default = "username@password:1521/orcl.us.oracle.com" |
| 17 | +} |
| 18 | + |
| 19 | +variable "database_registration_defined_tags_value" { |
| 20 | + default = "value" |
| 21 | +} |
| 22 | + |
| 23 | +variable "database_registration_description" { |
| 24 | + default = "description" |
| 25 | +} |
| 26 | + |
| 27 | +variable "database_registration_display_name" { |
| 28 | + default = "displayName" |
| 29 | +} |
| 30 | + |
| 31 | +variable "database_registration_fqdn" { |
| 32 | + default = "fqdndb.ggs.com" |
| 33 | +} |
| 34 | + |
| 35 | +variable "database_registration_freeform_tags" { |
| 36 | + default = { "bar-key" = "value" } |
| 37 | +} |
| 38 | + |
| 39 | +variable "database_registration_ip_address" { |
| 40 | + default = "10.102.10.20" |
| 41 | +} |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +variable "database_registration_password" { |
| 46 | + default = "BEstrO0ng_#11" |
| 47 | +} |
| 48 | + |
| 49 | +variable "database_registration_state" { |
| 50 | + default = "ACTIVE" |
| 51 | +} |
| 52 | + |
| 53 | +variable "database_registration_username" { |
| 54 | + default = "username" |
| 55 | +} |
| 56 | + |
| 57 | +variable "database_registration_wallet" { |
| 58 | + default = "wallet" |
| 59 | +} |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | +provider "oci" { |
| 64 | + tenancy_ocid = var.tenancy_ocid |
| 65 | + user_ocid = var.user_ocid |
| 66 | + fingerprint = var.fingerprint |
| 67 | + private_key_path = var.private_key_path |
| 68 | + region = var.region |
| 69 | +} |
| 70 | + |
| 71 | +resource "oci_core_subnet" "test_subnet" { |
| 72 | + cidr_block = "10.0.0.0/24" |
| 73 | + compartment_id = var.compartment_ocid |
| 74 | + vcn_id = oci_core_vcn.test_vcn.id |
| 75 | +} |
| 76 | + |
| 77 | +resource "oci_core_vcn" "test_vcn" { |
| 78 | + cidr_block = "10.0.0.0/16" |
| 79 | + compartment_id = var.compartment_ocid |
| 80 | +} |
| 81 | + |
| 82 | +resource "oci_golden_gate_database_registration" "test_database_registration" { |
| 83 | + #Required |
| 84 | + alias_name = var.database_registration_alias_name |
| 85 | + compartment_id = var.compartment_ocid |
| 86 | + display_name = var.database_registration_display_name |
| 87 | + fqdn = var.database_registration_fqdn |
| 88 | + password = var.database_registration_password |
| 89 | + username = var.database_registration_username |
| 90 | + |
| 91 | + #Optional |
| 92 | + connection_string = var.database_registration_connection_string |
| 93 | + database_id = data.oci_database_databases.t.databases.0.id |
| 94 | + #defined_tags = map(oci_identity_tag_namespace.tag-namespace1.name.oci_identity_tag.tag1.name, var.database_registration_defined_tags_value) |
| 95 | + description = var.database_registration_description |
| 96 | + freeform_tags = var.database_registration_freeform_tags |
| 97 | + #ip_address = data.oci_core_vnic.t.0.private_ip_address //vnic_id is null because of using FAKEHOSTSERIAL header as per db_system_resource_allvm_test.go |
| 98 | + key_id = var.kms_key_ocid |
| 99 | + secret_compartment_id = var.compartment_ocid |
| 100 | + subnet_id = oci_core_subnet.test_subnet.id |
| 101 | + vault_id = var.kms_vault_ocid |
| 102 | + wallet = var.database_registration_wallet |
| 103 | +} |
| 104 | + |
| 105 | +data "oci_golden_gate_database_registrations" "test_database_registrations" { |
| 106 | + #Required |
| 107 | + compartment_id = var.compartment_ocid |
| 108 | + |
| 109 | + #Optional |
| 110 | + display_name = var.database_registration_display_name |
| 111 | + state = var.database_registration_state |
| 112 | +} |
| 113 | + |
| 114 | +data "oci_database_db_systems" "t" { |
| 115 | + compartment_id = var.compartment_ocid |
| 116 | +} |
| 117 | + |
| 118 | +data "oci_database_db_homes" "t" { |
| 119 | + compartment_id = var.compartment_ocid |
| 120 | + db_system_id = data.oci_database_db_systems.t.db_systems.0.id |
| 121 | +} |
| 122 | + |
| 123 | +data "oci_database_databases" "t" { |
| 124 | + compartment_id = var.compartment_ocid |
| 125 | + db_home_id = data.oci_database_db_homes.t.db_homes.0.id |
| 126 | +} |
| 127 | + |
| 128 | +data "oci_database_db_nodes" "t" { |
| 129 | + #Required |
| 130 | + compartment_id = var.compartment_ocid |
| 131 | + #Optional |
| 132 | + db_system_id = data.oci_database_db_systems.t.db_systems.0.id |
| 133 | +} |
| 134 | + |
| 135 | +#data "oci_core_vnic" "t" { |
| 136 | + #Required |
| 137 | + #vnic_id = data.oci_database_db_nodes.t.vnic_id //believe this is null when using FAKEHOSTSERIAL header |
| 138 | +#} |
0 commit comments