You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@
7
7
8
8
### Fixed
9
9
- Retried SDK calls are now jittered to avoid herding of retry requests in high parallelism scenarios
10
+
- Fail the initialization of the provider if either of `user_ocid`, `fingerprint`, `private_key`, `private_key_path` or `private_key_password` are specified for `InstancePrincipal` or `InstancePrincipalWithCerts` auth mode.
"auth": fmt.Sprintf("(Optional) The type of auth to use. Options are '%s' and '%s'. By default, '%s' will be used.", authAPIKeySetting, authInstancePrincipalSetting, authAPIKeySetting),
70
-
"tenancy_ocid": fmt.Sprintf("(Optional) The tenancy OCID for a user. The tenancy OCID can be found at the bottom of user settings in the Oracle Cloud Infrastructure console. Required if auth is set to '%s', ignored otherwise.", authAPIKeySetting),
71
-
"user_ocid": fmt.Sprintf("(Optional) The user OCID. This can be found in user settings in the Oracle Cloud Infrastructure console. Required if auth is set to '%s', ignored otherwise.", authAPIKeySetting),
72
-
"fingerprint": fmt.Sprintf("(Optional) The fingerprint for the user's RSA key. This can be found in user settings in the Oracle Cloud Infrastructure console. Required if auth is set to '%s', ignored otherwise.", authAPIKeySetting),
73
-
"region": "(Required) The region for API connections (e.g. us-ashburn-1).",
74
-
"private_key": "(Optional) A PEM formatted RSA private key for the user.\n"+
93
+
authAttrName:fmt.Sprintf("(Optional) The type of auth to use. Options are '%s' and '%s'. By default, '%s' will be used.", authAPIKeySetting, authInstancePrincipalSetting, authAPIKeySetting),
94
+
tenancyOcidAttrName: fmt.Sprintf("(Optional) The tenancy OCID for a user. The tenancy OCID can be found at the bottom of user settings in the Oracle Cloud Infrastructure console. Required if auth is set to '%s', ignored otherwise.", authAPIKeySetting),
95
+
userOcidAttrName: fmt.Sprintf("(Optional) The user OCID. This can be found in user settings in the Oracle Cloud Infrastructure console. Required if auth is set to '%s', ignored otherwise.", authAPIKeySetting),
96
+
fingerprintAttrName:fmt.Sprintf("(Optional) The fingerprint for the user's RSA key. This can be found in user settings in the Oracle Cloud Infrastructure console. Required if auth is set to '%s', ignored otherwise.", authAPIKeySetting),
97
+
regionAttrName:"(Required) The region for API connections (e.g. us-ashburn-1).",
98
+
privateKeyAttrName: "(Optional) A PEM formatted RSA private key for the user.\n"+
75
99
fmt.Sprintf("A private_key or a private_key_path must be provided if auth is set to '%s', ignored otherwise.", authAPIKeySetting),
76
-
"private_key_path": "(Optional) The path to the user's PEM formatted private key.\n"+
100
+
privateKeyPathAttrName: "(Optional) The path to the user's PEM formatted private key.\n"+
77
101
fmt.Sprintf("A private_key or a private_key_path must be provided if auth is set to '%s', ignored otherwise.", authAPIKeySetting),
78
-
"private_key_password": "(Optional) The password used to secure the private key.",
79
-
"disable_auto_retries": "(Optional) Disable automatic retries for retriable errors.\n"+
102
+
privateKeyPasswordAttrName: "(Optional) The password used to secure the private key.",
103
+
disableAutoRetriesAttrName: "(Optional) Disable automatic retries for retriable errors.\n"+
80
104
"Automatic retries were introduced to solve some eventual consistency problems but it also introduced performance issues on destroy operations.",
81
-
"retry_duration_seconds": "(Optional) The minimum duration (in seconds) to retry a resource operation in response to an error.\n"+
105
+
retryDurationSecondsAttrName: "(Optional) The minimum duration (in seconds) to retry a resource operation in response to an error.\n"+
82
106
"The actual retry duration may be longer due to jittering of retry operations. This value is ignored if the `disable_auto_retries` field is set to true.",
returnnil, fmt.Errorf(`authentication (%s) is set to "%s". To use "%s" authentication user credentials should be removed from the configuration.
584
+
The values for the %v are provided now.`, ociVarName(authAttrName), authInstancePrincipalSetting, authInstancePrincipalSetting, apiKeyConfigVariablesToUnset)
585
+
}
586
+
587
+
region, ok:=d.GetOkExists(regionAttrName)
547
588
if!ok {
548
-
returnnil, fmt.Errorf("can not get region from Terraform configuration (InstancePrincipal)")
589
+
returnnil, fmt.Errorf("can not get %s from Terraform configuration (InstancePrincipal)", regionAttrName)
returnnil, fmt.Errorf(`authentication (%s) is set to "%s". To use "%s" authentication user credentials should be removed from the configuration.
600
+
The values for the %v are provided now.`, ociVarName(authAttrName), authInstancePrincipalWithCertsSetting, authInstancePrincipalWithCertsSetting, apiKeyConfigVariablesToUnset)
601
+
}
602
+
603
+
region, ok:=d.GetOkExists(regionAttrName)
557
604
if!ok {
558
-
returnnil, fmt.Errorf("can not get region from Terraform configuration (InstancePrincipalWithCerts)")
605
+
returnnil, fmt.Errorf("can not get %s from Terraform configuration (InstancePrincipalWithCerts)", regionAttrName)
559
606
}
560
607
561
608
defaultCertsDir, err:=os.Getwd()
@@ -629,31 +676,31 @@ type ResourceDataConfigProvider struct {
629
676
// The ComposingConfigurationProvider in SDK should log the errors as debug statements instead.
0 commit comments