File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
aws-core/common/src/aws/sdk/kotlin/runtime
protocols/http/common/src/aws/sdk/kotlin/runtime/http Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -51,4 +51,10 @@ public sealed class AwsSdkSetting<T> (
5151 * Configure the default region.
5252 */
5353 public object AwsRegion : AwsSdkSetting<String>(" AWS_REGION" , " aws.region" )
54+
55+ /* *
56+ * The execution environment of the SDK user. This is automatically set in certain environments by the underlying AWS service.
57+ * For example, AWS Lambda will automatically specify a runtime indicating that the SDK is being used within Lambda.
58+ */
59+ public object AwsExecutionEnv : AwsSdkSetting<String>(" AWS_EXECUTION_ENV" , " aws.executionEnvironment" )
5460}
Original file line number Diff line number Diff line change 55
66package aws.sdk.kotlin.runtime.http
77
8+ import aws.sdk.kotlin.runtime.AwsSdkSetting
89import aws.smithy.kotlin.runtime.util.OsFamily
910import aws.smithy.kotlin.runtime.util.Platform
1011
@@ -133,8 +134,8 @@ public data class ExecutionEnvMetadata(val name: String) {
133134}
134135
135136private fun detectExecEnv (): ExecutionEnvMetadata ? =
136- Platform .getenv(" AWS_LAMBDA_FUNCTION_NAME " )?.let {
137- ExecutionEnvMetadata (" lambda " )
137+ Platform .getenv(AwsSdkSetting . AwsExecutionEnv .environmentVariable )?.let {
138+ ExecutionEnvMetadata (it )
138139 }
139140
140141// ua-value = token
You can’t perform that action at this time.
0 commit comments