Skip to content

Commit cfc403b

Browse files
mikejihbecodycushing
authored andcommitted
Add explicit environment variable interpolation for provider schema values. All of these are preceeded with 'OBMCS', which may break environment oriented setups.
1 parent 92da0f1 commit cfc403b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

provider.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,19 @@ func schemaMap() map[string]*schema.Schema {
4343
Type: schema.TypeString,
4444
Required: true,
4545
Description: descriptions["tenancy_ocid"],
46+
DefaultFunc: schema.EnvDefaultFunc("OBMCS_TENANCY_OCID", nil),
4647
},
4748
"user_ocid": {
4849
Type: schema.TypeString,
4950
Required: true,
5051
Description: descriptions["user_ocid"],
52+
DefaultFunc: schema.EnvDefaultFunc("OBMCS_USER_OCID", nil),
5153
},
5254
"fingerprint": {
5355
Type: schema.TypeString,
5456
Required: true,
5557
Description: descriptions["fingerprint"],
58+
DefaultFunc: schema.EnvDefaultFunc("OBMCS_FINGERPRINT", nil),
5659
},
5760
// Mostly used for testing. Don't put keys in your .tf files
5861
"private_key": {
@@ -61,18 +64,21 @@ func schemaMap() map[string]*schema.Schema {
6164
Default: "",
6265
Sensitive: true,
6366
Description: descriptions["private_key"],
67+
DefaultFunc: schema.EnvDefaultFunc("OBMCS_PRIVATE_KEY", nil),
6468
},
6569
"private_key_path": {
6670
Type: schema.TypeString,
6771
Optional: true,
6872
Description: descriptions["private_key_path"],
73+
DefaultFunc: schema.EnvDefaultFunc("OBMCS_PRIVATE_KEY_PATH", nil),
6974
},
7075
"private_key_password": {
7176
Type: schema.TypeString,
7277
Optional: true,
7378
Sensitive: true,
7479
Default: "",
7580
Description: descriptions["private_key_password"],
81+
DefaultFunc: schema.EnvDefaultFunc("OBMCS_PRIVATE_KEY_PASSWORD", nil),
7682
},
7783
}
7884
}

0 commit comments

Comments
 (0)