|
| 1 | +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. |
| 2 | +// Licensed under the Mozilla Public License v2.0 |
| 3 | + |
| 4 | +variable "database_mysql_hatewave_id" { |
| 5 | + default = "" |
| 6 | +} |
| 7 | + |
| 8 | +variable "tenancy_ocid" { |
| 9 | +} |
| 10 | + |
| 11 | +variable "user_ocid" { |
| 12 | +} |
| 13 | + |
| 14 | +variable "fingerprint" { |
| 15 | +} |
| 16 | + |
| 17 | +variable "region" { |
| 18 | +} |
| 19 | + |
| 20 | +variable "private_key_path" { |
| 21 | +} |
| 22 | + |
| 23 | +variable "compartment_ocid" { |
| 24 | +} |
| 25 | + |
| 26 | +variable "kms_key_id" { |
| 27 | +} |
| 28 | + |
| 29 | +variable "kms_vault_id" { |
| 30 | +} |
| 31 | + |
| 32 | +variable "ssh_public_keys" { |
| 33 | +} |
| 34 | + |
| 35 | +variable "compartment_id" { |
| 36 | +} |
| 37 | + |
| 38 | +variable "database_id" { |
| 39 | +} |
| 40 | + |
| 41 | +variable "subnet_id" { |
| 42 | +} |
| 43 | + |
| 44 | +variable "vcn_id" { |
| 45 | +} |
| 46 | + |
| 47 | +variable "source_connection_id"{ |
| 48 | +} |
| 49 | + |
| 50 | +variable "source_connection_container_id"{ |
| 51 | +} |
| 52 | + |
| 53 | +variable "target_connection_id"{ |
| 54 | +} |
| 55 | + |
| 56 | +variable "ssh_key" { |
| 57 | +} |
| 58 | + |
| 59 | +variable "src_database_id" { |
| 60 | +} |
| 61 | + |
| 62 | +variable "tgt_database_id" { |
| 63 | +} |
| 64 | + |
| 65 | +variable "bucket_id" { |
| 66 | +} |
| 67 | + |
| 68 | +variable "source_connection_rds_id" { |
| 69 | +} |
| 70 | + |
| 71 | +variable "connection_string" { |
| 72 | + default = "" |
| 73 | +} |
| 74 | + |
| 75 | +variable "nsg_ids" { |
| 76 | + default = "" |
| 77 | +} |
| 78 | + |
| 79 | +variable "migration_id" { |
| 80 | + default = "" |
| 81 | +} |
| 82 | + |
| 83 | +variable "database_autonomous_id" { |
| 84 | + default = "" |
| 85 | +} |
| 86 | + |
| 87 | +variable "database_target_mysql_id" { |
| 88 | + default = "" |
| 89 | +} |
| 90 | + |
| 91 | +variable "database_mysql_id" { |
| 92 | + default = "" |
| 93 | +} |
| 94 | + |
| 95 | +provider "oci" { |
| 96 | + tenancy_ocid = var.tenancy_ocid |
| 97 | + user_ocid = var.user_ocid |
| 98 | + fingerprint = var.fingerprint |
| 99 | + private_key_path = var.private_key_path |
| 100 | + auth = "SecurityToken" |
| 101 | + region = var.region |
| 102 | + |
| 103 | +} |
| 104 | + |
| 105 | +data "oci_database_migration_migrations" "test_migrations" { |
| 106 | + #Required |
| 107 | + migration_id = var.migration_id |
| 108 | +} |
| 109 | + |
| 110 | +data "oci_database_migration_migration_object_types" "test_migration_object_types" { |
| 111 | + connection_type = "MYSQL" |
| 112 | +} |
| 113 | + |
| 114 | +data "oci_identity_availability_domains" "test_availability_domains" { |
| 115 | + compartment_id = var.compartment_id |
| 116 | +} |
| 117 | + |
| 118 | +resource "oci_database_migration_connection" "test_connection_mysql_hatewave_target" { |
| 119 | + compartment_id = var.compartment_id |
| 120 | + database_id = var.database_mysql_hatewave_id |
| 121 | + display_name = "TF_display_test_create" |
| 122 | + |
| 123 | + connection_type = "MYSQL" |
| 124 | + key_id = var.kms_key_id |
| 125 | + vault_id = var.kms_vault_id |
| 126 | + password = "BEstrO0ng_#11" |
| 127 | + technology_type = "OCI_MYSQL" |
| 128 | + username = "ggfe" |
| 129 | + database_name = "ggfe" |
| 130 | + host = "254.249.0.0" |
| 131 | + port = "3306" |
| 132 | + replication_password="replicationPassword" |
| 133 | + replication_username="replicationUsername" |
| 134 | + security_protocol="PLAIN" |
| 135 | + ssh_host = "sshHost" |
| 136 | + ssh_key = "sshKey" |
| 137 | + ssh_sudo_location = "sshSudoLocation" |
| 138 | + ssh_user = "sshUser" |
| 139 | + subnet_id = var.subnet_id |
| 140 | + wallet = "wallet2" |
| 141 | + |
| 142 | +} |
| 143 | + |
| 144 | +resource "oci_database_migration_connection" "test_connection_mysql_server_source" { |
| 145 | + compartment_id = var.compartment_id |
| 146 | + display_name = "TF_display_test_create_source" |
| 147 | + connection_type = "MYSQL" |
| 148 | + key_id = var.kms_key_id |
| 149 | + vault_id = var.kms_vault_id |
| 150 | + password = "BEstrO0ng_#11" |
| 151 | + technology_type = "MYSQL_SERVER" |
| 152 | + username = "ggfe" |
| 153 | + database_name = "ggfe" |
| 154 | + host = "254.249.0.0" |
| 155 | + port = "3306" |
| 156 | + replication_password="replicationPassword" |
| 157 | + replication_username="replicationUsername" |
| 158 | + security_protocol="PLAIN" |
| 159 | + ssh_host = "sshHost" |
| 160 | + ssh_key = "sshKey" |
| 161 | + ssh_sudo_location = "sshSudoLocation" |
| 162 | + ssh_user = "sshUser" |
| 163 | + wallet = "wallet2" |
| 164 | + |
| 165 | +} |
| 166 | + |
| 167 | +resource "oci_database_migration_migration" "test_mysql_migration" { |
| 168 | + compartment_id = var.compartment_id |
| 169 | + database_combination = "MYSQL" |
| 170 | + source_database_connection_id = oci_database_migration_connection.test_connection_mysql_server_source.id |
| 171 | + target_database_connection_id = oci_database_migration_connection.test_connection_mysql_hatewave_target.id |
| 172 | + type = "ONLINE" |
| 173 | + display_name = "displayName" |
| 174 | +} |
| 175 | + |
| 176 | +resource "oci_database_migration_migration" "test_offline_mysql_migration" { |
| 177 | + compartment_id = var.compartment_id |
| 178 | + database_combination = "MYSQL" |
| 179 | + source_database_connection_id = oci_database_migration_connection.test_connection_mysql_server_source.id |
| 180 | + target_database_connection_id = oci_database_migration_connection.test_connection_mysql_hatewave_target.id |
| 181 | + type = "OFFLINE" |
| 182 | + display_name = "displayName" |
| 183 | +} |
0 commit comments