-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproviders.tf
36 lines (28 loc) · 852 Bytes
/
providers.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
## Copyright (c) 2021, 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
variable "tenancy_ocid" {}
variable "region" {}
variable "compartment_ocid" {}
# Gets home and current regions
data "oci_identity_tenancy" "tenant_details" {
tenancy_id = var.tenancy_ocid
provider = oci.current_region
}
data "oci_identity_regions" "home_region" {
filter {
name = "key"
values = [data.oci_identity_tenancy.tenant_details.home_region_key]
}
provider = oci.current_region
}
provider "oci" {
region = var.region
}
provider "oci" {
alias = "home_region"
region = lookup(data.oci_identity_regions.home_region.regions[0], "name")
}
provider "oci" {
alias = "current_region"
region = var.region
}