Skip to content

Commit 8a2d895

Browse files
committed
BugFix - fixed support for targeting multiple regions
1 parent b1d7c6c commit 8a2d895

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/provider/provider.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,14 @@ func getConfigProviders(d *schema.ResourceData, auth string) ([]oci_common.Confi
410410

411411
configProviders = append(configProviders, cfg)
412412
case strings.ToLower(globalvar.AuthSecurityToken):
413+
region, ok := d.GetOk(globalvar.RegionAttrName)
414+
if !ok {
415+
return nil, fmt.Errorf("can not get %s from Terraform configuration (SecurityToken)", globalvar.RegionAttrName)
416+
}
417+
// if region is part of the provider block make sure it is part of the final configuration too, and overwrites the region in the profile. +
418+
regionProvider := oci_common.NewRawConfigurationProvider("", "", region.(string), "", "", nil)
419+
configProviders = append(configProviders, regionProvider)
420+
413421
profile, ok := d.GetOk(globalvar.ConfigFileProfileAttrName)
414422
if !ok {
415423
return nil, fmt.Errorf("missing profile in provider block %v", globalvar.ConfigFileProfileAttrName)

0 commit comments

Comments
 (0)