-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathproviders.tf
executable file
·47 lines (39 loc) · 1.33 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
# Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
terraform {
required_version = ">= 0.13"
required_providers {
local = { source = "hashicorp/local" }
oci = { source = "hashicorp/oci" }
random = { source = "hashicorp/random" }
tls = { source = "hashicorp/tls" }
template = { source = "hashicorp/template" }
}
}
provider "oci" {
tenancy_ocid = var.tenancy_ocid
region = local.region_to_deploy
user_ocid = var.user_ocid
fingerprint = var.fingerprint
private_key_path = var.private_key_path
}
provider "oci" {
alias = "home_region"
tenancy_ocid = var.tenancy_ocid
region = lookup(data.oci_identity_regions.home_region.regions[0], "name")
user_ocid = var.user_ocid
fingerprint = var.fingerprint
private_key_path = var.private_key_path
}
provider "oci" {
alias = "current_region"
tenancy_ocid = var.tenancy_ocid
region = var.region
user_ocid = var.user_ocid
fingerprint = var.fingerprint
private_key_path = var.private_key_path
}
locals {
region_to_deploy = var.use_only_always_free_elegible_resources ? lookup(data.oci_identity_regions.home_region.regions[0], "name") : var.region
}