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: aws-runtime/aws-config/api/aws-config.api
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -77,12 +77,11 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/EnvironmentCredential
77
77
78
78
public final class aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CloseableCredentialsProvider {
79
79
public fun <init> ()V
80
+
public fun <init> (Ljava/lang/String;Laws/sdk/kotlin/runtime/config/imds/InstanceMetadataProvider;Laws/smithy/kotlin/runtime/util/PlatformProvider;)V
81
+
public synthetic fun <init> (Ljava/lang/String;Laws/sdk/kotlin/runtime/config/imds/InstanceMetadataProvider;Laws/smithy/kotlin/runtime/util/PlatformProvider;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
80
82
public fun <init> (Ljava/lang/String;Lkotlin/Lazy;Laws/smithy/kotlin/runtime/util/PlatformEnvironProvider;Laws/smithy/kotlin/runtime/time/Clock;)V
81
83
public synthetic fun <init> (Ljava/lang/String;Lkotlin/Lazy;Laws/smithy/kotlin/runtime/util/PlatformEnvironProvider;Laws/smithy/kotlin/runtime/time/Clock;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
82
84
public fun close ()V
83
-
public final fun getClient ()Lkotlin/Lazy;
84
-
public final fun getPlatformProvider ()Laws/smithy/kotlin/runtime/util/PlatformEnvironProvider;
85
-
public final fun getProfileOverride ()Ljava/lang/String;
86
85
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
87
86
public fun toString ()Ljava/lang/String;
88
87
}
@@ -277,6 +276,7 @@ public final class aws/sdk/kotlin/runtime/config/AwsSdkSetting {
277
276
public final fun getAwsContainerCredentialsFullUri ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
278
277
public final fun getAwsContainerCredentialsRelativeUri ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
279
278
public final fun getAwsDisableRequestCompression ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
279
+
public final fun getAwsEc2InstanceProfileName ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
280
280
public final fun getAwsEc2MetadataDisabled ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
281
281
public final fun getAwsEc2MetadataServiceEndpoint ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
282
282
public final fun getAwsEc2MetadataServiceEndpointMode ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
@@ -348,8 +348,8 @@ public final class aws/sdk/kotlin/runtime/config/endpoints/ResolversKt {
348
348
}
349
349
350
350
public final class aws/sdk/kotlin/runtime/config/imds/EC2MetadataError : aws/sdk/kotlin/runtime/AwsServiceException {
351
-
public fun <init> (ILjava/lang/String;)V
352
-
public final fun getStatusCode ()I
351
+
public fun <init> (Laws/smithy/kotlin/runtime/http/HttpStatusCode;Ljava/lang/String;)V
352
+
public final fun getStatusCode ()Laws/smithy/kotlin/runtime/http/HttpStatusCode;
353
353
}
354
354
355
355
public abstract class aws/sdk/kotlin/runtime/config/imds/EndpointConfiguration {
Copy file name to clipboardExpand all lines: aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/DefaultChainCredentialsProvider.kt
* [CredentialsProvider] that uses EC2 instance metadata service (IMDS) to provide credentials information.
37
-
* This provider requires that the EC2 instance has an [instance profile](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#ec2-instance-profile)
33
+
* This provider requires that the EC2 instance has an
CODE_ASSUME_ROLE_UNAUTHORIZED_ACCESS->throwProviderConfigurationException("Incorrect IMDS/IAM configuration: [${resp.code}] ${resp.message}. Hint: Does this role have a trust relationship with EC2?")
120
-
else->throwCredentialsProviderException("Error retrieving credentials from IMDS: code=${resp.code}; ${resp.message}")
CODE_ASSUME_ROLE_UNAUTHORIZED_ACCESS->throwProviderConfigurationException("Incorrect IMDS/IAM configuration: [${resp.code}] ${resp.message}. Hint: Does this role have a trust relationship with EC2?")
182
+
else->throwCredentialsProviderException("Error retrieving credentials from IMDS: code=${resp.code}; ${resp.message}")
122
183
}
123
184
}
124
185
}
125
186
126
187
overridefunclose() {
127
-
if (client.isInitialized()) {
128
-
client.value.close()
188
+
if (manageClient) {
189
+
client.close()
129
190
}
130
191
}
131
192
132
-
privatesuspendfunloadProfile() =try {
133
-
client.value.get(CREDENTIALS_BASE_PATH)
134
-
} catch (ex:EC2MetadataError) {
135
-
if (ex.statusCode ==HttpStatusCode.NotFound.value) {
0 commit comments