-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprovisioner.tf
20 lines (19 loc) · 933 Bytes
/
provisioner.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Copyright © 2023, Oracle and/or its affiliates.
# All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl
// Avoid Circular Logic for ALF only; requires OCI CLI to update the Whitelist of the ADB post prov'ing of Compute
resource "null_resource" "oci_whitelist" {
count = local.is_paid ? 0 : 1
triggers = {
ci_public_ip = oci_core_instance.instance.public_ip
}
provisioner "local-exec" {
command = "oci db autonomous-database update --autonomous-database-id ${local.adb_ocid} --whitelisted-ips '[\"${local.ci_pubip}\"]' --force"
environment = {
OCI_CLI_USER = local.user_ocid
OCI_CLI_REGION = var.region
OCI_CLI_TENANCY = var.tenancy_ocid
OCI_CLI_FINGERPRINT = var.fingerprint != "" ? var.fingerprint : null
OCI_CLI_KEY_FILE = var.private_key_path != "" ? var.private_key_path : null
}
}
}