Fix/stackittpr 102 objectstorage handling region in individual resources (#711)
* Revert "fix: make resource/data-source specific region attribute read-only (#682)"
This reverts commit 3e8dcc542b.
* fix: Support individual regions
* fix: review findings
This commit is contained in:
parent
81f876adea
commit
c257ac49e2
105 changed files with 176 additions and 143 deletions
|
|
@ -14,9 +14,11 @@ import (
|
|||
const Separator = ","
|
||||
|
||||
type ProviderData struct {
|
||||
RoundTripper http.RoundTripper
|
||||
ServiceAccountEmail string // Deprecated: ServiceAccountEmail is not required and will be removed after 12th June 2025.
|
||||
RoundTripper http.RoundTripper
|
||||
ServiceAccountEmail string // Deprecated: ServiceAccountEmail is not required and will be removed after 12th June 2025.
|
||||
// Deprecated: Use DefaultRegion instead
|
||||
Region string
|
||||
DefaultRegion string
|
||||
ArgusCustomEndpoint string
|
||||
AuthorizationCustomEndpoint string
|
||||
DnsCustomEndpoint string
|
||||
|
|
@ -41,6 +43,17 @@ type ProviderData struct {
|
|||
EnableBetaResources bool
|
||||
}
|
||||
|
||||
// GetRegion returns the effective region for the provider, falling back to the deprecated _region_ attribute
|
||||
func (pd *ProviderData) GetRegion() string {
|
||||
if pd.DefaultRegion != "" {
|
||||
return pd.DefaultRegion
|
||||
} else if pd.Region != "" {
|
||||
return pd.Region
|
||||
}
|
||||
// final fallback
|
||||
return "eu01"
|
||||
}
|
||||
|
||||
// DiagsToError Converts TF diagnostics' errors into an error with a human-readable description.
|
||||
// If there are no errors, the output is nil
|
||||
func DiagsToError(diags diag.Diagnostics) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue