From 24851dcf22cf323e371749870dec22929aa0e881 Mon Sep 17 00:00:00 2001 From: 0marperez <60363173+0marperez@users.noreply.github.com> Date: Wed, 11 Oct 2023 13:32:53 -0600 Subject: [PATCH 01/13] feat: add more user agent app id sources (#1071) --- .../2e8e4fee-c462-45d2-b421-46520d06eb60.json | 8 +++ aws-runtime/aws-config/api/aws-config.api | 3 + .../config/AbstractAwsSdkClientFactory.kt | 8 ++- .../kotlin/runtime/config/AwsSdkSetting.kt | 7 ++ .../runtime/config/profile/AwsProfile.kt | 7 ++ .../config/useragent/ResolveUserAgent.kt | 22 ++++++ .../config/AbstractAwsSdkClientFactoryTest.kt | 67 ++++++++++++++++++- .../profile/AWSConfigLoaderFilesystemTest.kt | 54 +-------------- .../runtime/config/utils/MockPlatform.kt | 63 +++++++++++++++++ aws-runtime/aws-core/api/aws-core.api | 3 + .../runtime/client/AwsSdkClientConfig.kt | 28 ++++++++ aws-runtime/aws-http/api/aws-http.api | 8 ++- .../runtime/http/AwsUserAgentMetadata.kt | 11 +-- .../runtime/http/AwsUserAgentMetadataTest.kt | 23 +++++++ .../codegen/AwsServiceConfigIntegration.kt | 21 ++++++ .../middleware/UserAgentMiddleware.kt | 6 +- 16 files changed, 276 insertions(+), 63 deletions(-) create mode 100644 .changes/2e8e4fee-c462-45d2-b421-46520d06eb60.json create mode 100644 aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/useragent/ResolveUserAgent.kt create mode 100644 aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/utils/MockPlatform.kt diff --git a/.changes/2e8e4fee-c462-45d2-b421-46520d06eb60.json b/.changes/2e8e4fee-c462-45d2-b421-46520d06eb60.json new file mode 100644 index 00000000000..69b9eb6dc31 --- /dev/null +++ b/.changes/2e8e4fee-c462-45d2-b421-46520d06eb60.json @@ -0,0 +1,8 @@ +{ + "id": "2e8e4fee-c462-45d2-b421-46520d06eb60", + "type": "feature", + "description": "Add new sources for User-Agent app id", + "issues": [ + "awslabs/aws-sdk-kotlin#945" + ] +} \ No newline at end of file diff --git a/aws-runtime/aws-config/api/aws-config.api b/aws-runtime/aws-config/api/aws-config.api index 0f62a04a1ea..b92308801af 100644 --- a/aws-runtime/aws-config/api/aws-config.api +++ b/aws-runtime/aws-config/api/aws-config.api @@ -315,6 +315,9 @@ public final class aws/sdk/kotlin/runtime/config/profile/AwsSharedConfigKt { public final class aws/sdk/kotlin/runtime/config/retries/ResolveRetryStrategyKt { } +public final class aws/sdk/kotlin/runtime/config/useragent/ResolveUserAgentKt { +} + public abstract interface class aws/sdk/kotlin/runtime/region/RegionProvider { public abstract fun getRegion (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } diff --git a/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/AbstractAwsSdkClientFactory.kt b/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/AbstractAwsSdkClientFactory.kt index d5cfd9f834f..f5986ac8408 100644 --- a/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/AbstractAwsSdkClientFactory.kt +++ b/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/AbstractAwsSdkClientFactory.kt @@ -11,6 +11,7 @@ import aws.sdk.kotlin.runtime.config.endpoints.resolveUseFips import aws.sdk.kotlin.runtime.config.profile.AwsSharedConfig import aws.sdk.kotlin.runtime.config.profile.loadAwsSharedConfig import aws.sdk.kotlin.runtime.config.retries.resolveRetryStrategy +import aws.sdk.kotlin.runtime.config.useragent.resolveUserAgentAppId import aws.sdk.kotlin.runtime.region.resolveRegion import aws.smithy.kotlin.runtime.ExperimentalApi import aws.smithy.kotlin.runtime.client.RetryStrategyClientConfig @@ -57,7 +58,8 @@ public abstract class AbstractAwsSdkClientFactory< val tracer = telemetryProvider.tracerProvider.getOrCreateTracer("AwsSdkClientFactory") tracer.withSpan("fromEnvironment") { - val sharedConfig = asyncLazy { loadAwsSharedConfig(PlatformProvider.System) } + val platform = PlatformProvider.System + val sharedConfig = asyncLazy { loadAwsSharedConfig(platform) } val profile = asyncLazy { sharedConfig.get().activeProfile } // As a DslBuilderProperty, the value of retryStrategy cannot be checked for nullability because it may have @@ -68,10 +70,12 @@ public abstract class AbstractAwsSdkClientFactory< block?.let(config::apply) - config.logMode = config.logMode ?: ClientSettings.LogMode.resolve(platform = PlatformProvider.System) + config.logMode = config.logMode ?: ClientSettings.LogMode.resolve(platform = platform) config.region = config.region ?: resolveRegion(profile = profile) config.useFips = config.useFips ?: resolveUseFips(profile = profile) config.useDualStack = config.useDualStack ?: resolveUseDualStack(profile = profile) + config.applicationId = config.applicationId ?: resolveUserAgentAppId(platform, profile) + finalizeConfig(builder, sharedConfig) } return builder.build() diff --git a/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/AwsSdkSetting.kt b/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/AwsSdkSetting.kt index 875cdc06a60..e0ac6ec6265 100644 --- a/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/AwsSdkSetting.kt +++ b/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/AwsSdkSetting.kt @@ -6,6 +6,8 @@ package aws.sdk.kotlin.runtime.config import aws.sdk.kotlin.runtime.InternalSdkApi +import aws.sdk.kotlin.runtime.http.AWS_APP_ID_ENV +import aws.sdk.kotlin.runtime.http.AWS_APP_ID_PROP import aws.smithy.kotlin.runtime.client.config.RetryMode import aws.smithy.kotlin.runtime.config.* import aws.smithy.kotlin.runtime.net.Url @@ -45,6 +47,11 @@ public object AwsSdkSetting { */ public val AwsRegion: EnvironmentSetting = strEnvSetting("aws.region", "AWS_REGION") + /** + * Configure the user agent app ID + */ + public val AwsAppId: EnvironmentSetting = strEnvSetting(AWS_APP_ID_PROP, AWS_APP_ID_ENV) + /** * Configure the default path to the shared config file. */ diff --git a/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/profile/AwsProfile.kt b/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/profile/AwsProfile.kt index 48cba4272c9..33a3753c0ef 100644 --- a/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/profile/AwsProfile.kt +++ b/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/profile/AwsProfile.kt @@ -122,6 +122,13 @@ public val AwsProfile.ignoreEndpointUrls: Boolean? public val AwsProfile.servicesSection: String? get() = getOrNull("services") +/** + * The SDK user agent app ID used to identify applications. + */ +@InternalSdkApi +public val AwsProfile.sdkUserAgentAppId: String? + get() = getOrNull("sdk_ua_app_id") + /** * Parse a config value as a boolean, ignoring case. */ diff --git a/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/useragent/ResolveUserAgent.kt b/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/useragent/ResolveUserAgent.kt new file mode 100644 index 00000000000..0c71e55d179 --- /dev/null +++ b/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/useragent/ResolveUserAgent.kt @@ -0,0 +1,22 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package aws.sdk.kotlin.runtime.config.useragent + +import aws.sdk.kotlin.runtime.InternalSdkApi +import aws.sdk.kotlin.runtime.config.AwsSdkSetting +import aws.sdk.kotlin.runtime.config.profile.AwsProfile +import aws.sdk.kotlin.runtime.config.profile.sdkUserAgentAppId +import aws.smithy.kotlin.runtime.config.resolve +import aws.smithy.kotlin.runtime.util.LazyAsyncValue +import aws.smithy.kotlin.runtime.util.PlatformProvider + +/** + * Attempts to resolve user agent from specified sources. + * @return The user agent app id if found, null if not + */ +@InternalSdkApi +public suspend fun resolveUserAgentAppId(platform: PlatformProvider = PlatformProvider.System, profile: LazyAsyncValue): String? = + AwsSdkSetting.AwsAppId.resolve(platform) ?: profile.get().sdkUserAgentAppId diff --git a/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/AbstractAwsSdkClientFactoryTest.kt b/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/AbstractAwsSdkClientFactoryTest.kt index 725794d36dc..daf64bcb56b 100644 --- a/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/AbstractAwsSdkClientFactoryTest.kt +++ b/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/AbstractAwsSdkClientFactoryTest.kt @@ -6,15 +6,31 @@ package aws.sdk.kotlin.runtime.config import aws.sdk.kotlin.runtime.client.AwsSdkClientConfig +import aws.sdk.kotlin.runtime.config.profile.loadAwsSharedConfig +import aws.sdk.kotlin.runtime.config.useragent.resolveUserAgentAppId +import aws.sdk.kotlin.runtime.config.utils.mockPlatform import aws.smithy.kotlin.runtime.client.* import aws.smithy.kotlin.runtime.retries.StandardRetryStrategy +import aws.smithy.kotlin.runtime.util.PlatformProvider +import aws.smithy.kotlin.runtime.util.asyncLazy +import io.kotest.extensions.system.withEnvironment import io.kotest.extensions.system.withSystemProperties import kotlinx.coroutines.test.runTest +import org.junit.jupiter.api.io.TempDir +import java.nio.file.Path +import kotlin.io.path.absolutePathString +import kotlin.io.path.deleteIfExists +import kotlin.io.path.writeText import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertIs +import kotlin.time.Duration.Companion.seconds class AbstractAwsSdkClientFactoryTest { + @JvmField + @TempDir + var tempDir: Path? = null + @Test fun testFromEnvironmentFavorsExplicitConfig() = runTest { val explicitRegion = "explicit-region" @@ -41,6 +57,53 @@ class AbstractAwsSdkClientFactoryTest { assertIs(client.config.retryStrategy) } } + + @Test + fun testFromEnvironmentResolvesAppId() = runTest( + timeout = 20.seconds, + ) { + val credentialsFile = tempDir!!.resolve("credentials") + val configFile = tempDir!!.resolve("config") + + configFile.writeText("[profile foo]\nsdk_ua_app_id = profile-app-id") + + val testPlatform = mockPlatform( + pathSegment = PlatformProvider.System.filePathSeparator, + awsProfileEnv = "foo", + homeEnv = "/home/user", + awsConfigFileEnv = configFile.absolutePathString(), + awsSharedCredentialsFileEnv = credentialsFile.absolutePathString(), + os = PlatformProvider.System.osInfo(), + ) + + val sharedConfig = asyncLazy { loadAwsSharedConfig(testPlatform) } + val profile = asyncLazy { sharedConfig.get().activeProfile } + + assertEquals("profile-app-id", resolveUserAgentAppId(testPlatform, profile)) + + configFile.deleteIfExists() + credentialsFile.deleteIfExists() + + withEnvironment( + mapOf( + AwsSdkSetting.AwsAppId.envVar to "env-app-id", + ), + ) { + assertEquals("env-app-id", TestClient.fromEnvironment().config.applicationId) + + withSystemProperties( + mapOf( + AwsSdkSetting.AwsAppId.sysProp to "system-properties-app-id", + ), + ) { + assertEquals("system-properties-app-id", TestClient.fromEnvironment().config.applicationId) + assertEquals( + "explicit-app-id", + TestClient.fromEnvironment { applicationId = "explicit-app-id" }.config.applicationId, + ) + } + } + } } private interface TestClient : SdkClient { @@ -59,9 +122,10 @@ private interface TestClient : SdkClient { class Config private constructor(builder: Builder) : SdkClientConfig, AwsSdkClientConfig, RetryStrategyClientConfig by builder.buildRetryStrategyClientConfig() { override val clientName: String = builder.clientName override val logMode: LogMode = builder.logMode ?: LogMode.Default - override val region: String = builder.region ?: error("region is required") + override val region: String? = builder.region override var useFips: Boolean = builder.useFips ?: false override var useDualStack: Boolean = builder.useDualStack ?: false + override val applicationId: String? = builder.applicationId // new: inherits builder equivalents for Config base classes class Builder : AwsSdkClientConfig.Builder, SdkClientConfig.Builder, RetryStrategyClientConfig.Builder by RetryStrategyClientConfigImpl.BuilderImpl() { @@ -70,6 +134,7 @@ private interface TestClient : SdkClient { override var region: String? = null override var useFips: Boolean? = null override var useDualStack: Boolean? = null + override var applicationId: String? = null override fun build(): Config = Config(this) } } diff --git a/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/profile/AWSConfigLoaderFilesystemTest.kt b/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/profile/AWSConfigLoaderFilesystemTest.kt index e91280a3bb0..45852d6644e 100644 --- a/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/profile/AWSConfigLoaderFilesystemTest.kt +++ b/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/profile/AWSConfigLoaderFilesystemTest.kt @@ -5,16 +5,11 @@ package aws.sdk.kotlin.runtime.config.profile -import aws.smithy.kotlin.runtime.util.OperatingSystem +import aws.sdk.kotlin.runtime.config.utils.mockPlatform import aws.smithy.kotlin.runtime.util.PlatformProvider -import io.mockk.coEvery -import io.mockk.every -import io.mockk.mockk -import io.mockk.slot import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Test import org.junit.jupiter.api.io.TempDir -import java.io.File import java.nio.file.Path import kotlin.io.path.absolutePathString import kotlin.io.path.deleteIfExists @@ -81,51 +76,4 @@ class AWSConfigLoaderFilesystemTest { configFile.deleteIfExists() credentialsFile.deleteIfExists() } - - private fun mockPlatform( - pathSegment: String, - awsProfileEnv: String? = null, - awsConfigFileEnv: String? = null, - homeEnv: String? = null, - awsSharedCredentialsFileEnv: String? = null, - homeProp: String? = null, - os: OperatingSystem, - ): PlatformProvider { - val testPlatform = mockk() - val envKeyParam = slot() - val propKeyParam = slot() - val filePath = slot() - - every { testPlatform.filePathSeparator } returns pathSegment - every { testPlatform.getenv(capture(envKeyParam)) } answers { - when (envKeyParam.captured) { - "AWS_PROFILE" -> awsProfileEnv - "AWS_CONFIG_FILE" -> awsConfigFileEnv - "HOME" -> homeEnv - "AWS_SHARED_CREDENTIALS_FILE" -> awsSharedCredentialsFileEnv - else -> error(envKeyParam.captured) - } - } - every { testPlatform.getProperty(capture(propKeyParam)) } answers { - if (propKeyParam.captured == "user.home") homeProp else null - } - every { testPlatform.osInfo() } returns os - coEvery { - testPlatform.readFileOrNull(capture(filePath)) - } answers { - if (awsConfigFileEnv != null) { - val file = if (filePath.captured.endsWith("config")) { - File(awsConfigFileEnv) - } else { - File(awsSharedCredentialsFileEnv) - } - - if (file.exists()) file.readBytes() else null - } else { - null - } - } - - return testPlatform - } } diff --git a/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/utils/MockPlatform.kt b/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/utils/MockPlatform.kt new file mode 100644 index 00000000000..ca0fb3cf4a0 --- /dev/null +++ b/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/utils/MockPlatform.kt @@ -0,0 +1,63 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package aws.sdk.kotlin.runtime.config.utils + +import aws.smithy.kotlin.runtime.util.OperatingSystem +import aws.smithy.kotlin.runtime.util.PlatformProvider +import io.mockk.coEvery +import io.mockk.every +import io.mockk.mockk +import io.mockk.slot +import java.io.File + +internal fun mockPlatform( + pathSegment: String, + awsProfileEnv: String? = null, + awsConfigFileEnv: String? = null, + homeEnv: String? = null, + awsSharedCredentialsFileEnv: String? = null, + awsSdkUserAgentAppIdEnv: String? = null, + homeProp: String? = null, + os: OperatingSystem, +): PlatformProvider { + val testPlatform = mockk() + val envKeyParam = slot() + val propKeyParam = slot() + val filePath = slot() + + every { testPlatform.filePathSeparator } returns pathSegment + every { testPlatform.getenv(capture(envKeyParam)) } answers { + when (envKeyParam.captured) { + "AWS_PROFILE" -> awsProfileEnv + "AWS_CONFIG_FILE" -> awsConfigFileEnv + "HOME" -> homeEnv + "AWS_SHARED_CREDENTIALS_FILE" -> awsSharedCredentialsFileEnv + "AWS_SDK_UA_APP_ID" -> awsSdkUserAgentAppIdEnv + else -> error(envKeyParam.captured) + } + } + every { testPlatform.getProperty(capture(propKeyParam)) } answers { + if (propKeyParam.captured == "user.home") homeProp else null + } + every { testPlatform.osInfo() } returns os + coEvery { + testPlatform.readFileOrNull(capture(filePath)) + } answers { + if (awsConfigFileEnv != null) { + val file = if (filePath.captured.endsWith("config")) { + File(awsConfigFileEnv) + } else { + File(awsSharedCredentialsFileEnv) + } + + if (file.exists()) file.readBytes() else null + } else { + null + } + } + + return testPlatform +} diff --git a/aws-runtime/aws-core/api/aws-core.api b/aws-runtime/aws-core/api/aws-core.api index a9a16afdca0..e4b891b34ee 100644 --- a/aws-runtime/aws-core/api/aws-core.api +++ b/aws-runtime/aws-core/api/aws-core.api @@ -38,15 +38,18 @@ public final class aws/sdk/kotlin/runtime/client/AwsClientOption { } public abstract interface class aws/sdk/kotlin/runtime/client/AwsSdkClientConfig : aws/smithy/kotlin/runtime/client/SdkClientConfig { + public abstract fun getApplicationId ()Ljava/lang/String; public abstract fun getRegion ()Ljava/lang/String; public abstract fun getUseDualStack ()Z public abstract fun getUseFips ()Z } public abstract interface class aws/sdk/kotlin/runtime/client/AwsSdkClientConfig$Builder { + public abstract fun getApplicationId ()Ljava/lang/String; public abstract fun getRegion ()Ljava/lang/String; public abstract fun getUseDualStack ()Ljava/lang/Boolean; public abstract fun getUseFips ()Ljava/lang/Boolean; + public abstract fun setApplicationId (Ljava/lang/String;)V public abstract fun setRegion (Ljava/lang/String;)V public abstract fun setUseDualStack (Ljava/lang/Boolean;)V public abstract fun setUseFips (Ljava/lang/Boolean;)V diff --git a/aws-runtime/aws-core/common/src/aws/sdk/kotlin/runtime/client/AwsSdkClientConfig.kt b/aws-runtime/aws-core/common/src/aws/sdk/kotlin/runtime/client/AwsSdkClientConfig.kt index 1849b79923a..b8073748e0e 100644 --- a/aws-runtime/aws-core/common/src/aws/sdk/kotlin/runtime/client/AwsSdkClientConfig.kt +++ b/aws-runtime/aws-core/common/src/aws/sdk/kotlin/runtime/client/AwsSdkClientConfig.kt @@ -32,6 +32,20 @@ public interface AwsSdkClientConfig : SdkClientConfig { */ public val useDualStack: Boolean + /** + * An optional application specific identifier. + * When set it will be appended to the User-Agent header of every request in the form of: `app/{applicationId}`. + * When not explicitly set, the value will be loaded from the following locations: + * + * - JVM System Property: `aws.userAgentAppId` + * - Environment variable: `AWS_SDK_UA_APP_ID` + * - Shared configuration profile attribute: `sdk_ua_app_id` + * + * See [shared configuration settings](https://docs.aws.amazon.com/sdkref/latest/guide/settings-reference.html) + * reference for more information on environment variables and shared config settings. + */ + public val applicationId: String? + public interface Builder { /** * The AWS region (e.g. `us-west-2`) to make requests to. See about AWS @@ -52,5 +66,19 @@ public interface AwsSdkClientConfig : SdkClientConfig { * Disabled by default. */ public var useDualStack: Boolean? + + /** + * An optional application specific identifier. + * When set it will be appended to the User-Agent header of every request in the form of: `app/{applicationId}`. + * When not explicitly set, the value will be loaded from the following locations: + * + * - JVM System Property: `aws.userAgentAppId` + * - Environment variable: `AWS_SDK_UA_APP_ID` + * - Shared configuration profile attribute: `sdk_ua_app_id` + * + * See [shared configuration settings](https://docs.aws.amazon.com/sdkref/latest/guide/settings-reference.html) + * reference for more information on environment variables and shared config settings. + */ + public var applicationId: String? } } diff --git a/aws-runtime/aws-http/api/aws-http.api b/aws-runtime/aws-http/api/aws-http.api index dd30c542798..bc37aa1159a 100644 --- a/aws-runtime/aws-http/api/aws-http.api +++ b/aws-runtime/aws-http/api/aws-http.api @@ -28,7 +28,13 @@ public final class aws/sdk/kotlin/runtime/http/AwsUserAgentMetadata { } public final class aws/sdk/kotlin/runtime/http/AwsUserAgentMetadata$Companion { - public final fun fromEnvironment (Laws/sdk/kotlin/runtime/http/ApiMetadata;)Laws/sdk/kotlin/runtime/http/AwsUserAgentMetadata; + public final fun fromEnvironment (Laws/sdk/kotlin/runtime/http/ApiMetadata;Ljava/lang/String;)Laws/sdk/kotlin/runtime/http/AwsUserAgentMetadata; + public static synthetic fun fromEnvironment$default (Laws/sdk/kotlin/runtime/http/AwsUserAgentMetadata$Companion;Laws/sdk/kotlin/runtime/http/ApiMetadata;Ljava/lang/String;ILjava/lang/Object;)Laws/sdk/kotlin/runtime/http/AwsUserAgentMetadata; +} + +public final class aws/sdk/kotlin/runtime/http/AwsUserAgentMetadataKt { + public static final field AWS_APP_ID_ENV Ljava/lang/String; + public static final field AWS_APP_ID_PROP Ljava/lang/String; } public final class aws/sdk/kotlin/runtime/http/operation/CustomUserAgentMetadata { diff --git a/aws-runtime/aws-http/common/src/aws/sdk/kotlin/runtime/http/AwsUserAgentMetadata.kt b/aws-runtime/aws-http/common/src/aws/sdk/kotlin/runtime/http/AwsUserAgentMetadata.kt index 12c69098f0b..c1ffdeffc9b 100644 --- a/aws-runtime/aws-http/common/src/aws/sdk/kotlin/runtime/http/AwsUserAgentMetadata.kt +++ b/aws-runtime/aws-http/common/src/aws/sdk/kotlin/runtime/http/AwsUserAgentMetadata.kt @@ -13,10 +13,10 @@ import aws.smithy.kotlin.runtime.util.* import kotlin.jvm.JvmInline internal const val AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV" -internal const val AWS_APP_ID_ENV = "AWS_SDK_UA_APP_ID" +public const val AWS_APP_ID_ENV: String = "AWS_SDK_UA_APP_ID" // non-standard environment variables/properties -internal const val AWS_APP_ID_PROP = "aws.userAgentAppId" +public const val AWS_APP_ID_PROP: String = "aws.userAgentAppId" internal const val FRAMEWORK_METADATA_ENV = "AWS_FRAMEWORK_METADATA" internal const val FRAMEWORK_METADATA_PROP = "aws.frameworkMetadata" @@ -39,7 +39,8 @@ public data class AwsUserAgentMetadata( */ public fun fromEnvironment( apiMeta: ApiMetadata, - ): AwsUserAgentMetadata = loadAwsUserAgentMetadataFromEnvironment(PlatformProvider.System, apiMeta) + appId: String? = null, + ): AwsUserAgentMetadata = loadAwsUserAgentMetadataFromEnvironment(PlatformProvider.System, apiMeta, appId) } /** @@ -87,12 +88,12 @@ public data class AwsUserAgentMetadata( get() = "$sdkMetadata" } -internal fun loadAwsUserAgentMetadataFromEnvironment(platform: PlatformProvider, apiMeta: ApiMetadata): AwsUserAgentMetadata { +internal fun loadAwsUserAgentMetadataFromEnvironment(platform: PlatformProvider, apiMeta: ApiMetadata, appIdValue: String? = null): AwsUserAgentMetadata { val sdkMeta = SdkMetadata("kotlin", apiMeta.version) val osInfo = platform.osInfo() val osMetadata = OsMetadata(osInfo.family, osInfo.version) val langMeta = platformLanguageMetadata() - val appId = platform.getProperty(AWS_APP_ID_PROP) ?: platform.getenv(AWS_APP_ID_ENV) + val appId = appIdValue ?: platform.getProperty(AWS_APP_ID_PROP) ?: platform.getenv(AWS_APP_ID_ENV) val frameworkMetadata = FrameworkMetadata.fromEnvironment(platform) val customMetadata = CustomUserAgentMetadata.fromEnvironment(platform) diff --git a/aws-runtime/aws-http/common/test/aws/sdk/kotlin/runtime/http/AwsUserAgentMetadataTest.kt b/aws-runtime/aws-http/common/test/aws/sdk/kotlin/runtime/http/AwsUserAgentMetadataTest.kt index c4ca4da4315..2cc28792ca2 100644 --- a/aws-runtime/aws-http/common/test/aws/sdk/kotlin/runtime/http/AwsUserAgentMetadataTest.kt +++ b/aws-runtime/aws-http/common/test/aws/sdk/kotlin/runtime/http/AwsUserAgentMetadataTest.kt @@ -109,4 +109,27 @@ class AwsUserAgentMetadataTest { actual.xAmzUserAgent.shouldContain(test.expected) } } + + @Test + fun testExplicitAppId() { + val testEnvironments = listOf( + EnvironmentTest( + TestPlatformProvider( + env = mapOf(AWS_APP_ID_ENV to "app-id-1"), + ), + "app/explicit-app-id", + ), + EnvironmentTest( + TestPlatformProvider( + env = mapOf(AWS_APP_ID_ENV to "app-id-1"), + props = mapOf(AWS_APP_ID_PROP to "app-id-2"), + ), + "app/explicit-app-id", + ), + ) + testEnvironments.forEach { test -> + val actual = loadAwsUserAgentMetadataFromEnvironment(test.provider, ApiMetadata("Test Service", "1.2.3"), "explicit-app-id") + actual.xAmzUserAgent.shouldContain(test.expected) + } + } } diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/AwsServiceConfigIntegration.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/AwsServiceConfigIntegration.kt index cfa36194033..1f9ca20f798 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/AwsServiceConfigIntegration.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/AwsServiceConfigIntegration.kt @@ -33,6 +33,26 @@ class AwsServiceConfigIntegration : KotlinIntegration { order = -100 } + val UserAgentAppId: ConfigProperty = ConfigProperty { + name = "applicationId" + symbol = KotlinTypes.String.asNullable() + baseClass = AwsRuntimeTypes.Core.Client.AwsSdkClientConfig + useNestedBuilderBaseClass() + documentation = """ + An optional application specific identifier. + When set it will be appended to the User-Agent header of every request in the form of: `app/{applicationId}`. + When not explicitly set, the value will be loaded from the following locations: + + - JVM System Property: `aws.userAgentAppId` + - Environment variable: `AWS_SDK_UA_APP_ID` + - Shared configuration profile attribute: `sdk_ua_app_id` + + See [shared configuration settings](https://docs.aws.amazon.com/sdkref/latest/guide/settings-reference.html) + reference for more information on environment variables and shared config settings. + """.trimIndent() + order = 100 + } + // override the credentials provider prop registered by the Sigv4AuthSchemeIntegration, updates the // documentation and sets a default value for AWS SDK to the default chain. val CredentialsProviderProp: ConfigProperty = ConfigProperty { @@ -158,5 +178,6 @@ class AwsServiceConfigIntegration : KotlinIntegration { add(UseDualStackProp) add(EndpointUrlProp) add(AwsRetryPolicy) + add(UserAgentAppId) } } diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/middleware/UserAgentMiddleware.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/middleware/UserAgentMiddleware.kt index 74ff72d77e3..0cd1a9fd03a 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/middleware/UserAgentMiddleware.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/middleware/UserAgentMiddleware.kt @@ -39,7 +39,11 @@ class UserAgentMiddleware : ProtocolMiddleware { writer.addImport(uaSymbol) writer.addImport(apiMetaSymbol) writer.addImport(middlewareSymbol) - writer.write("private val awsUserAgentMetadata = #T.fromEnvironment(#T(ServiceId, SdkVersion))", uaSymbol, apiMetaSymbol) + writer.write( + "private val awsUserAgentMetadata = #T.fromEnvironment(#T(ServiceId, SdkVersion), config.applicationId)", + uaSymbol, + apiMetaSymbol, + ) } override fun render(ctx: ProtocolGenerator.GenerationContext, op: OperationShape, writer: KotlinWriter) { From 52bb740ff87e05be08ea7998a56affccd2ae065b Mon Sep 17 00:00:00 2001 From: Ian Botsford <83236726+ianbotsf@users.noreply.github.com> Date: Thu, 12 Oct 2023 11:12:52 -0700 Subject: [PATCH 02/13] chore: sync for release (#1074) --- .../332e61e8-a33f-4bdb-b609-a2f977628ca4.json | 5 + codegen/sdk/aws-models/ec2.json | 46 ++--- codegen/sdk/aws-models/fsx.json | 65 ++++++- .../sdk/aws-models/marketplace-catalog.json | 47 +++-- codegen/sdk/aws-models/quicksight.json | 163 +++++++++++++++++- codegen/sdk/aws-models/transfer.json | 6 +- gradle/libs.versions.toml | 2 +- 7 files changed, 291 insertions(+), 43 deletions(-) create mode 100644 .changes/332e61e8-a33f-4bdb-b609-a2f977628ca4.json diff --git a/.changes/332e61e8-a33f-4bdb-b609-a2f977628ca4.json b/.changes/332e61e8-a33f-4bdb-b609-a2f977628ca4.json new file mode 100644 index 00000000000..7bc392f3bfa --- /dev/null +++ b/.changes/332e61e8-a33f-4bdb-b609-a2f977628ca4.json @@ -0,0 +1,5 @@ +{ + "id": "332e61e8-a33f-4bdb-b609-a2f977628ca4", + "type": "misc", + "description": "Sync to the latest versions of **smithy-kotlin** and AWS service models" +} \ No newline at end of file diff --git a/codegen/sdk/aws-models/ec2.json b/codegen/sdk/aws-models/ec2.json index 8d9b31253f2..12c476f0452 100644 --- a/codegen/sdk/aws-models/ec2.json +++ b/codegen/sdk/aws-models/ec2.json @@ -1575,7 +1575,7 @@ "NetworkBorderGroup": { "target": "com.amazonaws.ec2#String", "traits": { - "smithy.api#documentation": "

A unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services\n advertises IP addresses. Use this parameter to limit the IP address to this location. IP\n addresses cannot move between network border groups.

\n

Use DescribeAvailabilityZones to view the network border groups.

\n

You cannot use a network border group with EC2 Classic. If you attempt this operation on EC2 Classic, \n you receive an InvalidParameterCombination error.

" + "smithy.api#documentation": "

A unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services\n advertises IP addresses. Use this parameter to limit the IP address to this location. IP\n addresses cannot move between network border groups.

\n

Use DescribeAvailabilityZones to view the network border groups.

" } }, "CustomerOwnedIpv4Pool": { @@ -6502,7 +6502,7 @@ "target": "com.amazonaws.ec2#AssociateNatGatewayAddressResult" }, "traits": { - "smithy.api#documentation": "

Associates Elastic IP addresses (EIPs) and private IPv4 addresses with a public NAT gateway. For more information, \n see Work with NAT gateways in the Amazon VPC User Guide.

\n

By default, you can associate up to 2 Elastic IP addresses per public NAT gateway. You can increase the limit by requesting a quota adjustment. For more information, see Elastic IP address quotas in the Amazon VPC User Guide.

" + "smithy.api#documentation": "

Associates Elastic IP addresses (EIPs) and private IPv4 addresses with a public NAT gateway. For more information, \n see Work with NAT gateways in the Amazon VPC User Guide.

\n

By default, you can associate up to 2 Elastic IP addresses per public NAT gateway. You can increase the limit by requesting a quota adjustment. For more information, see Elastic IP address quotas in the Amazon VPC User Guide.

\n \n

When you associate an EIP or secondary EIPs with a public NAT gateway, the network border group of the EIPs must match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. If it's not the same, the EIP will fail to associate. You can see the network border group for the subnet's AZ by viewing the details of the subnet. Similarly, you can view the network border group of an EIP by viewing the details of the EIP address. For more information about network border groups and EIPs, see Allocate an Elastic IP address in the Amazon VPC User Guide. \n

\n
" } }, "com.amazonaws.ec2#AssociateNatGatewayAddressRequest": { @@ -9594,7 +9594,7 @@ "traits": { "aws.protocols#ec2QueryName": "ExportTaskId", "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The ID of the export task. This is the ID returned by CreateInstanceExportTask.

", + "smithy.api#documentation": "

The ID of the export task. This is the ID returned by the\n CreateInstanceExportTask and ExportImage operations.

", "smithy.api#required": {}, "smithy.api#xmlName": "exportTaskId" } @@ -14698,7 +14698,7 @@ "TagSpecifications": { "target": "com.amazonaws.ec2#TagSpecificationList", "traits": { - "smithy.api#documentation": "

The key-value pair for tagging the EC2 Fleet request on creation. For more information, see \n Tagging your resources.

\n

If the fleet type is instant, specify a resource type of fleet \n to tag the fleet or instance to tag the instances at launch.

\n

If the fleet type is maintain or request, specify a resource\n type of fleet to tag the fleet. You cannot specify a resource type of\n instance. To tag instances at launch, specify the tags in a launch template.

", + "smithy.api#documentation": "

The key-value pair for tagging the EC2 Fleet request on creation. For more information, see \n Tag your resources.

\n

If the fleet type is instant, specify a resource type of fleet \n to tag the fleet or instance to tag the instances at launch.

\n

If the fleet type is maintain or request, specify a resource\n type of fleet to tag the fleet. You cannot specify a resource type of\n instance. To tag instances at launch, specify the tags in a launch template.

", "smithy.api#xmlName": "TagSpecification" } }, @@ -16461,7 +16461,7 @@ "target": "com.amazonaws.ec2#CreateNatGatewayResult" }, "traits": { - "smithy.api#documentation": "

Creates a NAT gateway in the specified subnet. This action creates a network interface\n in the specified subnet with a private IP address from the IP address range of the\n subnet. You can create either a public NAT gateway or a private NAT gateway.

\n

With a public NAT gateway, internet-bound traffic from a private subnet can be routed\n to the NAT gateway, so that instances in a private subnet can connect to the internet.

\n

With a private NAT gateway, private communication is routed across VPCs and on-premises\n networks through a transit gateway or virtual private gateway. Common use cases include\n running large workloads behind a small pool of allowlisted IPv4 addresses, preserving\n private IPv4 addresses, and communicating between overlapping networks.

\n

For more information, see NAT gateways in the Amazon VPC User Guide.

", + "smithy.api#documentation": "

Creates a NAT gateway in the specified subnet. This action creates a network interface\n in the specified subnet with a private IP address from the IP address range of the\n subnet. You can create either a public NAT gateway or a private NAT gateway.

\n

With a public NAT gateway, internet-bound traffic from a private subnet can be routed\n to the NAT gateway, so that instances in a private subnet can connect to the internet.

\n

With a private NAT gateway, private communication is routed across VPCs and on-premises\n networks through a transit gateway or virtual private gateway. Common use cases include\n running large workloads behind a small pool of allowlisted IPv4 addresses, preserving\n private IPv4 addresses, and communicating between overlapping networks.

\n

For more information, see NAT gateways in the Amazon VPC User Guide.

\n \n

When you create a public NAT gateway and assign it an EIP or secondary EIPs, the network border group of the EIPs must match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. If it's not the same, the NAT gateway will fail to launch. You can see the network border group for the subnet's AZ by viewing the details of the subnet. Similarly, you can view the network border group of an EIP by viewing the details of the EIP address. For more information about network border groups and EIPs, see Allocate an Elastic IP address in the Amazon VPC User Guide. \n

\n
", "smithy.api#examples": [ { "title": "To create a NAT gateway", @@ -25695,7 +25695,7 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Deletes the specified VPC. You must detach or delete all gateways and resources that are associated with the VPC before you can delete it. For example, you must terminate all instances running in the VPC, delete all security groups associated with the VPC (except the default one), delete all route tables associated with the VPC (except the default one), and so on.

", + "smithy.api#documentation": "

Deletes the specified VPC. You must detach or delete all gateways and resources that are associated with the VPC before you can delete it. For example, you must terminate all instances running in the VPC, delete all security groups associated with the VPC (except the default one), delete all route tables associated with the VPC (except the default one), and so on. When you delete the VPC, it deletes the VPC's default security group, network ACL, and route table.

", "smithy.api#examples": [ { "title": "To delete a VPC", @@ -31821,7 +31821,7 @@ "Filters": { "target": "com.amazonaws.ec2#FilterList", "traits": { - "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n affinity - The affinity setting for an instance running on a\n Dedicated Host (default | host).

    \n
  • \n
  • \n

    \n architecture - The instance architecture (i386 |\n x86_64 | arm64).

    \n
  • \n
  • \n

    \n availability-zone - The Availability Zone of the instance.

    \n
  • \n
  • \n

    \n block-device-mapping.attach-time - The attach time for an EBS\n volume mapped to the instance, for example,\n 2022-09-15T17:15:20.000Z.

    \n
  • \n
  • \n

    \n block-device-mapping.delete-on-termination - A Boolean that\n indicates whether the EBS volume is deleted on instance termination.

    \n
  • \n
  • \n

    \n block-device-mapping.device-name - The device name specified in\n the block device mapping (for example, /dev/sdh or\n xvdh).

    \n
  • \n
  • \n

    \n block-device-mapping.status - The status for the EBS volume\n (attaching | attached | detaching |\n detached).

    \n
  • \n
  • \n

    \n block-device-mapping.volume-id - The volume ID of the EBS\n volume.

    \n
  • \n
  • \n

    \n boot-mode - The boot mode that was specified by the AMI\n (legacy-bios | uefi |\n uefi-preferred).

    \n
  • \n
  • \n

    \n capacity-reservation-id - The ID of the Capacity Reservation into which the\n instance was launched.

    \n
  • \n
  • \n

    \n capacity-reservation-specification.capacity-reservation-preference\n - The instance's Capacity Reservation preference (open | none).

    \n
  • \n
  • \n

    \n capacity-reservation-specification.capacity-reservation-target.capacity-reservation-id\n - The ID of the targeted Capacity Reservation.

    \n
  • \n
  • \n

    \n capacity-reservation-specification.capacity-reservation-target.capacity-reservation-resource-group-arn\n - The ARN of the targeted Capacity Reservation group.

    \n
  • \n
  • \n

    \n client-token - The idempotency token you provided when you\n launched the instance.

    \n
  • \n
  • \n

    \n current-instance-boot-mode - The boot mode that is used to launch\n the instance at launch or start (legacy-bios |\n uefi).

    \n
  • \n
  • \n

    \n dns-name - The public DNS name of the instance.

    \n
  • \n
  • \n

    \n ebs-optimized - A Boolean that indicates whether the instance is\n optimized for Amazon EBS I/O.

    \n
  • \n
  • \n

    \n ena-support - A Boolean that indicates whether the instance is\n enabled for enhanced networking with ENA.

    \n
  • \n
  • \n

    \n enclave-options.enabled - A Boolean that indicates whether the\n instance is enabled for Amazon Web Services Nitro Enclaves.

    \n
  • \n
  • \n

    \n hibernation-options.configured - A Boolean that indicates whether\n the instance is enabled for hibernation. A value of true means that\n the instance is enabled for hibernation.

    \n
  • \n
  • \n

    \n host-id - The ID of the Dedicated Host on which the instance is\n running, if applicable.

    \n
  • \n
  • \n

    \n hypervisor - The hypervisor type of the instance\n (ovm | xen). The value xen is used\n for both Xen and Nitro hypervisors.

    \n
  • \n
  • \n

    \n iam-instance-profile.arn - The instance profile associated with\n the instance. Specified as an ARN.

    \n
  • \n
  • \n

    \n iam-instance-profile.id - The instance profile associated with\n the instance. Specified as an ID.

    \n
  • \n
  • \n

    \n iam-instance-profile.name - The instance profile associated with\n the instance. Specified as an name.

    \n
  • \n
  • \n

    \n image-id - The ID of the image used to launch the\n instance.

    \n
  • \n
  • \n

    \n instance-id - The ID of the instance.

    \n
  • \n
  • \n

    \n instance-lifecycle - Indicates whether this is a Spot Instance or\n a Scheduled Instance (spot | scheduled).

    \n
  • \n
  • \n

    \n instance-state-code - The state of the instance, as a 16-bit\n unsigned integer. The high byte is used for internal purposes and should be\n ignored. The low byte is set based on the state represented. The valid values\n are: 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64\n (stopping), and 80 (stopped).

    \n
  • \n
  • \n

    \n instance-state-name - The state of the instance\n (pending | running | shutting-down |\n terminated | stopping |\n stopped).

    \n
  • \n
  • \n

    \n instance-type - The type of instance (for example,\n t2.micro).

    \n
  • \n
  • \n

    \n instance.group-id - The ID of the security group for the\n instance.

    \n
  • \n
  • \n

    \n instance.group-name - The name of the security group for the\n instance.

    \n
  • \n
  • \n

    \n ip-address - The public IPv4 address of the instance.

    \n
  • \n
  • \n

    \n ipv6-address - The IPv6 address of the instance.

    \n
  • \n
  • \n

    \n kernel-id - The kernel ID.

    \n
  • \n
  • \n

    \n key-name - The name of the key pair used when the instance was\n launched.

    \n
  • \n
  • \n

    \n launch-index - When launching multiple instances, this is the\n index for the instance in the launch group (for example, 0, 1, 2, and so on).\n

    \n
  • \n
  • \n

    \n launch-time - The time when the instance was launched, in the ISO\n 8601 format in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ), for example,\n 2021-09-29T11:04:43.305Z. You can use a wildcard\n (*), for example, 2021-09-29T*, which matches an\n entire day.

    \n
  • \n
  • \n

    \n license-pool -

    \n
  • \n
  • \n

    \n maintenance-options.auto-recovery - The current automatic\n recovery behavior of the instance (disabled | default).

    \n
  • \n
  • \n

    \n metadata-options.http-endpoint - The status of access to the HTTP\n metadata endpoint on your instance (enabled |\n disabled)

    \n
  • \n
  • \n

    \n metadata-options.http-protocol-ipv4 - Indicates whether the IPv4\n endpoint is enabled (disabled | enabled).

    \n
  • \n
  • \n

    \n metadata-options.http-protocol-ipv6 - Indicates whether the IPv6\n endpoint is enabled (disabled | enabled).

    \n
  • \n
  • \n

    \n metadata-options.http-put-response-hop-limit - The HTTP metadata\n request put response hop limit (integer, possible values 1 to\n 64)

    \n
  • \n
  • \n

    \n metadata-options.http-tokens - The metadata request authorization\n state (optional | required)

    \n
  • \n
  • \n

    \n metadata-options.instance-metadata-tags - The status of access to\n instance tags from the instance metadata (enabled |\n disabled)

    \n
  • \n
  • \n

    \n metadata-options.state - The state of the metadata option changes\n (pending | applied).

    \n
  • \n
  • \n

    \n monitoring-state - Indicates whether detailed monitoring is\n enabled (disabled | enabled).

    \n
  • \n
  • \n

    \n network-interface.addresses.primary - Specifies whether the IPv4\n address of the network interface is the primary private IPv4 address.

    \n
  • \n
  • \n

    \n network-interface.addresses.private-ip-address - The private IPv4\n address associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.addresses.association.public-ip - The ID of the\n association of an Elastic IP address (IPv4) with a network interface.

    \n
  • \n
  • \n

    \n network-interface.addresses.association.ip-owner-id - The owner\n ID of the private IPv4 address associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.association.public-ip - The address of the\n Elastic IP address (IPv4) bound to the network interface.

    \n
  • \n
  • \n

    \n network-interface.association.ip-owner-id - The owner of the\n Elastic IP address (IPv4) associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.association.allocation-id - The allocation ID\n returned when you allocated the Elastic IP address (IPv4) for your network\n interface.

    \n
  • \n
  • \n

    \n network-interface.association.association-id - The association ID\n returned when the network interface was associated with an IPv4 address.

    \n
  • \n
  • \n

    \n network-interface.attachment.attachment-id - The ID of the\n interface attachment.

    \n
  • \n
  • \n

    \n network-interface.attachment.instance-id - The ID of the instance\n to which the network interface is attached.

    \n
  • \n
  • \n

    \n network-interface.attachment.instance-owner-id - The owner ID of\n the instance to which the network interface is attached.

    \n
  • \n
  • \n

    \n network-interface.attachment.device-index - The device index to\n which the network interface is attached.

    \n
  • \n
  • \n

    \n network-interface.attachment.status - The status of the\n attachment (attaching | attached |\n detaching | detached).

    \n
  • \n
  • \n

    \n network-interface.attachment.attach-time - The time that the\n network interface was attached to an instance.

    \n
  • \n
  • \n

    \n network-interface.attachment.delete-on-termination - Specifies\n whether the attachment is deleted when an instance is terminated.

    \n
  • \n
  • \n

    \n network-interface.availability-zone - The Availability Zone for\n the network interface.

    \n
  • \n
  • \n

    \n network-interface.description - The description of the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.group-id - The ID of a security group\n associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.group-name - The name of a security group\n associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.ipv6-addresses.ipv6-address - The IPv6 address\n associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.mac-address - The MAC address of the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.network-interface-id - The ID of the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.owner-id - The ID of the owner of the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.private-dns-name - The private DNS name of the\n network interface.

    \n
  • \n
  • \n

    \n network-interface.requester-id - The requester ID for the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.requester-managed - Indicates whether the\n network interface is being managed by Amazon Web Services.

    \n
  • \n
  • \n

    \n network-interface.status - The status of the network interface\n (available) | in-use).

    \n
  • \n
  • \n

    \n network-interface.source-dest-check - Whether the network\n interface performs source/destination checking. A value of true\n means that checking is enabled, and false means that checking is\n disabled. The value must be false for the network interface to\n perform network address translation (NAT) in your VPC.

    \n
  • \n
  • \n

    \n network-interface.subnet-id - The ID of the subnet for the\n network interface.

    \n
  • \n
  • \n

    \n network-interface.vpc-id - The ID of the VPC for the network\n interface.

    \n
  • \n
  • \n

    \n outpost-arn - The Amazon Resource Name (ARN) of the\n Outpost.

    \n
  • \n
  • \n

    \n owner-id - The Amazon Web Services account ID of the instance\n owner.

    \n
  • \n
  • \n

    \n placement-group-name - The name of the placement group for the\n instance.

    \n
  • \n
  • \n

    \n placement-partition-number - The partition in which the instance is\n located.

    \n
  • \n
  • \n

    \n platform - The platform. To list only Windows instances, use\n windows.

    \n
  • \n
  • \n

    \n platform-details - The platform (Linux/UNIX |\n Red Hat BYOL Linux | Red Hat Enterprise Linux |\n Red Hat Enterprise Linux with HA | Red Hat Enterprise\n Linux with SQL Server Standard and HA | Red Hat Enterprise\n Linux with SQL Server Enterprise and HA | Red Hat Enterprise\n Linux with SQL Server Standard | Red Hat Enterprise Linux with\n SQL Server Web | Red Hat Enterprise Linux with SQL Server\n Enterprise | SQL Server Enterprise | SQL Server\n Standard | SQL Server Web | SUSE Linux |\n Ubuntu Pro | Windows | Windows BYOL |\n Windows with SQL Server Enterprise | Windows with SQL\n Server Standard | Windows with SQL Server Web).

    \n
  • \n
  • \n

    \n private-dns-name - The private IPv4 DNS name of the\n instance.

    \n
  • \n
  • \n

    \n private-dns-name-options.enable-resource-name-dns-a-record - A\n Boolean that indicates whether to respond to DNS queries for instance hostnames\n with DNS A records.

    \n
  • \n
  • \n

    \n private-dns-name-options.enable-resource-name-dns-aaaa-record - A\n Boolean that indicates whether to respond to DNS queries for instance hostnames\n with DNS AAAA records.

    \n
  • \n
  • \n

    \n private-dns-name-options.hostname-type - The type of hostname\n (ip-name | resource-name).

    \n
  • \n
  • \n

    \n private-ip-address - The private IPv4 address of the\n instance.

    \n
  • \n
  • \n

    \n product-code - The product code associated with the AMI used to\n launch the instance.

    \n
  • \n
  • \n

    \n product-code.type - The type of product code (devpay\n | marketplace).

    \n
  • \n
  • \n

    \n ramdisk-id - The RAM disk ID.

    \n
  • \n
  • \n

    \n reason - The reason for the current state of the instance (for\n example, shows \"User Initiated [date]\" when you stop or terminate the instance).\n Similar to the state-reason-code filter.

    \n
  • \n
  • \n

    \n requester-id - The ID of the entity that launched the instance on\n your behalf (for example, Amazon Web Services Management Console, Auto Scaling, and so\n on).

    \n
  • \n
  • \n

    \n reservation-id - The ID of the instance's reservation. A\n reservation ID is created any time you launch an instance. A reservation ID has\n a one-to-one relationship with an instance launch request, but can be associated\n with more than one instance if you launch multiple instances using the same\n launch request. For example, if you launch one instance, you get one reservation\n ID. If you launch ten instances using the same launch request, you also get one\n reservation ID.

    \n
  • \n
  • \n

    \n root-device-name - The device name of the root device volume (for\n example, /dev/sda1).

    \n
  • \n
  • \n

    \n root-device-type - The type of the root device volume\n (ebs | instance-store).

    \n
  • \n
  • \n

    \n source-dest-check - Indicates whether the instance performs\n source/destination checking. A value of true means that checking is\n enabled, and false means that checking is disabled. The value must\n be false for the instance to perform network address translation\n (NAT) in your VPC.

    \n
  • \n
  • \n

    \n spot-instance-request-id - The ID of the Spot Instance\n request.

    \n
  • \n
  • \n

    \n state-reason-code - The reason code for the state change.

    \n
  • \n
  • \n

    \n state-reason-message - A message that describes the state\n change.

    \n
  • \n
  • \n

    \n subnet-id - The ID of the subnet for the instance.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources that have a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n tenancy - The tenancy of an instance (dedicated |\n default | host).

    \n
  • \n
  • \n

    \n tpm-support - Indicates if the instance is configured for\n NitroTPM support (v2.0).

    \n
  • \n
  • \n

    \n usage-operation - The usage operation value for the instance\n (RunInstances | RunInstances:00g0 |\n RunInstances:0010 | RunInstances:1010 |\n RunInstances:1014 | RunInstances:1110 |\n RunInstances:0014 | RunInstances:0210 |\n RunInstances:0110 | RunInstances:0100 |\n RunInstances:0004 | RunInstances:0200 |\n RunInstances:000g | RunInstances:0g00 |\n RunInstances:0002 | RunInstances:0800 |\n RunInstances:0102 | RunInstances:0006 |\n RunInstances:0202).

    \n
  • \n
  • \n

    \n usage-operation-update-time - The time that the usage operation\n was last updated, for example, 2022-09-15T17:15:20.000Z.

    \n
  • \n
  • \n

    \n virtualization-type - The virtualization type of the instance\n (paravirtual | hvm).

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC that the instance is running in.

    \n
  • \n
", + "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n affinity - The affinity setting for an instance running on a\n Dedicated Host (default | host).

    \n
  • \n
  • \n

    \n architecture - The instance architecture (i386 |\n x86_64 | arm64).

    \n
  • \n
  • \n

    \n availability-zone - The Availability Zone of the instance.

    \n
  • \n
  • \n

    \n block-device-mapping.attach-time - The attach time for an EBS\n volume mapped to the instance, for example,\n 2022-09-15T17:15:20.000Z.

    \n
  • \n
  • \n

    \n block-device-mapping.delete-on-termination - A Boolean that\n indicates whether the EBS volume is deleted on instance termination.

    \n
  • \n
  • \n

    \n block-device-mapping.device-name - The device name specified in\n the block device mapping (for example, /dev/sdh or\n xvdh).

    \n
  • \n
  • \n

    \n block-device-mapping.status - The status for the EBS volume\n (attaching | attached | detaching |\n detached).

    \n
  • \n
  • \n

    \n block-device-mapping.volume-id - The volume ID of the EBS\n volume.

    \n
  • \n
  • \n

    \n boot-mode - The boot mode that was specified by the AMI\n (legacy-bios | uefi |\n uefi-preferred).

    \n
  • \n
  • \n

    \n capacity-reservation-id - The ID of the Capacity Reservation into which the\n instance was launched.

    \n
  • \n
  • \n

    \n capacity-reservation-specification.capacity-reservation-preference\n - The instance's Capacity Reservation preference (open | none).

    \n
  • \n
  • \n

    \n capacity-reservation-specification.capacity-reservation-target.capacity-reservation-id\n - The ID of the targeted Capacity Reservation.

    \n
  • \n
  • \n

    \n capacity-reservation-specification.capacity-reservation-target.capacity-reservation-resource-group-arn\n - The ARN of the targeted Capacity Reservation group.

    \n
  • \n
  • \n

    \n client-token - The idempotency token you provided when you\n launched the instance.

    \n
  • \n
  • \n

    \n current-instance-boot-mode - The boot mode that is used to launch\n the instance at launch or start (legacy-bios |\n uefi).

    \n
  • \n
  • \n

    \n dns-name - The public DNS name of the instance.

    \n
  • \n
  • \n

    \n ebs-optimized - A Boolean that indicates whether the instance is\n optimized for Amazon EBS I/O.

    \n
  • \n
  • \n

    \n ena-support - A Boolean that indicates whether the instance is\n enabled for enhanced networking with ENA.

    \n
  • \n
  • \n

    \n enclave-options.enabled - A Boolean that indicates whether the\n instance is enabled for Amazon Web Services Nitro Enclaves.

    \n
  • \n
  • \n

    \n hibernation-options.configured - A Boolean that indicates whether\n the instance is enabled for hibernation. A value of true means that\n the instance is enabled for hibernation.

    \n
  • \n
  • \n

    \n host-id - The ID of the Dedicated Host on which the instance is\n running, if applicable.

    \n
  • \n
  • \n

    \n hypervisor - The hypervisor type of the instance\n (ovm | xen). The value xen is used\n for both Xen and Nitro hypervisors.

    \n
  • \n
  • \n

    \n iam-instance-profile.arn - The instance profile associated with\n the instance. Specified as an ARN.

    \n
  • \n
  • \n

    \n iam-instance-profile.id - The instance profile associated with\n the instance. Specified as an ID.

    \n
  • \n
  • \n

    \n iam-instance-profile.name - The instance profile associated with\n the instance. Specified as an name.

    \n
  • \n
  • \n

    \n image-id - The ID of the image used to launch the\n instance.

    \n
  • \n
  • \n

    \n instance-id - The ID of the instance.

    \n
  • \n
  • \n

    \n instance-lifecycle - Indicates whether this is a Spot Instance or\n a Scheduled Instance (spot | scheduled).

    \n
  • \n
  • \n

    \n instance-state-code - The state of the instance, as a 16-bit\n unsigned integer. The high byte is used for internal purposes and should be\n ignored. The low byte is set based on the state represented. The valid values\n are: 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64\n (stopping), and 80 (stopped).

    \n
  • \n
  • \n

    \n instance-state-name - The state of the instance\n (pending | running | shutting-down |\n terminated | stopping |\n stopped).

    \n
  • \n
  • \n

    \n instance-type - The type of instance (for example,\n t2.micro).

    \n
  • \n
  • \n

    \n instance.group-id - The ID of the security group for the\n instance.

    \n
  • \n
  • \n

    \n instance.group-name - The name of the security group for the\n instance.

    \n
  • \n
  • \n

    \n ip-address - The public IPv4 address of the instance.

    \n
  • \n
  • \n

    \n ipv6-address - The IPv6 address of the instance.

    \n
  • \n
  • \n

    \n kernel-id - The kernel ID.

    \n
  • \n
  • \n

    \n key-name - The name of the key pair used when the instance was\n launched.

    \n
  • \n
  • \n

    \n launch-index - When launching multiple instances, this is the\n index for the instance in the launch group (for example, 0, 1, 2, and so on).\n

    \n
  • \n
  • \n

    \n launch-time - The time when the instance was launched, in the ISO\n 8601 format in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ), for example,\n 2021-09-29T11:04:43.305Z. You can use a wildcard\n (*), for example, 2021-09-29T*, which matches an\n entire day.

    \n
  • \n
  • \n

    \n maintenance-options.auto-recovery - The current automatic\n recovery behavior of the instance (disabled | default).

    \n
  • \n
  • \n

    \n metadata-options.http-endpoint - The status of access to the HTTP\n metadata endpoint on your instance (enabled |\n disabled)

    \n
  • \n
  • \n

    \n metadata-options.http-protocol-ipv4 - Indicates whether the IPv4\n endpoint is enabled (disabled | enabled).

    \n
  • \n
  • \n

    \n metadata-options.http-protocol-ipv6 - Indicates whether the IPv6\n endpoint is enabled (disabled | enabled).

    \n
  • \n
  • \n

    \n metadata-options.http-put-response-hop-limit - The HTTP metadata\n request put response hop limit (integer, possible values 1 to\n 64)

    \n
  • \n
  • \n

    \n metadata-options.http-tokens - The metadata request authorization\n state (optional | required)

    \n
  • \n
  • \n

    \n metadata-options.instance-metadata-tags - The status of access to\n instance tags from the instance metadata (enabled |\n disabled)

    \n
  • \n
  • \n

    \n metadata-options.state - The state of the metadata option changes\n (pending | applied).

    \n
  • \n
  • \n

    \n monitoring-state - Indicates whether detailed monitoring is\n enabled (disabled | enabled).

    \n
  • \n
  • \n

    \n network-interface.addresses.association.allocation-id - The allocation ID.

    \n
  • \n
  • \n

    \n network-interface.addresses.association.association-id - The association ID.

    \n
  • \n
  • \n

    \n network-interface.addresses.association.carrier-ip - The carrier IP address.

    \n
  • \n
  • \n

    \n network-interface.addresses.association.customer-owned-ip - The customer-owned IP address.

    \n
  • \n
  • \n

    \n network-interface.addresses.association.ip-owner-id - The owner\n ID of the private IPv4 address associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.addresses.association.public-dns-name - The public DNS name.

    \n
  • \n
  • \n

    \n network-interface.addresses.association.public-ip - The ID of the\n association of an Elastic IP address (IPv4) with a network interface.

    \n
  • \n
  • \n

    \n network-interface.addresses.primary - Specifies whether the IPv4\n address of the network interface is the primary private IPv4 address.

    \n
  • \n
  • \n

    \n network-interface.addresses.private-dns-name - The private DNS name.

    \n
  • \n
  • \n

    \n network-interface.addresses.private-ip-address - The private IPv4\n address associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.association.allocation-id - The allocation ID\n returned when you allocated the Elastic IP address (IPv4) for your network\n interface.

    \n
  • \n
  • \n

    \n network-interface.association.association-id - The association ID\n returned when the network interface was associated with an IPv4 address.

    \n
  • \n
  • \n

    \n network-interface.association.carrier-ip - The customer-owned IP address.

    \n
  • \n
  • \n

    \n network-interface.association.customer-owned-ip - The customer-owned IP address.

    \n
  • \n
  • \n

    \n network-interface.association.ip-owner-id - The owner of the\n Elastic IP address (IPv4) associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.association.public-dns-name - The public DNS name.

    \n
  • \n
  • \n

    \n network-interface.association.public-ip - The address of the\n Elastic IP address (IPv4) bound to the network interface.

    \n
  • \n
  • \n

    \n network-interface.attachment.attach-time - The time that the\n network interface was attached to an instance.

    \n
  • \n
  • \n

    \n network-interface.attachment.attachment-id - The ID of the\n interface attachment.

    \n
  • \n
  • \n

    \n network-interface.attachment.delete-on-termination - Specifies\n whether the attachment is deleted when an instance is terminated.

    \n
  • \n
  • \n

    \n network-interface.attachment.device-index - The device index to\n which the network interface is attached.

    \n
  • \n
  • \n

    \n network-interface.attachment.instance-id - The ID of the instance\n to which the network interface is attached.

    \n
  • \n
  • \n

    \n network-interface.attachment.instance-owner-id - The owner ID of\n the instance to which the network interface is attached.

    \n
  • \n
  • \n

    \n network-interface.attachment.network-card-index - The index of the network card.

    \n
  • \n
  • \n

    \n network-interface.attachment.status - The status of the\n attachment (attaching | attached |\n detaching | detached).

    \n
  • \n
  • \n

    \n network-interface.availability-zone - The Availability Zone for\n the network interface.

    \n
  • \n
  • \n

    \n network-interface.deny-all-igw-traffic - A Boolean that indicates whether \n a network interface with an IPv6 address is unreachable from the public internet.

    \n
  • \n
  • \n

    \n network-interface.description - The description of the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.group-id - The ID of a security group\n associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.group-name - The name of a security group\n associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.ipv4-prefixes.ipv4-prefix - The IPv4 prefixes that are assigned to the network interface.

    \n
  • \n
  • \n

    \n network-interface.ipv6-address - The IPv6 address associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.ipv6-addresses.ipv6-address - The IPv6 address\n associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.ipv6-addresses.is-primary-ipv6 - A Boolean that indicates whether this\n is the primary IPv6 address.

    \n
  • \n
  • \n

    \n network-interface.ipv6-native - A Boolean that indicates whether this is\n an IPv6 only network interface.

    \n
  • \n
  • \n

    \n network-interface.ipv6-prefixes.ipv6-prefix - The IPv6 prefix assigned to the network interface.

    \n
  • \n
  • \n

    \n network-interface.mac-address - The MAC address of the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.network-interface-id - The ID of the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.outpost-arn - The ARN of the Outpost.

    \n
  • \n
  • \n

    \n network-interface.owner-id - The ID of the owner of the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.private-dns-name - The private DNS name of the\n network interface.

    \n
  • \n
  • \n

    \n network-interface.private-ip-address - The private IPv4 address.

    \n
  • \n
  • \n

    \n network-interface.public-dns-name - The public DNS name.

    \n
  • \n
  • \n

    \n network-interface.requester-id - The requester ID for the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.requester-managed - Indicates whether the\n network interface is being managed by Amazon Web Services.

    \n
  • \n
  • \n

    \n network-interface.status - The status of the network interface\n (available) | in-use).

    \n
  • \n
  • \n

    \n network-interface.source-dest-check - Whether the network\n interface performs source/destination checking. A value of true\n means that checking is enabled, and false means that checking is\n disabled. The value must be false for the network interface to\n perform network address translation (NAT) in your VPC.

    \n
  • \n
  • \n

    \n network-interface.subnet-id - The ID of the subnet for the\n network interface.

    \n
  • \n
  • \n

    \n network-interface.tag-key - The key of a tag assigned to the network interface.

    \n
  • \n
  • \n

    \n network-interface.tag-value - The value of a tag assigned to the network interface.

    \n
  • \n
  • \n

    \n network-interface.vpc-id - The ID of the VPC for the network\n interface.

    \n
  • \n
  • \n

    \n outpost-arn - The Amazon Resource Name (ARN) of the\n Outpost.

    \n
  • \n
  • \n

    \n owner-id - The Amazon Web Services account ID of the instance\n owner.

    \n
  • \n
  • \n

    \n placement-group-name - The name of the placement group for the\n instance.

    \n
  • \n
  • \n

    \n placement-partition-number - The partition in which the instance is\n located.

    \n
  • \n
  • \n

    \n platform - The platform. To list only Windows instances, use\n windows.

    \n
  • \n
  • \n

    \n platform-details - The platform (Linux/UNIX |\n Red Hat BYOL Linux | Red Hat Enterprise Linux |\n Red Hat Enterprise Linux with HA | Red Hat Enterprise\n Linux with SQL Server Standard and HA | Red Hat Enterprise\n Linux with SQL Server Enterprise and HA | Red Hat Enterprise\n Linux with SQL Server Standard | Red Hat Enterprise Linux with\n SQL Server Web | Red Hat Enterprise Linux with SQL Server\n Enterprise | SQL Server Enterprise | SQL Server\n Standard | SQL Server Web | SUSE Linux |\n Ubuntu Pro | Windows | Windows BYOL |\n Windows with SQL Server Enterprise | Windows with SQL\n Server Standard | Windows with SQL Server Web).

    \n
  • \n
  • \n

    \n private-dns-name - The private IPv4 DNS name of the\n instance.

    \n
  • \n
  • \n

    \n private-dns-name-options.enable-resource-name-dns-a-record - A\n Boolean that indicates whether to respond to DNS queries for instance hostnames\n with DNS A records.

    \n
  • \n
  • \n

    \n private-dns-name-options.enable-resource-name-dns-aaaa-record - A\n Boolean that indicates whether to respond to DNS queries for instance hostnames\n with DNS AAAA records.

    \n
  • \n
  • \n

    \n private-dns-name-options.hostname-type - The type of hostname\n (ip-name | resource-name).

    \n
  • \n
  • \n

    \n private-ip-address - The private IPv4 address of the\n instance.

    \n
  • \n
  • \n

    \n product-code - The product code associated with the AMI used to\n launch the instance.

    \n
  • \n
  • \n

    \n product-code.type - The type of product code (devpay\n | marketplace).

    \n
  • \n
  • \n

    \n ramdisk-id - The RAM disk ID.

    \n
  • \n
  • \n

    \n reason - The reason for the current state of the instance (for\n example, shows \"User Initiated [date]\" when you stop or terminate the instance).\n Similar to the state-reason-code filter.

    \n
  • \n
  • \n

    \n requester-id - The ID of the entity that launched the instance on\n your behalf (for example, Amazon Web Services Management Console, Auto Scaling, and so\n on).

    \n
  • \n
  • \n

    \n reservation-id - The ID of the instance's reservation. A\n reservation ID is created any time you launch an instance. A reservation ID has\n a one-to-one relationship with an instance launch request, but can be associated\n with more than one instance if you launch multiple instances using the same\n launch request. For example, if you launch one instance, you get one reservation\n ID. If you launch ten instances using the same launch request, you also get one\n reservation ID.

    \n
  • \n
  • \n

    \n root-device-name - The device name of the root device volume (for\n example, /dev/sda1).

    \n
  • \n
  • \n

    \n root-device-type - The type of the root device volume\n (ebs | instance-store).

    \n
  • \n
  • \n

    \n source-dest-check - Indicates whether the instance performs\n source/destination checking. A value of true means that checking is\n enabled, and false means that checking is disabled. The value must\n be false for the instance to perform network address translation\n (NAT) in your VPC.

    \n
  • \n
  • \n

    \n spot-instance-request-id - The ID of the Spot Instance\n request.

    \n
  • \n
  • \n

    \n state-reason-code - The reason code for the state change.

    \n
  • \n
  • \n

    \n state-reason-message - A message that describes the state\n change.

    \n
  • \n
  • \n

    \n subnet-id - The ID of the subnet for the instance.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources that have a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n tenancy - The tenancy of an instance (dedicated |\n default | host).

    \n
  • \n
  • \n

    \n tpm-support - Indicates if the instance is configured for\n NitroTPM support (v2.0).

    \n
  • \n
  • \n

    \n usage-operation - The usage operation value for the instance\n (RunInstances | RunInstances:00g0 |\n RunInstances:0010 | RunInstances:1010 |\n RunInstances:1014 | RunInstances:1110 |\n RunInstances:0014 | RunInstances:0210 |\n RunInstances:0110 | RunInstances:0100 |\n RunInstances:0004 | RunInstances:0200 |\n RunInstances:000g | RunInstances:0g00 |\n RunInstances:0002 | RunInstances:0800 |\n RunInstances:0102 | RunInstances:0006 |\n RunInstances:0202).

    \n
  • \n
  • \n

    \n usage-operation-update-time - The time that the usage operation\n was last updated, for example, 2022-09-15T17:15:20.000Z.

    \n
  • \n
  • \n

    \n virtualization-type - The virtualization type of the instance\n (paravirtual | hvm).

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC that the instance is running in.

    \n
  • \n
", "smithy.api#xmlName": "Filter" } }, @@ -34652,7 +34652,7 @@ "target": "com.amazonaws.ec2#DescribeNetworkInterfacesResult" }, "traits": { - "smithy.api#documentation": "

Describes one or more of your network interfaces.

", + "smithy.api#documentation": "

Describes one or more of your network interfaces.

\n

If you have a large number of network interfaces, the operation fails unless \n you use pagination or one of the following filters: group-id, \n mac-address, private-dns-name, private-ip-address, \n private-dns-name, subnet-id, or vpc-id.

", "smithy.api#examples": [ { "title": "To describe a network interface", @@ -34768,7 +34768,7 @@ "target": "com.amazonaws.ec2#FilterList", "traits": { "aws.protocols#ec2QueryName": "Filter", - "smithy.api#documentation": "

One or more filters.

\n
    \n
  • \n

    \n addresses.private-ip-address - The private IPv4 addresses\n associated with the network interface.

    \n
  • \n
  • \n

    \n addresses.primary - Whether the private IPv4 address is the primary\n IP address associated with the network interface.

    \n
  • \n
  • \n

    \n addresses.association.public-ip - The association ID returned when\n the network interface was associated with the Elastic IP address\n (IPv4).

    \n
  • \n
  • \n

    \n addresses.association.owner-id - The owner ID of the addresses associated with the network interface.

    \n
  • \n
  • \n

    \n association.association-id - The association ID returned when the\n network interface was associated with an IPv4 address.

    \n
  • \n
  • \n

    \n association.allocation-id - The allocation ID returned when you\n allocated the Elastic IP address (IPv4) for your network interface.

    \n
  • \n
  • \n

    \n association.ip-owner-id - The owner of the Elastic IP address\n (IPv4) associated with the network interface.

    \n
  • \n
  • \n

    \n association.public-ip - The address of the Elastic IP address\n (IPv4) bound to the network interface.

    \n
  • \n
  • \n

    \n association.public-dns-name - The public DNS name for the network\n interface (IPv4).

    \n
  • \n
  • \n

    \n attachment.attachment-id - The ID of the interface attachment.

    \n
  • \n
  • \n

    \n attachment.attach-time - The time that the network interface was attached to an instance.

    \n
  • \n
  • \n

    \n attachment.delete-on-termination - Indicates whether the attachment is deleted when an instance is terminated.

    \n
  • \n
  • \n

    \n attachment.device-index - The device index to which the network interface is attached.

    \n
  • \n
  • \n

    \n attachment.instance-id - The ID of the instance to which the network interface is attached.

    \n
  • \n
  • \n

    \n attachment.instance-owner-id - The owner ID of the instance to which the network interface is attached.

    \n
  • \n
  • \n

    \n attachment.status - The status of the attachment (attaching | attached | detaching | detached).

    \n
  • \n
  • \n

    \n availability-zone - The Availability Zone of the network interface.

    \n
  • \n
  • \n

    \n description - The description of the network interface.

    \n
  • \n
  • \n

    \n group-id - The ID of a security group associated with the network interface.

    \n
  • \n
  • \n

    \n group-name - The name of a security group associated with the network interface.

    \n
  • \n
  • \n

    \n ipv6-addresses.ipv6-address - An IPv6 address associated with\n the network interface.

    \n
  • \n
  • \n

    \n interface-type - The type of network interface (api_gateway_managed | \n\t\t aws_codestar_connections_managed | branch | efa | \n\t\t gateway_load_balancer | gateway_load_balancer_endpoint | global_accelerator_managed | \n\t\t interface | iot_rules_managed | lambda | load_balancer | \n\t\t nat_gateway | network_load_balancer | quicksight | \n\t\t transit_gateway | trunk | vpc_endpoint).

    \n
  • \n
  • \n

    \n mac-address - The MAC address of the network interface.

    \n
  • \n
  • \n

    \n network-interface-id - The ID of the network interface.

    \n
  • \n
  • \n

    \n owner-id - The Amazon Web Services account ID of the network interface owner.

    \n
  • \n
  • \n

    \n private-ip-address - The private IPv4 address or addresses of the\n network interface.

    \n
  • \n
  • \n

    \n private-dns-name - The private DNS name of the network interface (IPv4).

    \n
  • \n
  • \n

    \n requester-id - The alias or Amazon Web Services account ID of the principal or service that created the network interface.

    \n
  • \n
  • \n

    \n requester-managed - Indicates whether the network interface is being managed by an Amazon Web Service \n\t\t (for example, Amazon Web Services Management Console, Auto Scaling, and so on).

    \n
  • \n
  • \n

    \n source-dest-check - Indicates whether the network interface performs source/destination checking. \n\t\t A value of true means checking is enabled, and false means checking is disabled. \n\t\t The value must be false for the network interface to perform network address translation (NAT) in your VPC.

    \n
  • \n
  • \n

    \n status - The status of the network interface. If the network interface is not attached to an instance, the status is available; \n\t\t if a network interface is attached to an instance the status is in-use.

    \n
  • \n
  • \n

    \n subnet-id - The ID of the subnet for the network interface.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC for the network interface.

    \n
  • \n
", + "smithy.api#documentation": "

One or more filters.

\n
    \n
  • \n

    \n association.allocation-id - The allocation ID returned when you\n\t\t allocated the Elastic IP address (IPv4) for your network interface.

    \n
  • \n
  • \n

    \n association.association-id - The association ID returned when the\n\t\t network interface was associated with an IPv4 address.

    \n
  • \n
  • \n

    \n addresses.association.owner-id - The owner ID of the addresses associated with the network interface.

    \n
  • \n
  • \n

    \n addresses.association.public-ip - The association ID returned when\n\t\t the network interface was associated with the Elastic IP address\n\t\t (IPv4).

    \n
  • \n
  • \n

    \n addresses.primary - Whether the private IPv4 address is the primary\n IP address associated with the network interface.

    \n
  • \n
  • \n

    \n addresses.private-ip-address - The private IPv4 addresses\n\t\t associated with the network interface.

    \n
  • \n
  • \n

    \n association.ip-owner-id - The owner of the Elastic IP address\n (IPv4) associated with the network interface.

    \n
  • \n
  • \n

    \n association.public-ip - The address of the Elastic IP address\n (IPv4) bound to the network interface.

    \n
  • \n
  • \n

    \n association.public-dns-name - The public DNS name for the network\n interface (IPv4).

    \n
  • \n
  • \n

    \n attachment.attach-time - The time that the network interface was attached to an instance.

    \n
  • \n
  • \n

    \n attachment.attachment-id - The ID of the interface attachment.

    \n
  • \n
  • \n

    \n attachment.delete-on-termination - Indicates whether the attachment is deleted when an instance is terminated.

    \n
  • \n
  • \n

    \n attachment.device-index - The device index to which the network interface is attached.

    \n
  • \n
  • \n

    \n attachment.instance-id - The ID of the instance to which the network interface is attached.

    \n
  • \n
  • \n

    \n attachment.instance-owner-id - The owner ID of the instance to which the network interface is attached.

    \n
  • \n
  • \n

    \n attachment.status - The status of the attachment (attaching | attached | detaching | detached).

    \n
  • \n
  • \n

    \n availability-zone - The Availability Zone of the network interface.

    \n
  • \n
  • \n

    \n description - The description of the network interface.

    \n
  • \n
  • \n

    \n group-id - The ID of a security group associated with the network interface.

    \n
  • \n
  • \n

    \n ipv6-addresses.ipv6-address - An IPv6 address associated with\n the network interface.

    \n
  • \n
  • \n

    \n interface-type - The type of network interface (api_gateway_managed | \n\t\t aws_codestar_connections_managed | branch | \n\t\t ec2_instance_connect_endpoint | efa | efs | \n\t\t gateway_load_balancer | gateway_load_balancer_endpoint | \n\t\t global_accelerator_managed | \n\t\t interface | iot_rules_managed | \n\t\t lambda | load_balancer | \n\t\t nat_gateway | network_load_balancer | \n\t\t quicksight | \n\t\t transit_gateway | trunk | \n\t\t vpc_endpoint).

    \n
  • \n
  • \n

    \n mac-address - The MAC address of the network interface.

    \n
  • \n
  • \n

    \n network-interface-id - The ID of the network interface.

    \n
  • \n
  • \n

    \n owner-id - The Amazon Web Services account ID of the network interface owner.

    \n
  • \n
  • \n

    \n private-dns-name - The private DNS name of the network interface (IPv4).

    \n
  • \n
  • \n

    \n private-ip-address - The private IPv4 address or addresses of the\n network interface.

    \n
  • \n
  • \n

    \n requester-id - The alias or Amazon Web Services account ID of the principal or service that created the network interface.

    \n
  • \n
  • \n

    \n requester-managed - Indicates whether the network interface is being managed by an Amazon Web Service \n\t\t (for example, Amazon Web Services Management Console, Auto Scaling, and so on).

    \n
  • \n
  • \n

    \n source-dest-check - Indicates whether the network interface performs source/destination checking. \n\t\t A value of true means checking is enabled, and false means checking is disabled. \n\t\t The value must be false for the network interface to perform network address translation (NAT) in your VPC.

    \n
  • \n
  • \n

    \n status - The status of the network interface. If the network interface is not attached to an instance, the status is available; \n\t\t if a network interface is attached to an instance the status is in-use.

    \n
  • \n
  • \n

    \n subnet-id - The ID of the subnet for the network interface.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC for the network interface.

    \n
  • \n
", "smithy.api#xmlName": "filter" } }, @@ -48842,7 +48842,7 @@ "target": "com.amazonaws.ec2#DescribeFleetsErrorSet", "traits": { "aws.protocols#ec2QueryName": "ErrorSet", - "smithy.api#documentation": "

Information about the instances that could not be launched by the fleet. Valid only when\n Type is set to instant.

", + "smithy.api#documentation": "

Information about the instances that could not be launched by the fleet. Valid only when\n Type is set to instant.

", "smithy.api#xmlName": "errorSet" } }, @@ -48850,7 +48850,7 @@ "target": "com.amazonaws.ec2#DescribeFleetsInstancesSet", "traits": { "aws.protocols#ec2QueryName": "FleetInstanceSet", - "smithy.api#documentation": "

Information about the instances that were launched by the fleet. Valid only when\n Type is set to instant.

", + "smithy.api#documentation": "

Information about the instances that were launched by the fleet. Valid only when\n Type is set to instant.

", "smithy.api#xmlName": "fleetInstanceSet" } }, @@ -55799,7 +55799,7 @@ "BootMode": { "target": "com.amazonaws.ec2#BootModeValues", "traits": { - "smithy.api#documentation": "

The boot mode of the virtual machine.

" + "smithy.api#documentation": "

The boot mode of the virtual machine.

\n \n

The uefi-preferred boot mode isn't supported for importing images. For more\n information, see Boot modes in\n the VM Import/Export User Guide.

\n
" } } }, @@ -70065,7 +70065,7 @@ "ResourceType": { "target": "com.amazonaws.ec2#ResourceType", "traits": { - "smithy.api#documentation": "

The type of resource to tag.

\n

The Valid Values are all the resource types that can be tagged. However,\n when creating a launch template, you can specify tags for the following resource types\n only: instance | volume | elastic-gpu |\n network-interface | spot-instances-request\n

\n

To tag a resource after it has been created, see CreateTags.

" + "smithy.api#documentation": "

The type of resource to tag.

\n

Valid Values lists all resource types for Amazon EC2 that can be tagged. When\n you create a launch template, you can specify tags for the following resource types\n only: instance | volume | elastic-gpu |\n network-interface | spot-instances-request.\n If the instance does include the resource type that you specify, the instance \n launch fails. For example, not all instance types include an Elastic GPU.

\n

To tag a resource after it has been created, see CreateTags.

" } }, "Tags": { @@ -80109,7 +80109,7 @@ "target": "com.amazonaws.ec2#String", "traits": { "aws.protocols#ec2QueryName": "MaxTotalPrice", - "smithy.api#documentation": "

The maximum amount per hour for On-Demand Instances that you're willing to pay.

", + "smithy.api#documentation": "

The maximum amount per hour for On-Demand Instances that you're willing to pay.

\n \n

If your fleet includes T instances that are configured as unlimited,\n and if their average CPU usage exceeds the baseline utilization, you will incur a charge\n for surplus credits. The maxTotalPrice does not account for surplus\n credits, and, if you use surplus credits, your final cost might be higher than what you\n specified for maxTotalPrice. For more information, see Surplus credits can incur charges in the EC2 User\n Guide.

\n
", "smithy.api#xmlName": "maxTotalPrice" } } @@ -80160,7 +80160,7 @@ "MaxTotalPrice": { "target": "com.amazonaws.ec2#String", "traits": { - "smithy.api#documentation": "

The maximum amount per hour for On-Demand Instances that you're willing to pay.

" + "smithy.api#documentation": "

The maximum amount per hour for On-Demand Instances that you're willing to pay.

\n \n

If your fleet includes T instances that are configured as unlimited,\n and if their average CPU usage exceeds the baseline utilization, you will incur a charge\n for surplus credits. The MaxTotalPrice does not account for surplus\n credits, and, if you use surplus credits, your final cost might be higher than what you\n specified for MaxTotalPrice. For more information, see Surplus credits can incur charges in the EC2 User\n Guide.

\n
" } } }, @@ -84303,7 +84303,7 @@ "NetworkBorderGroup": { "target": "com.amazonaws.ec2#String", "traits": { - "smithy.api#documentation": "

The set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises\n IP addresses.

\n

If you provide an incorrect network border group, you receive an InvalidAddress.NotFound error.

\n

You cannot use a network border group with EC2 Classic. If you attempt this operation on EC2 classic, you \n receive an InvalidParameterCombination error.

" + "smithy.api#documentation": "

The set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises\n IP addresses.

\n

If you provide an incorrect network border group, you receive an InvalidAddress.NotFound error.

" } }, "DryRun": { @@ -85665,7 +85665,7 @@ "ElasticInferenceAccelerators": { "target": "com.amazonaws.ec2#LaunchTemplateElasticInferenceAcceleratorList", "traits": { - "smithy.api#documentation": "

The elastic inference accelerator for the instance.

", + "smithy.api#documentation": "

An elastic inference accelerator to associate with the instance. Elastic inference\n accelerators are a resource you can attach to your Amazon EC2 instances to accelerate\n your Deep Learning (DL) inference workloads.

\n

You cannot specify accelerators from different generations in the same request.

\n \n

Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon\n Elastic Inference (EI), and will help current customers migrate their workloads to\n options that offer better price and performance. After April 15, 2023, new customers\n will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker,\n Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during\n the past 30-day period are considered current customers and will be able to continue\n using the service.

\n
", "smithy.api#xmlName": "ElasticInferenceAccelerator" } }, @@ -88295,7 +88295,7 @@ "target": "com.amazonaws.ec2#LaunchTemplateElasticInferenceAcceleratorResponseList", "traits": { "aws.protocols#ec2QueryName": "ElasticInferenceAcceleratorSet", - "smithy.api#documentation": "

The elastic inference accelerator for the instance.

", + "smithy.api#documentation": "

An elastic inference accelerator to associate with the instance. Elastic inference\n accelerators are a resource you can attach to your Amazon EC2 instances to accelerate\n your Deep Learning (DL) inference workloads.

\n

You cannot specify accelerators from different generations in the same request.

\n \n

Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon\n Elastic Inference (EI), and will help current customers migrate their workloads to\n options that offer better price and performance. After April 15, 2023, new customers\n will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker,\n Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during\n the past 30-day period are considered current customers and will be able to continue\n using the service.

\n
", "smithy.api#xmlName": "elasticInferenceAcceleratorSet" } }, @@ -93501,7 +93501,7 @@ "target": "com.amazonaws.ec2#String", "traits": { "aws.protocols#ec2QueryName": "OnDemandMaxTotalPrice", - "smithy.api#documentation": "

The maximum amount per hour for On-Demand Instances that you're willing to pay. You\n can use the onDemandMaxTotalPrice parameter, the\n spotMaxTotalPrice parameter, or both parameters to ensure that your\n fleet cost does not exceed your budget. If you set a maximum price per hour for the\n On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the\n maximum amount you're willing to pay. When the maximum amount you're willing to pay is\n reached, the fleet stops launching instances even if it hasn’t met the target\n capacity.

", + "smithy.api#documentation": "

The maximum amount per hour for On-Demand Instances that you're willing to pay. You\n can use the onDemandMaxTotalPrice parameter, the\n spotMaxTotalPrice parameter, or both parameters to ensure that your\n fleet cost does not exceed your budget. If you set a maximum price per hour for the\n On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the\n maximum amount you're willing to pay. When the maximum amount you're willing to pay is\n reached, the fleet stops launching instances even if it hasn’t met the target\n capacity.

\n \n

If your fleet includes T instances that are configured as unlimited,\n and if their average CPU usage exceeds the baseline utilization, you will incur a charge\n for surplus credits. The onDemandMaxTotalPrice does not account for surplus\n credits, and, if you use surplus credits, your final cost might be higher than what you\n specified for onDemandMaxTotalPrice. For more information, see Surplus credits can incur charges in the EC2 User\n Guide.

\n
", "smithy.api#xmlName": "onDemandMaxTotalPrice" } }, @@ -93509,7 +93509,7 @@ "target": "com.amazonaws.ec2#String", "traits": { "aws.protocols#ec2QueryName": "SpotMaxTotalPrice", - "smithy.api#documentation": "

The maximum amount per hour for Spot Instances that you're willing to pay. You can use\n the spotdMaxTotalPrice parameter, the onDemandMaxTotalPrice\n parameter, or both parameters to ensure that your fleet cost does not exceed your\n budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request,\n Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay.\n When the maximum amount you're willing to pay is reached, the fleet stops launching\n instances even if it hasn’t met the target capacity.

", + "smithy.api#documentation": "

The maximum amount per hour for Spot Instances that you're willing to pay. You can use\n the spotMaxTotalPrice parameter, the onDemandMaxTotalPrice\n parameter, or both parameters to ensure that your fleet cost does not exceed your budget.\n If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will\n launch instances until it reaches the maximum amount you're willing to pay. When the\n maximum amount you're willing to pay is reached, the fleet stops launching instances even\n if it hasn’t met the target capacity.

\n \n

If your fleet includes T instances that are configured as unlimited,\n and if their average CPU usage exceeds the baseline utilization, you will incur a charge\n for surplus credits. The spotMaxTotalPrice does not account for surplus\n credits, and, if you use surplus credits, your final cost might be higher than what you\n specified for spotMaxTotalPrice. For more information, see Surplus credits can incur charges in the EC2 User\n Guide.

\n
", "smithy.api#xmlName": "spotMaxTotalPrice" } }, @@ -93602,7 +93602,7 @@ "TagSpecifications": { "target": "com.amazonaws.ec2#TagSpecificationList", "traits": { - "smithy.api#documentation": "

The key-value pair for tagging the Spot Fleet request on creation. The value for\n ResourceType must be spot-fleet-request, otherwise the\n Spot Fleet request fails. To tag instances at launch, specify the tags in the launch\n template (valid only if you use LaunchTemplateConfigs) or in\n the \n SpotFleetTagSpecification\n (valid only if you use\n LaunchSpecifications). For information about tagging after launch, see\n Tagging Your Resources.

", + "smithy.api#documentation": "

The key-value pair for tagging the Spot Fleet request on creation. The value for\n ResourceType must be spot-fleet-request, otherwise the\n Spot Fleet request fails. To tag instances at launch, specify the tags in the launch\n template (valid only if you use LaunchTemplateConfigs) or in\n the \n SpotFleetTagSpecification\n (valid only if you use\n LaunchSpecifications). For information about tagging after launch, see\n Tag your resources.

", "smithy.api#xmlName": "TagSpecification" } } @@ -94112,7 +94112,7 @@ "target": "com.amazonaws.ec2#String", "traits": { "aws.protocols#ec2QueryName": "MaxTotalPrice", - "smithy.api#documentation": "

The maximum amount per hour for Spot Instances that you're willing to pay. We do not recommend\n using this parameter because it can lead to increased interruptions. If you do not specify\n this parameter, you will pay the current Spot price.

\n \n

If you specify a maximum price, your Spot Instances will be interrupted more frequently than if you do not specify this parameter.

\n
", + "smithy.api#documentation": "

The maximum amount per hour for Spot Instances that you're willing to pay. We do not recommend\n using this parameter because it can lead to increased interruptions. If you do not specify\n this parameter, you will pay the current Spot price.

\n \n

If you specify a maximum price, your Spot Instances will be interrupted more frequently than if you do not specify this parameter.

\n
\n \n

If your fleet includes T instances that are configured as unlimited,\n and if their average CPU usage exceeds the baseline utilization, you will incur a charge\n for surplus credits. The maxTotalPrice does not account for surplus\n credits, and, if you use surplus credits, your final cost might be higher than what you\n specified for maxTotalPrice. For more information, see Surplus credits can incur charges in the EC2 User\n Guide.

\n
", "smithy.api#xmlName": "maxTotalPrice" } } @@ -94177,7 +94177,7 @@ "MaxTotalPrice": { "target": "com.amazonaws.ec2#String", "traits": { - "smithy.api#documentation": "

The maximum amount per hour for Spot Instances that you're willing to pay. We do not recommend\n using this parameter because it can lead to increased interruptions. If you do not specify\n this parameter, you will pay the current Spot price.

\n \n

If you specify a maximum price, your Spot Instances will be interrupted more frequently than if you do not specify this parameter.

\n
" + "smithy.api#documentation": "

The maximum amount per hour for Spot Instances that you're willing to pay. We do not recommend\n using this parameter because it can lead to increased interruptions. If you do not specify\n this parameter, you will pay the current Spot price.

\n \n

If you specify a maximum price, your Spot Instances will be interrupted more frequently than if you do not specify this parameter.

\n
\n \n

If your fleet includes T instances that are configured as unlimited,\n and if their average CPU usage exceeds the baseline utilization, you will incur a charge\n for surplus credits. The MaxTotalPrice does not account for surplus\n credits, and, if you use surplus credits, your final cost might be higher than what you\n specified for MaxTotalPrice. For more information, see Surplus credits can incur charges in the EC2 User\n Guide.

\n
" } } }, diff --git a/codegen/sdk/aws-models/fsx.json b/codegen/sdk/aws-models/fsx.json index 62364beec11..7dbb7fc75a5 100644 --- a/codegen/sdk/aws-models/fsx.json +++ b/codegen/sdk/aws-models/fsx.json @@ -143,6 +143,9 @@ { "target": "com.amazonaws.fsx#RestoreVolumeFromSnapshot" }, + { + "target": "com.amazonaws.fsx#StartMisconfiguredStateRecovery" + }, { "target": "com.amazonaws.fsx#TagResource" }, @@ -1390,6 +1393,12 @@ "traits": { "smithy.api#enumValue": "STORAGE_TYPE_OPTIMIZATION" } + }, + "MISCONFIGURED_STATE_RECOVERY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MISCONFIGURED_STATE_RECOVERY" + } } }, "traits": { @@ -3004,7 +3013,7 @@ } }, "traits": { - "smithy.api#documentation": "

The Lustre configuration for the file system being created.

\n \n

The following parameters are not supported for file systems\n with a data repository association created with\n .

\n
    \n
  • \n

    \n AutoImportPolicy\n

    \n
  • \n
  • \n

    \n ExportPath\n

    \n
  • \n
  • \n

    \n ImportedChunkSize\n

    \n
  • \n
  • \n

    \n ImportPath\n

    \n
  • \n
\n
" + "smithy.api#documentation": "

The Lustre configuration for the file system being created.

\n \n

The following parameters are not supported for file systems\n with a data repository association created with\n .

\n
    \n
  • \n

    \n AutoImportPolicy\n

    \n
  • \n
  • \n

    \n ExportPath\n

    \n
  • \n
  • \n

    \n ImportedFileChunkSize\n

    \n
  • \n
  • \n

    \n ImportPath\n

    \n
  • \n
\n
" } }, "com.amazonaws.fsx#CreateFileSystemOntapConfiguration": { @@ -9677,6 +9686,60 @@ "smithy.api#error": "client" } }, + "com.amazonaws.fsx#StartMisconfiguredStateRecovery": { + "type": "operation", + "input": { + "target": "com.amazonaws.fsx#StartMisconfiguredStateRecoveryRequest" + }, + "output": { + "target": "com.amazonaws.fsx#StartMisconfiguredStateRecoveryResponse" + }, + "errors": [ + { + "target": "com.amazonaws.fsx#BadRequest" + }, + { + "target": "com.amazonaws.fsx#FileSystemNotFound" + }, + { + "target": "com.amazonaws.fsx#InternalServerError" + } + ], + "traits": { + "smithy.api#documentation": "

After performing steps to repair the Active Directory configuration of an FSx for Windows File Server file system, use this action to \n initiate the process of Amazon FSx attempting to reconnect to the file system.

" + } + }, + "com.amazonaws.fsx#StartMisconfiguredStateRecoveryRequest": { + "type": "structure", + "members": { + "ClientRequestToken": { + "target": "com.amazonaws.fsx#ClientRequestToken", + "traits": { + "smithy.api#idempotencyToken": {} + } + }, + "FileSystemId": { + "target": "com.amazonaws.fsx#FileSystemId", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.fsx#StartMisconfiguredStateRecoveryResponse": { + "type": "structure", + "members": { + "FileSystem": { + "target": "com.amazonaws.fsx#FileSystem" + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.fsx#StartTime": { "type": "timestamp" }, diff --git a/codegen/sdk/aws-models/marketplace-catalog.json b/codegen/sdk/aws-models/marketplace-catalog.json index ca72e87c52c..dc1a455da8a 100644 --- a/codegen/sdk/aws-models/marketplace-catalog.json +++ b/codegen/sdk/aws-models/marketplace-catalog.json @@ -834,7 +834,7 @@ "ChangeType": { "target": "com.amazonaws.marketplacecatalog#ChangeType", "traits": { - "smithy.api#documentation": "

Change types are single string values that describe your intention for the change.\n Each change type is unique for each EntityType provided in the change's\n scope. For more information on change types available for single-AMI products, see\n Working with single-AMI products. Also, for more information on change\n types available for container-based products, see Working with container products.

", + "smithy.api#documentation": "

Change types are single string values that describe your intention for the change.\n Each change type is unique for each EntityType provided in the change's\n scope. For more information on change types available for single-AMI products, see\n Working with single-AMI products. Also, for more information about change\n types available for container-based products, see Working with container products.

", "smithy.api#required": {} } }, @@ -854,8 +854,13 @@ "Details": { "target": "com.amazonaws.marketplacecatalog#Json", "traits": { - "smithy.api#documentation": "

This object contains details specific to the change type of the requested\n change. For more\n information on change types available for single-AMI products, see Working with single-AMI products. Also, for more information on change\n types available for container-based products, see Working with container products.

", - "smithy.api#required": {} + "smithy.api#documentation": "

This object contains details specific to the change type of the requested change. For\n more information about change types available for single-AMI products, see Working with single-AMI products. Also, for more information about change\n types available for container-based products, see Working with container products.

" + } + }, + "DetailsDocument": { + "target": "com.amazonaws.marketplacecatalog#JsonDocumentType", + "traits": { + "smithy.api#documentation": "

Alternative field that accepts a JSON value instead of a string for\n ChangeType details. You can use either Details or\n DetailsDocument, but not both.

" } }, "ChangeName": { @@ -1013,6 +1018,12 @@ "smithy.api#documentation": "

This object contains details specific to the change type of the requested\n change.

" } }, + "DetailsDocument": { + "target": "com.amazonaws.marketplacecatalog#JsonDocumentType", + "traits": { + "smithy.api#documentation": "

The JSON value of the details specific to the change type of the requested change.

" + } + }, "ErrorDetailList": { "target": "com.amazonaws.marketplacecatalog#ErrorDetailList", "traits": { @@ -1086,7 +1097,7 @@ } ], "traits": { - "smithy.api#documentation": "

Deletes a resource-based policy on an Entity that is identified by its resource\n ARN.

", + "smithy.api#documentation": "

Deletes a resource-based policy on an entity that is identified by its resource\n ARN.

", "smithy.api#http": { "method": "DELETE", "uri": "/DeleteResourcePolicy", @@ -1100,7 +1111,7 @@ "ResourceArn": { "target": "com.amazonaws.marketplacecatalog#ResourceARN", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Entity resource that is associated with the\n resource policy.

", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the entity resource that is associated with the\n resource policy.

", "smithy.api#httpQuery": "resourceArn", "smithy.api#required": {} } @@ -1330,6 +1341,12 @@ "traits": { "smithy.api#documentation": "

This stringified JSON object includes the details of the entity.

" } + }, + "DetailsDocument": { + "target": "com.amazonaws.marketplacecatalog#JsonDocumentType", + "traits": { + "smithy.api#documentation": "

The JSON value of the details specific to the entity.

" + } } }, "traits": { @@ -1568,7 +1585,7 @@ } ], "traits": { - "smithy.api#documentation": "

Gets a resource-based policy of an Entity that is identified by its resource\n ARN.

", + "smithy.api#documentation": "

Gets a resource-based policy of an entity that is identified by its resource\n ARN.

", "smithy.api#http": { "method": "GET", "uri": "/GetResourcePolicy", @@ -1582,7 +1599,7 @@ "ResourceArn": { "target": "com.amazonaws.marketplacecatalog#ResourceARN", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Entity resource that is associated with the\n resource policy.

", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the entity resource that is associated with the\n resource policy.

", "smithy.api#httpQuery": "resourceArn", "smithy.api#required": {} } @@ -1639,6 +1656,9 @@ "smithy.api#pattern": "^[\\s]*\\{[\\s\\S]*\\}[\\s]*$" } }, + "com.amazonaws.marketplacecatalog#JsonDocumentType": { + "type": "document" + }, "com.amazonaws.marketplacecatalog#ListChangeSets": { "type": "operation", "input": { @@ -1835,7 +1855,10 @@ } }, "OwnershipType": { - "target": "com.amazonaws.marketplacecatalog#OwnershipType" + "target": "com.amazonaws.marketplacecatalog#OwnershipType", + "traits": { + "smithy.api#documentation": "

Filters the returned set of entities based on their owner. The default is\n SELF. To list entities shared with you\n through AWS Resource Access Manager (AWS RAM), set to SHARED. Entities shared through the AWS Marketplace\n Catalog API PutResourcePolicy operation can't be discovered through the\n SHARED parameter.

" + } } }, "traits": { @@ -1984,7 +2007,7 @@ } ], "traits": { - "smithy.api#documentation": "

Attaches a resource-based policy to an Entity. Examples of an entity include:\n AmiProduct and ContainerProduct.

", + "smithy.api#documentation": "

Attaches a resource-based policy to an entity. Examples of an entity include:\n AmiProduct and ContainerProduct.

", "smithy.api#http": { "method": "POST", "uri": "/PutResourcePolicy", @@ -1998,7 +2021,7 @@ "ResourceArn": { "target": "com.amazonaws.marketplacecatalog#ResourceARN", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Entity resource you want to associate with a\n resource policy.

", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the entity resource you want to associate with a\n resource policy.

", "smithy.api#required": {} } }, @@ -2127,7 +2150,7 @@ "SortBy": { "target": "com.amazonaws.marketplacecatalog#SortBy", "traits": { - "smithy.api#documentation": "

For ListEntities, supported attributes include\n LastModifiedDate (default), Visibility,\n EntityId, and Name.

\n

For ListChangeSets, supported attributes include StartTime\n and EndTime.

" + "smithy.api#documentation": "

For ListEntities, supported attributes include\n LastModifiedDate (default) and EntityId. In addition to\n LastModifiedDate and EntityId, each\n EntityType might support additional fields.

\n

For ListChangeSets, supported attributes include StartTime\n and EndTime.

" } }, "SortOrder": { @@ -2200,7 +2223,7 @@ } ], "traits": { - "smithy.api#documentation": "

Allows you to request changes for your entities. Within a single\n ChangeSet, you can't start the same change type against the same entity\n multiple times. Additionally, when a ChangeSet is running, all the entities\n targeted by the different changes are locked until the change set has completed (either\n succeeded, cancelled, or failed). If you try to start a change set containing a change\n against an entity that is already locked, you will receive a\n ResourceInUseException error.

\n

For example, you can't start the ChangeSet described in the example later in this topic because it contains two changes to run the same\n change type (AddRevisions) against the same entity\n (entity-id@1).

\n

For more information about working with change sets, see Working with change sets. For information on change types for single-AMI\n products, see Working with single-AMI products. Als, for more information on change types\n available for container-based products, see Working with container products.

", + "smithy.api#documentation": "

Allows you to request changes for your entities. Within a single\n ChangeSet, you can't start the same change type against the same entity\n multiple times. Additionally, when a ChangeSet is running, all the entities\n targeted by the different changes are locked until the change set has completed (either\n succeeded, cancelled, or failed). If you try to start a change set containing a change\n against an entity that is already locked, you will receive a\n ResourceInUseException error.

\n

For example, you can't start the ChangeSet described in the example later in this topic because it contains two changes to run the same\n change type (AddRevisions) against the same entity\n (entity-id@1).

\n

For more information about working with change sets, see Working with change sets. For information about change types for\n single-AMI products, see Working with single-AMI products. Also, for more information about change\n types available for container-based products, see Working with container products.

", "smithy.api#http": { "method": "POST", "uri": "/StartChangeSet", diff --git a/codegen/sdk/aws-models/quicksight.json b/codegen/sdk/aws-models/quicksight.json index 73ef12cf8a1..88d091ac781 100644 --- a/codegen/sdk/aws-models/quicksight.json +++ b/codegen/sdk/aws-models/quicksight.json @@ -6050,6 +6050,12 @@ "traits": { "smithy.api#documentation": "

The definition of an analysis.

\n

A definition is the data model of all features in a Dashboard, Template, or Analysis.

\n

Either a SourceEntity or a Definition must be provided in \n order for the request to be valid.

" } + }, + "ValidationStrategy": { + "target": "com.amazonaws.quicksight#ValidationStrategy", + "traits": { + "smithy.api#documentation": "

The option to relax the validation needed to create an analysis with definition objects. This skips the validation step for specific errors.

" + } } }, "traits": { @@ -6227,6 +6233,12 @@ "traits": { "smithy.api#documentation": "

The definition of a dashboard.

\n

A definition is the data model of all features in a Dashboard, Template, or Analysis.

\n

Either a SourceEntity or a Definition must be provided in \n order for the request to be valid.

" } + }, + "ValidationStrategy": { + "target": "com.amazonaws.quicksight#ValidationStrategy", + "traits": { + "smithy.api#documentation": "

The option to relax the validation needed to create a dashboard with definition objects. This option skips the validation step for specific errors.

" + } } }, "traits": { @@ -7811,6 +7823,12 @@ "traits": { "smithy.api#documentation": "

The definition of a template.

\n

A definition is the data model of all features in a Dashboard, Template, or Analysis.

\n

Either a SourceEntity or a Definition must be provided in \n\t\t\torder for the request to be valid.

" } + }, + "ValidationStrategy": { + "target": "com.amazonaws.quicksight#ValidationStrategy", + "traits": { + "smithy.api#documentation": "

TThe option to relax the validation needed to create a template with definition objects. This skips the validation step for specific errors.

" + } } }, "traits": { @@ -11334,6 +11352,36 @@ } } }, + "com.amazonaws.quicksight#DatabaseGroup": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 64 + } + } + }, + "com.amazonaws.quicksight#DatabaseGroupList": { + "type": "list", + "member": { + "target": "com.amazonaws.quicksight#DatabaseGroup" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 50 + } + } + }, + "com.amazonaws.quicksight#DatabaseUser": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 64 + } + } + }, "com.amazonaws.quicksight#DatabricksParameters": { "type": "structure", "members": { @@ -20540,6 +20588,12 @@ "traits": { "smithy.api#documentation": "

Select all of the values. Null is not the assigned value of select all.

\n
    \n
  • \n

    \n FILTER_ALL_VALUES\n

    \n
  • \n
" } + }, + "NullOption": { + "target": "com.amazonaws.quicksight#FilterNullOption", + "traits": { + "smithy.api#documentation": "

This option determines how null values should be treated when filtering data.

\n
    \n
  • \n

    \n ALL_VALUES: Include null values in filtered results.

    \n
  • \n
  • \n

    \n NULLS_ONLY: Only include null values in filtered results.

    \n
  • \n
  • \n

    \n NON_NULLS_ONLY: Exclude null values from filtered results.

    \n
  • \n
" + } } }, "traits": { @@ -30288,6 +30342,12 @@ "smithy.api#enumValue": "DATASET" } }, + "DATASOURCE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DATASOURCE" + } + }, "TOPIC": { "target": "smithy.api#Unit", "traits": { @@ -35792,6 +35852,41 @@ } } }, + "com.amazonaws.quicksight#RedshiftIAMParameters": { + "type": "structure", + "members": { + "RoleArn": { + "target": "com.amazonaws.quicksight#RoleArn", + "traits": { + "smithy.api#documentation": "

Use the RoleArn structure to allow Amazon QuickSight to call redshift:GetClusterCredentials on your cluster. The calling principal must have iam:PassRole access to pass the role to Amazon QuickSight. The role's trust policy must allow the Amazon QuickSight service principal to assume the role.

", + "smithy.api#required": {} + } + }, + "DatabaseUser": { + "target": "com.amazonaws.quicksight#DatabaseUser", + "traits": { + "smithy.api#documentation": "

The user whose permissions and group memberships will be used by Amazon QuickSight to access the cluster. If this user already exists in your database, Amazon QuickSight is granted the same permissions that the user has. If the user doesn't exist, set the value of AutoCreateDatabaseUser to True to create a new user with PUBLIC permissions.

", + "smithy.api#required": {} + } + }, + "DatabaseGroups": { + "target": "com.amazonaws.quicksight#DatabaseGroupList", + "traits": { + "smithy.api#documentation": "

A list of groups whose permissions will be granted to Amazon QuickSight to access the cluster. These permissions are combined with the permissions granted to Amazon QuickSight by the DatabaseUser. If you choose to include this parameter, the RoleArn must grant access to redshift:JoinGroup.

" + } + }, + "AutoCreateDatabaseUser": { + "target": "com.amazonaws.quicksight#Boolean", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "

Automatically creates a database user. If your database doesn't have a DatabaseUser, set this parameter to True. If there is no DatabaseUser, Amazon QuickSight can't connect to your cluster. The RoleArn that you use for this operation must grant access to redshift:CreateClusterUser to successfully create the user.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

A structure that grants Amazon QuickSight access to your cluster and make a call to the redshift:GetClusterCredentials API. For more information on the redshift:GetClusterCredentials API, see \n GetClusterCredentials\n .

" + } + }, "com.amazonaws.quicksight#RedshiftParameters": { "type": "structure", "members": { @@ -35820,10 +35915,16 @@ "traits": { "smithy.api#documentation": "

Cluster ID. This field can be blank if the Host and Port are\n provided.

" } + }, + "IAMParameters": { + "target": "com.amazonaws.quicksight#RedshiftIAMParameters", + "traits": { + "smithy.api#documentation": "

An optional parameter that uses IAM authentication to grant Amazon QuickSight access to your cluster. This parameter can be used instead of DataSourceCredentials.

" + } } }, "traits": { - "smithy.api#documentation": "

The parameters for Amazon Redshift. The ClusterId field can be blank if\n Host and Port are both set. The Host and\n Port fields can be blank if the ClusterId field is set.

" + "smithy.api#documentation": "

The parameters for Amazon Redshift. The ClusterId field can be blank if\n Host and Port are both set. The Host and Port fields can be blank if the ClusterId field is set.

" } }, "com.amazonaws.quicksight#ReferenceLine": { @@ -36623,7 +36724,7 @@ "traits": { "smithy.api#length": { "min": 1, - "max": 64 + "max": 256 } } }, @@ -36632,7 +36733,7 @@ "traits": { "smithy.api#length": { "min": 0, - "max": 64 + "max": 256 } } }, @@ -42168,6 +42269,12 @@ "traits": { "smithy.api#enumValue": "END" } + }, + "AUTO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AUTO" + } } } }, @@ -46101,6 +46208,12 @@ "traits": { "smithy.api#documentation": "

The definition of an analysis.

\n

A definition is the data model of all features in a Dashboard, Template, or Analysis.

" } + }, + "ValidationStrategy": { + "target": "com.amazonaws.quicksight#ValidationStrategy", + "traits": { + "smithy.api#documentation": "

The option to relax the validation needed to update an analysis with definition objects. This skips the validation step for specific errors.

" + } } }, "traits": { @@ -46485,6 +46598,12 @@ "traits": { "smithy.api#documentation": "

The definition of a dashboard.

\n

A definition is the data model of all features in a Dashboard, Template, or Analysis.

" } + }, + "ValidationStrategy": { + "target": "com.amazonaws.quicksight#ValidationStrategy", + "traits": { + "smithy.api#documentation": "

The option to relax the validation needed to update a dashboard with definition objects. This skips the validation step for specific errors.

" + } } }, "traits": { @@ -48138,6 +48257,12 @@ "traits": { "smithy.api#documentation": "

The definition of a template.

\n

A definition is the data model of all features in a Dashboard, Template, or Analysis.

" } + }, + "ValidationStrategy": { + "target": "com.amazonaws.quicksight#ValidationStrategy", + "traits": { + "smithy.api#documentation": "

The option to relax the validation needed to update a template with definition objects. This skips the validation step for specific errors.

" + } } }, "traits": { @@ -49630,6 +49755,38 @@ "target": "com.amazonaws.quicksight#VPCConnectionSummary" } }, + "com.amazonaws.quicksight#ValidationStrategy": { + "type": "structure", + "members": { + "Mode": { + "target": "com.amazonaws.quicksight#ValidationStrategyMode", + "traits": { + "smithy.api#documentation": "

The mode of validation for the asset to be creaed or updated. When you set this value to STRICT, strict validation for every error is enforced. When you set this value to LENIENT, validation is skipped for specific UI errors.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The option to relax the validation that is required to create and update analyses, dashboards, and templates with definition objects. When you set this value to LENIENT, validation is skipped for specific errors.

" + } + }, + "com.amazonaws.quicksight#ValidationStrategyMode": { + "type": "enum", + "members": { + "STRICT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STRICT" + } + }, + "LENIENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LENIENT" + } + } + } + }, "com.amazonaws.quicksight#ValueWhenUnsetOption": { "type": "enum", "members": { diff --git a/codegen/sdk/aws-models/transfer.json b/codegen/sdk/aws-models/transfer.json index aae1322008e..381e997ce70 100644 --- a/codegen/sdk/aws-models/transfer.json +++ b/codegen/sdk/aws-models/transfer.json @@ -5779,7 +5779,7 @@ "traits": { "smithy.api#length": { "min": 0, - "max": 512 + "max": 4096 }, "smithy.api#pattern": "^[\\x09-\\x0D\\x20-\\x7E]*$" } @@ -5789,7 +5789,7 @@ "traits": { "smithy.api#length": { "min": 0, - "max": 512 + "max": 4096 }, "smithy.api#pattern": "^[\\x09-\\x0D\\x20-\\x7E]*$" } @@ -6385,7 +6385,7 @@ "TrustedHostKeys": { "target": "com.amazonaws.transfer#SftpConnectorTrustedHostKeyList", "traits": { - "smithy.api#documentation": "

The public portion of the host key, or keys, that are used to authenticate the user to the external server to which you are connecting. You can use the ssh-keyscan command against the SFTP server to retrieve the necessary key.

\n

The three standard SSH public key format elements are ,\n , and an optional , with spaces\n between each element. Specify only the and : do not enter the portion of the key.

\n

For the trusted host key, Transfer Family accepts RSA and ECDSA keys.

\n
    \n
  • \n

    For RSA keys, the key type is ssh-rsa.

    \n
  • \n
  • \n

    For ECDSA keys, the key type is either ecdsa-sha2-nistp256,\n ecdsa-sha2-nistp384, or ecdsa-sha2-nistp521, depending on the\n size of the key you generated.

    \n
  • \n
" + "smithy.api#documentation": "

The public portion of the host key, or keys, that are used to identify the external server to which you are connecting.\n You can use the ssh-keyscan command against the SFTP server to retrieve the necessary key.

\n

The three standard SSH public key format elements are ,\n , and an optional , with spaces\n between each element. Specify only the and : do not enter the portion of the key.

\n

For the trusted host key, Transfer Family accepts RSA and ECDSA keys.

\n
    \n
  • \n

    For RSA keys, the string is ssh-rsa.

    \n
  • \n
  • \n

    For ECDSA keys, the string is either\n ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, or\n ecdsa-sha2-nistp521, depending on the size of the key you generated.

    \n
  • \n
" } } }, diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index abebf713d28..69574293afb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,7 +7,7 @@ coroutines-version = "1.7.3" atomicfu-version = "0.19.0" # smithy-kotlin codegen and runtime are versioned together -smithy-kotlin-version = "0.27.6" +smithy-kotlin-version = "0.27.7" # codegen smithy-version = "1.39.0" From 9801433e8cf6c991e56e938950d925c23653d74b Mon Sep 17 00:00:00 2001 From: aws-sdk-kotlin-ci Date: Thu, 12 Oct 2023 18:17:26 +0000 Subject: [PATCH 03/13] chore: release 0.32.5-beta --- .changes/2e8e4fee-c462-45d2-b421-46520d06eb60.json | 8 -------- .changes/332e61e8-a33f-4bdb-b609-a2f977628ca4.json | 5 ----- CHANGELOG.md | 8 ++++++++ gradle.properties | 2 +- 4 files changed, 9 insertions(+), 14 deletions(-) delete mode 100644 .changes/2e8e4fee-c462-45d2-b421-46520d06eb60.json delete mode 100644 .changes/332e61e8-a33f-4bdb-b609-a2f977628ca4.json diff --git a/.changes/2e8e4fee-c462-45d2-b421-46520d06eb60.json b/.changes/2e8e4fee-c462-45d2-b421-46520d06eb60.json deleted file mode 100644 index 69b9eb6dc31..00000000000 --- a/.changes/2e8e4fee-c462-45d2-b421-46520d06eb60.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "2e8e4fee-c462-45d2-b421-46520d06eb60", - "type": "feature", - "description": "Add new sources for User-Agent app id", - "issues": [ - "awslabs/aws-sdk-kotlin#945" - ] -} \ No newline at end of file diff --git a/.changes/332e61e8-a33f-4bdb-b609-a2f977628ca4.json b/.changes/332e61e8-a33f-4bdb-b609-a2f977628ca4.json deleted file mode 100644 index 7bc392f3bfa..00000000000 --- a/.changes/332e61e8-a33f-4bdb-b609-a2f977628ca4.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "332e61e8-a33f-4bdb-b609-a2f977628ca4", - "type": "misc", - "description": "Sync to the latest versions of **smithy-kotlin** and AWS service models" -} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 718db3dd969..db089f43d46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [0.32.5-beta] - 10/12/2023 + +### Features +* [#945](https://github.com/awslabs/aws-sdk-kotlin/issues/945) Add new sources for User-Agent app id + +### Miscellaneous +* Sync to the latest versions of **smithy-kotlin** and AWS service models + ## [0.32.4-beta] - 10/06/2023 ### Miscellaneous diff --git a/gradle.properties b/gradle.properties index c565a8d4636..155e634ee4d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ kotlin.native.ignoreDisabledTargets=true org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=2G # sdk -sdkVersion=0.32.5-SNAPSHOT +sdkVersion=0.32.5-beta # kotlin kotlinVersion=1.8.22 From 64f8f9dfc4815647a88d44726008136a071817e8 Mon Sep 17 00:00:00 2001 From: aws-sdk-kotlin-ci Date: Thu, 12 Oct 2023 18:17:27 +0000 Subject: [PATCH 04/13] chore: bump snapshot version to 0.32.6-SNAPSHOT --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 155e634ee4d..d55a0d7e4bd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ kotlin.native.ignoreDisabledTargets=true org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=2G # sdk -sdkVersion=0.32.5-beta +sdkVersion=0.32.6-SNAPSHOT # kotlin kotlinVersion=1.8.22 From cb9056bca93ee9f8ca04e7d9ca39dddd671e2b1e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Oct 2023 07:57:00 -0700 Subject: [PATCH 05/13] chore(deps-dev): bump @babel/traverse from 7.16.5 to 7.23.2 in /tests/integration-tests/ecs-credentials (#1078) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../ecs-credentials/package-lock.json | 273 ++++++++++++------ 1 file changed, 185 insertions(+), 88 deletions(-) diff --git a/tests/integration-tests/ecs-credentials/package-lock.json b/tests/integration-tests/ecs-credentials/package-lock.json index ed6672850b0..63f631266c3 100644 --- a/tests/integration-tests/ecs-credentials/package-lock.json +++ b/tests/integration-tests/ecs-credentials/package-lock.json @@ -41,17 +41,80 @@ "integrity": "sha512-bsyLQD/vqXQcc9RDmlM1XqiFNO/yewgVFXmkMcQkndJbmE/jgYkzewwYGrBlfL725hGLQipXq19+jwWwdsXQqg==" }, "node_modules/@babel/code-frame": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", - "integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "dependencies": { - "@babel/highlight": "^7.16.0" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/compat-data": { "version": "7.16.4", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.4.tgz", @@ -101,28 +164,20 @@ } }, "node_modules/@babel/generator": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.5.tgz", - "integrity": "sha512-kIvCdjZqcdKqoDbVVdt5R99icaRtrtYhYK/xux5qiWCBmfdvEYMFZ68QCrpE5cbFM1JsuArUNs1ZkuKtTtUcZA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/generator/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@babel/helper-compilation-targets": { "version": "7.16.3", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz", @@ -142,50 +197,34 @@ } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.5.tgz", - "integrity": "sha512-ODQyc5AnxmZWm/R2W7fzhamOk1ey8gSguo5SGvF0zcB3uUzRpTRmM/jmLSm9bDMyPlvbyJ+PwPEK0BWIoZ9wjg==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true, - "dependencies": { - "@babel/types": "^7.16.0" - }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz", - "integrity": "sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "dependencies": { - "@babel/helper-get-function-arity": "^7.16.0", - "@babel/template": "^7.16.0", - "@babel/types": "^7.16.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-get-function-arity": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz", - "integrity": "sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.16.0" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz", - "integrity": "sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -244,21 +283,30 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz", - "integrity": "sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" @@ -288,13 +336,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz", - "integrity": "sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.15.7", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -339,13 +387,13 @@ "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" @@ -364,9 +412,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.16.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.6.tgz", - "integrity": "sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -523,33 +571,33 @@ } }, "node_modules/@babel/template": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.0.tgz", - "integrity": "sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.16.0", - "@babel/parser": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.5.tgz", - "integrity": "sha512-FOCODAzqUMROikDYLYxl4nmwiLlu85rNqBML/A5hKRVXG2LV8d0iMqgPzdYTcIpjZEBB7D6UDU9vxRZiriASdQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.5", - "@babel/helper-environment-visitor": "^7.16.5", - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-hoist-variables": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/parser": "^7.16.5", - "@babel/types": "^7.16.0", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -558,12 +606,13 @@ } }, "node_modules/@babel/types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.0.tgz", - "integrity": "sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { @@ -844,6 +893,54 @@ "node": ">= 10.14.2" } }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "node_modules/@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", @@ -2330,7 +2427,7 @@ "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { "node": ">=0.8.0" From fb8f93b8f26b6cfb0a7745b845a0018ed4e0a5a1 Mon Sep 17 00:00:00 2001 From: Aaron Todd Date: Tue, 17 Oct 2023 12:43:28 -0400 Subject: [PATCH 06/13] refactor: track upstream telemetry changes (#1068) --- .changes/e965338d-28c5-41e2-b585-121d9d56393f.json | 5 +++++ .../kotlin/runtime/http/interceptors/AwsSpanInterceptor.kt | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changes/e965338d-28c5-41e2-b585-121d9d56393f.json diff --git a/.changes/e965338d-28c5-41e2-b585-121d9d56393f.json b/.changes/e965338d-28c5-41e2-b585-121d9d56393f.json new file mode 100644 index 00000000000..9d7a2c8d3fa --- /dev/null +++ b/.changes/e965338d-28c5-41e2-b585-121d9d56393f.json @@ -0,0 +1,5 @@ +{ + "id": "e965338d-28c5-41e2-b585-121d9d56393f", + "type": "misc", + "description": "**BREAKING**: Remove `smithy.client.request.size`, `smithy.client.response.size`, `smithy.client.retries` metrics. Rename all `smithy.client.*` metrics to `smithy.client.call.*`." +} diff --git a/aws-runtime/aws-http/common/src/aws/sdk/kotlin/runtime/http/interceptors/AwsSpanInterceptor.kt b/aws-runtime/aws-http/common/src/aws/sdk/kotlin/runtime/http/interceptors/AwsSpanInterceptor.kt index fcf3b1fe4c3..8840aec6967 100644 --- a/aws-runtime/aws-http/common/src/aws/sdk/kotlin/runtime/http/interceptors/AwsSpanInterceptor.kt +++ b/aws-runtime/aws-http/common/src/aws/sdk/kotlin/runtime/http/interceptors/AwsSpanInterceptor.kt @@ -44,7 +44,7 @@ public object AwsSpanInterceptor : HttpInterceptor { span.setAttribute("aws.request_id", it) } httpResp.headers["x-amz-id-2"]?.let { - span.setAttribute("aws.request_id2", it) + span.setAttribute("aws.extended_request_id", it) } } } From b5936d1a20eae5e17e61c7d922fc86baf1c3df16 Mon Sep 17 00:00:00 2001 From: Aaron Todd Date: Tue, 17 Oct 2023 12:59:11 -0400 Subject: [PATCH 07/13] feat: publish a BOM and a Version Catalog (#1072) --- .../703da74b-6f77-4555-b129-295486571361.json | 9 ++ bom/build.gradle.kts | 90 +++++++++++++++++++ settings.gradle.kts | 2 + 3 files changed, 101 insertions(+) create mode 100644 .changes/703da74b-6f77-4555-b129-295486571361.json create mode 100644 bom/build.gradle.kts diff --git a/.changes/703da74b-6f77-4555-b129-295486571361.json b/.changes/703da74b-6f77-4555-b129-295486571361.json new file mode 100644 index 00000000000..9f8f3a23464 --- /dev/null +++ b/.changes/703da74b-6f77-4555-b129-295486571361.json @@ -0,0 +1,9 @@ +{ + "id": "703da74b-6f77-4555-b129-295486571361", + "type": "feature", + "description": "Publish a BOM and a Version Catalog", + "issues": [ + "awslabs/aws-sdk-kotlin#605", + "awslabs/aws-sdk-kotlin#805" + ] +} \ No newline at end of file diff --git a/bom/build.gradle.kts b/bom/build.gradle.kts new file mode 100644 index 00000000000..3e5939e1a7a --- /dev/null +++ b/bom/build.gradle.kts @@ -0,0 +1,90 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +import aws.sdk.kotlin.gradle.dsl.configurePublishing +import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension +import org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper +import org.jetbrains.kotlin.gradle.plugin.KotlinTarget +import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMetadataTarget +import org.jetbrains.kotlin.gradle.targets.js.KotlinJsTarget +import java.util.* + +plugins { + `maven-publish` + `java-platform` + `version-catalog` +} + +val sdkVersion: String by project + +group = "aws.sdk.kotlin" +version = sdkVersion + +val evaluateAfter = listOf(":services", ":aws-runtime", ":tests", ":codegen") +evaluateAfter.forEach { evaluationDependsOn(it) } + +fun createBomConstraintsAndVersionCatalog() { + val bomConstraints: DependencyConstraintHandler = dependencies.constraints + val catalogExt = catalog + + rootProject.subprojects { + val subproject = this + val hasMavenPublish = subproject.plugins.hasPlugin("maven-publish") + if (!hasMavenPublish) { + logger.info("skipping bom and version-catalog entry for ${subproject.name}") + return@subprojects + } + subproject.plugins.withType { + subproject.extensions.getByType().targets.all { + val target = this + val gavCoordinates = gav(target) + bomConstraints.api(gavCoordinates) + catalogExt.versionCatalog { + val prefix = when { + subproject.path.contains(":services") -> "services-" + subproject.path.contains(":aws-runtime") -> "runtime-" + else -> "" + } + val alias = prefix + artifactId(target) + library(alias, gavCoordinates) + } + } + } + } +} + +fun Project.artifactId(target: KotlinTarget): String = when (target) { + is KotlinMetadataTarget -> name + is KotlinJsTarget -> "$name-js" + else -> "$name-${target.targetName.toLowerCase(Locale.ROOT)}" +} + +/** + * Returns a string like "aws.sdk.kotlin:s3-linuxx64:1.0.2" for this target. + */ +fun Project.gav(target: KotlinTarget): String { + val artifactId = artifactId(target) + return "$group:$artifactId:$version" +} + +fun DependencyConstraintHandler.api(constraintNotation: Any) = + add("api", constraintNotation) + +createBomConstraintsAndVersionCatalog() + +configurePublishing("aws-sdk-kotlin") + +publishing { + publications { + create("bom", MavenPublication::class) { + artifactId = "bom" + from(project.components.getByName("javaPlatform")) + } + + create("versionCatalog") { + artifactId = "version-catalog" + from(components["versionCatalog"]) + } + } +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 13c30b4def6..d910c8a8a1a 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -37,6 +37,7 @@ rootProject.name = "aws-sdk-kotlin" includeBuild("./gradle/sdk-plugins") include(":dokka-aws") +include(":bom") include(":codegen:sdk") include(":codegen:smithy-aws-kotlin-codegen") include(":codegen:protocol-tests") @@ -45,6 +46,7 @@ include(":aws-runtime:aws-core") include(":aws-runtime:aws-config") include(":aws-runtime:aws-endpoint") include(":aws-runtime:aws-http") +include(":services") include(":tests") include(":tests:benchmarks:service-benchmarks") include(":tests:codegen:event-stream") From 0a09bd0b8597719fbfecda60b661c28c7fc90133 Mon Sep 17 00:00:00 2001 From: Matas Date: Tue, 17 Oct 2023 13:45:47 -0400 Subject: [PATCH 08/13] feat: apply clock skew interceptor (#1065) --- .../8665c18c-d742-4212-b920-6fea43f70c2c.json | 5 ++++ .../ServiceClientCompanionObjectWriter.kt | 7 ++---- .../kotlin/codegen/customization/ClockSkew.kt | 24 +++++++++++++++++++ ...tlin.codegen.integration.KotlinIntegration | 3 ++- gradle/libs.versions.toml | 2 +- 5 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 .changes/8665c18c-d742-4212-b920-6fea43f70c2c.json create mode 100644 codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/customization/ClockSkew.kt diff --git a/.changes/8665c18c-d742-4212-b920-6fea43f70c2c.json b/.changes/8665c18c-d742-4212-b920-6fea43f70c2c.json new file mode 100644 index 00000000000..ee4ec3c85bd --- /dev/null +++ b/.changes/8665c18c-d742-4212-b920-6fea43f70c2c.json @@ -0,0 +1,5 @@ +{ + "id": "8665c18c-d742-4212-b920-6fea43f70c2c", + "type": "feature", + "description": "Detect and automatically correct clock skew to prevent signing errors" +} \ No newline at end of file diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/ServiceClientCompanionObjectWriter.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/ServiceClientCompanionObjectWriter.kt index 6de96955487..65f18d85c35 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/ServiceClientCompanionObjectWriter.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/ServiceClientCompanionObjectWriter.kt @@ -4,10 +4,7 @@ */ package aws.sdk.kotlin.codegen -import software.amazon.smithy.kotlin.codegen.core.KotlinWriter -import software.amazon.smithy.kotlin.codegen.core.RuntimeTypes -import software.amazon.smithy.kotlin.codegen.core.getContextValue -import software.amazon.smithy.kotlin.codegen.core.withBlock +import software.amazon.smithy.kotlin.codegen.core.* import software.amazon.smithy.kotlin.codegen.integration.SectionWriter import software.amazon.smithy.kotlin.codegen.lang.KotlinTypes import software.amazon.smithy.kotlin.codegen.rendering.ServiceClientGenerator @@ -49,8 +46,8 @@ class ServiceClientCompanionObjectWriter( RuntimeTypes.Core.Utils.LazyAsyncValue, AwsRuntimeTypes.Config.Profile.AwsSharedConfig, ) { + declareSection(ServiceClientGenerator.Sections.FinalizeConfig) writeResolveEndpointUrl() - extendFinalizeConfig?.let { write("") it() diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/customization/ClockSkew.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/customization/ClockSkew.kt new file mode 100644 index 00000000000..3a8372fbb70 --- /dev/null +++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/customization/ClockSkew.kt @@ -0,0 +1,24 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +package aws.sdk.kotlin.codegen.customization + +import software.amazon.smithy.kotlin.codegen.core.RuntimeTypes +import software.amazon.smithy.kotlin.codegen.integration.KotlinIntegration +import software.amazon.smithy.kotlin.codegen.integration.SectionWriter +import software.amazon.smithy.kotlin.codegen.integration.SectionWriterBinding +import software.amazon.smithy.kotlin.codegen.rendering.ServiceClientGenerator + +/** + * Adds a section writer which applies an interceptor that detects and corrects clock skew + */ +class ClockSkew : KotlinIntegration { + override val sectionWriters: List + get() = listOf(SectionWriterBinding(ServiceClientGenerator.Sections.FinalizeConfig, clockSkewSectionWriter)) + + private val clockSkewSectionWriter = SectionWriter { writer, _ -> + val interceptorSymbol = RuntimeTypes.AwsProtocolCore.ClockSkewInterceptor + writer.write("builder.config.interceptors.add(0, #T())", interceptorSymbol) + } +} diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/resources/META-INF/services/software.amazon.smithy.kotlin.codegen.integration.KotlinIntegration b/codegen/smithy-aws-kotlin-codegen/src/main/resources/META-INF/services/software.amazon.smithy.kotlin.codegen.integration.KotlinIntegration index 74d185c1ab1..7286d1ee3a2 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/main/resources/META-INF/services/software.amazon.smithy.kotlin.codegen.integration.KotlinIntegration +++ b/codegen/smithy-aws-kotlin-codegen/src/main/resources/META-INF/services/software.amazon.smithy.kotlin.codegen.integration.KotlinIntegration @@ -29,4 +29,5 @@ aws.sdk.kotlin.codegen.customization.s3control.HostPrefixFilter aws.sdk.kotlin.codegen.customization.s3control.ClientConfigIntegration aws.sdk.kotlin.codegen.protocols.endpoints.BindAwsEndpointBuiltins aws.sdk.kotlin.codegen.customization.s3.HostPrefixRequestRouteFilter -aws.sdk.kotlin.codegen.customization.s3.UnwrappedXmlOutputIntegration \ No newline at end of file +aws.sdk.kotlin.codegen.customization.s3.UnwrappedXmlOutputIntegration +aws.sdk.kotlin.codegen.customization.ClockSkew \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 69574293afb..960c262e8dd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,7 +7,7 @@ coroutines-version = "1.7.3" atomicfu-version = "0.19.0" # smithy-kotlin codegen and runtime are versioned together -smithy-kotlin-version = "0.27.7" +smithy-kotlin-version = "0.27.8-SNAPSHOT" # codegen smithy-version = "1.39.0" From b417e608f09794f196666b0564e87393ecb9bb68 Mon Sep 17 00:00:00 2001 From: 0marperez <60363173+0marperez@users.noreply.github.com> Date: Wed, 18 Oct 2023 14:47:04 -0600 Subject: [PATCH 09/13] misc: start testing RestXmlXmlMapWithXmlNamespace (#1076) --- .../codegen/protocols/core/AwsHttpBindingProtocolGenerator.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/core/AwsHttpBindingProtocolGenerator.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/core/AwsHttpBindingProtocolGenerator.kt index c05245c0624..ac5b0e80e4c 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/core/AwsHttpBindingProtocolGenerator.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/core/AwsHttpBindingProtocolGenerator.kt @@ -70,9 +70,6 @@ abstract class AwsHttpBindingProtocolGenerator : HttpBindingProtocolGenerator() // FIXME - missing Content-Type on restXml empty payloads, see https://github.com/awslabs/aws-sdk-kotlin/issues/1050 "RestXmlHttpPayloadWithUnsetUnion", - - // FIXME - xmlns incorrect in XML maps, see https://github.com/awslabs/smithy-kotlin/issues/957 - "RestXmlXmlMapWithXmlNamespace", ), ) From 82134e3eba5cae90094a5a753db9ceb93346e5b7 Mon Sep 17 00:00:00 2001 From: Aaron Todd Date: Thu, 19 Oct 2023 08:52:43 -0400 Subject: [PATCH 10/13] fix(rt): ignore empty env variable and system properties for AWS credentials (#1080) --- .../1691b2fe-15ba-4bf8-8f27-382b59c792c8.json | 5 ++++ .../EnvironmentCredentialsProvider.kt | 2 +- .../SystemPropertyCredentialsProvider.kt | 2 +- .../EnvironmentCredentialsProviderTest.kt | 28 ++++++++++++++++--- .../SystemPropertyCredentialsProviderTest.kt | 28 ++++++++++++++++--- 5 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 .changes/1691b2fe-15ba-4bf8-8f27-382b59c792c8.json diff --git a/.changes/1691b2fe-15ba-4bf8-8f27-382b59c792c8.json b/.changes/1691b2fe-15ba-4bf8-8f27-382b59c792c8.json new file mode 100644 index 00000000000..5a048d3184e --- /dev/null +++ b/.changes/1691b2fe-15ba-4bf8-8f27-382b59c792c8.json @@ -0,0 +1,5 @@ +{ + "id": "1691b2fe-15ba-4bf8-8f27-382b59c792c8", + "type": "bugfix", + "description": "Ignore empty environment variable and system property strings when evaluating AWS credentials" +} \ No newline at end of file diff --git a/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/EnvironmentCredentialsProvider.kt b/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/EnvironmentCredentialsProvider.kt index 7f77ecb75b5..3dd31fdeb5e 100644 --- a/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/EnvironmentCredentialsProvider.kt +++ b/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/EnvironmentCredentialsProvider.kt @@ -27,7 +27,7 @@ public class EnvironmentCredentialsProvider( ) : CredentialsProvider { private fun requireEnv(variable: String): String = - getEnv(variable) ?: throw ProviderConfigurationException("Missing value for environment variable `$variable`") + getEnv(variable)?.takeIf(String::isNotBlank) ?: throw ProviderConfigurationException("Missing value for environment variable `$variable`") override suspend fun resolve(attributes: Attributes): Credentials { coroutineContext.trace { diff --git a/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/SystemPropertyCredentialsProvider.kt b/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/SystemPropertyCredentialsProvider.kt index f7b7ccf5cdf..2a274ab029c 100644 --- a/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/SystemPropertyCredentialsProvider.kt +++ b/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/SystemPropertyCredentialsProvider.kt @@ -27,7 +27,7 @@ public class SystemPropertyCredentialsProvider( ) : CredentialsProvider { private fun requireProperty(variable: String): String = - getProperty(variable) ?: throw ProviderConfigurationException("Missing value for system property `$variable`") + getProperty(variable)?.takeIf(String::isNotBlank) ?: throw ProviderConfigurationException("Missing value for system property `$variable`") override suspend fun resolve(attributes: Attributes): Credentials { coroutineContext.trace { diff --git a/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/EnvironmentCredentialsProviderTest.kt b/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/EnvironmentCredentialsProviderTest.kt index 2e2e3ade207..666b3ee0dab 100644 --- a/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/EnvironmentCredentialsProviderTest.kt +++ b/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/EnvironmentCredentialsProviderTest.kt @@ -17,7 +17,7 @@ class EnvironmentCredentialsProviderTest { private fun provider(vararg vars: Pair) = EnvironmentCredentialsProvider((vars.toMap())::get) @Test - fun `it should read from environment variables (incl session token)`() = runTest { + fun testReadFromEnvironmentIncludingSessionToken() = runTest { val provider = provider( AwsSdkSetting.AwsAccessKeyId.envVar to "abc", AwsSdkSetting.AwsSecretAccessKey.envVar to "def", @@ -27,7 +27,7 @@ class EnvironmentCredentialsProviderTest { } @Test - fun `it should read from environment variables (excl session token)`() = runTest { + fun testReadFromEnvironmentExcludingSessionToken() = runTest { val provider = provider( AwsSdkSetting.AwsAccessKeyId.envVar to "abc", AwsSdkSetting.AwsSecretAccessKey.envVar to "def", @@ -36,16 +36,36 @@ class EnvironmentCredentialsProviderTest { } @Test - fun `it should throw an exception on missing access key`() = runTest { + fun testThrowsWhenMissingAccessKey() = runTest { assertFailsWith { provider(AwsSdkSetting.AwsSecretAccessKey.envVar to "def").resolve() }.message.shouldContain("Missing value for environment variable `AWS_ACCESS_KEY_ID`") } @Test - fun `it should throw an exception on missing secret key`() = runTest { + fun testThrowsWhenMissingSecretKey() = runTest { assertFailsWith { provider(AwsSdkSetting.AwsAccessKeyId.envVar to "abc").resolve() }.message.shouldContain("Missing value for environment variable `AWS_SECRET_ACCESS_KEY`") } + + @Test + fun testIgnoresEmptyAccessKey() = runTest { + assertFailsWith { + provider( + AwsSdkSetting.AwsAccessKeyId.envVar to "", + AwsSdkSetting.AwsSecretAccessKey.envVar to "abc", + ).resolve() + }.message.shouldContain("Missing value for environment variable `AWS_ACCESS_KEY_ID`") + } + + @Test + fun testIgnoresEmptySecretKey() = runTest { + assertFailsWith { + provider( + AwsSdkSetting.AwsAccessKeyId.envVar to "abc", + AwsSdkSetting.AwsSecretAccessKey.envVar to "", + ).resolve() + }.message.shouldContain("Missing value for environment variable `AWS_SECRET_ACCESS_KEY`") + } } diff --git a/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/SystemPropertyCredentialsProviderTest.kt b/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/SystemPropertyCredentialsProviderTest.kt index 1753c7317d2..e33ce944f86 100644 --- a/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/SystemPropertyCredentialsProviderTest.kt +++ b/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/SystemPropertyCredentialsProviderTest.kt @@ -17,7 +17,7 @@ class SystemPropertyCredentialsProviderTest { private fun provider(vararg vars: Pair) = SystemPropertyCredentialsProvider((vars.toMap())::get) @Test - fun readAllSystemProperties() = runTest { + fun testReadAllSystemProperties() = runTest { val provider = provider( AwsSdkSetting.AwsAccessKeyId.sysProp to "abc", AwsSdkSetting.AwsSecretAccessKey.sysProp to "def", @@ -27,7 +27,7 @@ class SystemPropertyCredentialsProviderTest { } @Test - fun readAllSystemPropertiesExceptSessionToken() = runTest { + fun testReadAllSystemPropertiesExceptSessionToken() = runTest { val provider = provider( AwsSdkSetting.AwsAccessKeyId.sysProp to "abc", AwsSdkSetting.AwsSecretAccessKey.sysProp to "def", @@ -36,16 +36,36 @@ class SystemPropertyCredentialsProviderTest { } @Test - fun throwsExceptionWhenMissingAccessKey() = runTest { + fun testThrowsExceptionWhenMissingAccessKey() = runTest { assertFailsWith { provider(AwsSdkSetting.AwsSecretAccessKey.sysProp to "def").resolve() }.message.shouldContain("Missing value for system property `aws.accessKeyId`") } @Test - fun throwsExceptionWhenMissingSecretKey() = runTest { + fun testThrowsExceptionWhenMissingSecretKey() = runTest { assertFailsWith { provider(AwsSdkSetting.AwsAccessKeyId.sysProp to "abc").resolve() }.message.shouldContain("Missing value for system property `aws.secretAccessKey`") } + + @Test + fun testIgnoresEmptyAccessKey() = runTest { + assertFailsWith { + provider( + AwsSdkSetting.AwsAccessKeyId.sysProp to "", + AwsSdkSetting.AwsSecretAccessKey.sysProp to "abc", + ).resolve() + }.message.shouldContain("Missing value for system property `aws.accessKeyId`") + } + + @Test + fun testIgnoresEmptySecretKey() = runTest { + assertFailsWith { + provider( + AwsSdkSetting.AwsAccessKeyId.sysProp to "abc", + AwsSdkSetting.AwsSecretAccessKey.sysProp to "", + ).resolve() + }.message.shouldContain("Missing value for system property `aws.secretAccessKey`") + } } From ce9d6d4cc6cae251e102623647d7df4fa304850d Mon Sep 17 00:00:00 2001 From: Aaron Todd Date: Mon, 23 Oct 2023 13:50:37 -0400 Subject: [PATCH 11/13] chore(ci): run release checks on release branch PRs (#1083) --- .github/workflows/codebuild-ci.yml | 4 ++-- .github/workflows/release-check.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codebuild-ci.yml b/.github/workflows/codebuild-ci.yml index d3bcdd1b74b..3e33d81bbd8 100644 --- a/.github/workflows/codebuild-ci.yml +++ b/.github/workflows/codebuild-ci.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} aws-region: us-west-2 @@ -45,7 +45,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} aws-region: us-west-2 diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml index c522c660eab..908d5695ec3 100644 --- a/.github/workflows/release-check.yml +++ b/.github/workflows/release-check.yml @@ -3,7 +3,7 @@ name: Release Checks on: pull_request: types: [ opened, synchronize, reopened ] - branches: [ main ] + branches: [ main, release ] # Allow one instance of this workflow per pull request, and cancel older runs when new changes are pushed concurrency: From 01c34c9d6ca696bc543edaf2c408ca9344717954 Mon Sep 17 00:00:00 2001 From: Aaron Todd Date: Tue, 24 Oct 2023 09:24:58 -0400 Subject: [PATCH 12/13] fix: add smithy-kotlin to our bom and re-export to version catalog (#1082) --- aws-runtime/aws-config/build.gradle.kts | 2 +- bom/build.gradle.kts | 22 ++++++++++++ gradle/libs.versions.toml | 45 ++++++++++++++----------- 3 files changed, 49 insertions(+), 20 deletions(-) diff --git a/aws-runtime/aws-config/build.gradle.kts b/aws-runtime/aws-config/build.gradle.kts index 1db845ea76f..719d66d39a9 100644 --- a/aws-runtime/aws-config/build.gradle.kts +++ b/aws-runtime/aws-config/build.gradle.kts @@ -35,7 +35,7 @@ kotlin { // additional dependencies required by generated sts provider implementation(libs.smithy.kotlin.serde.xml) - implementation(libs.smithy.kotlin.serde.formurl) + implementation(libs.smithy.kotlin.serde.form.url) implementation(libs.smithy.kotlin.aws.xml.protocols) // additional dependencies required by generated sso provider(s) diff --git a/bom/build.gradle.kts b/bom/build.gradle.kts index 3e5939e1a7a..eaa7aa2786f 100644 --- a/bom/build.gradle.kts +++ b/bom/build.gradle.kts @@ -52,6 +52,28 @@ fun createBomConstraintsAndVersionCatalog() { } } } + + val ignoredSmithyKotlin = setOf( + "smithy.kotlin.codegen", + "smithy.kotlin.http.test", + "smithy.kotlin.test", + "smithy.kotlin.smithy.test", + "smithy.kotlin.aws.signing.test", + ) + + // add smithy-kotlin versions to our BOM and allow direct aliasing in the catalog + catalogExt.versionCatalog { + val libsCatalog = extensions.getByType().named("libs") + libsCatalog.libraryAliases + .filter { + it.startsWith("smithy.kotlin") && ignoredSmithyKotlin.none { prefix -> it.startsWith(prefix) } + }.forEach { alias -> + val coordinates = libsCatalog.findLibrary(alias).get() + bomConstraints.api(coordinates) + val newAlias = "runtime-${alias.replace('.', '-')}" + library(newAlias, coordinates.get().toString()) + } + } } fun Project.artifactId(target: KotlinTarget): String = when (target) { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 960c262e8dd..19dfa80b129 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -44,28 +44,35 @@ slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j-version smithy-kotlin-aws-credentials = { module = "aws.smithy.kotlin:aws-credentials", version.ref = "smithy-kotlin-version" } smithy-kotlin-aws-event-stream = { module = "aws.smithy.kotlin:aws-event-stream", version.ref = "smithy-kotlin-version" } +smithy-kotlin-aws-json-protocols = { module = "aws.smithy.kotlin:aws-json-protocols", version.ref = "smithy-kotlin-version" } +smithy-kotlin-aws-protocol-core = { module = "aws.smithy.kotlin:aws-protocol-core", version.ref = "smithy-kotlin-version" } smithy-kotlin-aws-signing-common = { module = "aws.smithy.kotlin:aws-signing-common", version.ref = "smithy-kotlin-version" } +smithy-kotlin-aws-signing-crt = { module = "aws.smithy.kotlin:aws-signing-crt", version.ref = "smithy-kotlin-version" } smithy-kotlin-aws-signing-default = { module = "aws.smithy.kotlin:aws-signing-default", version.ref = "smithy-kotlin-version" } -smithy-kotlin-runtime-core = { module = "aws.smithy.kotlin:runtime-core", version.ref = "smithy-kotlin-version" } -smithy-kotlin-smithy-client = { module = "aws.smithy.kotlin:smithy-client", version.ref = "smithy-kotlin-version" } -smithy-kotlin-smithy-test = { module = "aws.smithy.kotlin:smithy-test", version.ref = "smithy-kotlin-version" } -smithy-kotlin-identity-api = { module = "aws.smithy.kotlin:identity-api", version.ref = "smithy-kotlin-version" } +smithy-kotlin-aws-xml-protocols = { module = "aws.smithy.kotlin:aws-xml-protocols", version.ref = "smithy-kotlin-version" } +smithy-kotlin-crt-util = { module = "aws.smithy.kotlin:crt-util", version.ref = "smithy-kotlin-version" } smithy-kotlin-http = { module = "aws.smithy.kotlin:http", version.ref = "smithy-kotlin-version" } smithy-kotlin-http-auth = { module = "aws.smithy.kotlin:http-auth", version.ref = "smithy-kotlin-version" } +smithy-kotlin-http-auth-api = { module = "aws.smithy.kotlin:http-auth-api", version.ref = "smithy-kotlin-version" } smithy-kotlin-http-auth-aws = { module = "aws.smithy.kotlin:http-auth-aws", version.ref = "smithy-kotlin-version" } smithy-kotlin-http-client = { module = "aws.smithy.kotlin:http-client", version.ref = "smithy-kotlin-version" } -smithy-kotlin-http-client-engine-default = { module = "aws.smithy.kotlin:http-client-engine-default", version.ref = "smithy-kotlin-version" } smithy-kotlin-http-client-engine-crt = { module = "aws.smithy.kotlin:http-client-engine-crt", version.ref = "smithy-kotlin-version" } +smithy-kotlin-http-client-engine-default = { module = "aws.smithy.kotlin:http-client-engine-default", version.ref = "smithy-kotlin-version" } +smithy-kotlin-http-client-engine-okhttp = { module = "aws.smithy.kotlin:http-client-engine-okhttp", version.ref = "smithy-kotlin-version" } smithy-kotlin-http-test = { module = "aws.smithy.kotlin:http-test", version.ref = "smithy-kotlin-version" } -smithy-kotlin-serde-core = { module = "aws.smithy.kotlin:serde", version.ref = "smithy-kotlin-version" } +smithy-kotlin-identity-api = { module = "aws.smithy.kotlin:identity-api", version.ref = "smithy-kotlin-version" } +smithy-kotlin-logging-slf4j2 = { module = "aws.smithy.kotlin:logging-slf4j2", version.ref = "smithy-kotlin-version" } +smithy-kotlin-runtime-core = { module = "aws.smithy.kotlin:runtime-core", version.ref = "smithy-kotlin-version" } +smithy-kotlin-serde = { module = "aws.smithy.kotlin:serde", version.ref = "smithy-kotlin-version" } +smithy-kotlin-serde-form-url = { module = "aws.smithy.kotlin:serde-form-url", version.ref = "smithy-kotlin-version" } smithy-kotlin-serde-json = { module = "aws.smithy.kotlin:serde-json", version.ref = "smithy-kotlin-version" } smithy-kotlin-serde-xml = { module = "aws.smithy.kotlin:serde-xml", version.ref = "smithy-kotlin-version" } -smithy-kotlin-serde-formurl = { module = "aws.smithy.kotlin:serde-form-url", version.ref = "smithy-kotlin-version" } -smithy-kotlin-aws-protocol-core = { module = "aws.smithy.kotlin:aws-protocol-core", version.ref = "smithy-kotlin-version" } -smithy-kotlin-aws-xml-protocols = { module = "aws.smithy.kotlin:aws-xml-protocols", version.ref = "smithy-kotlin-version" } -smithy-kotlin-aws-json-protocols = { module = "aws.smithy.kotlin:aws-json-protocols", version.ref = "smithy-kotlin-version" } +smithy-kotlin-smithy-client = { module = "aws.smithy.kotlin:smithy-client", version.ref = "smithy-kotlin-version" } +smithy-kotlin-smithy-test = { module = "aws.smithy.kotlin:smithy-test", version.ref = "smithy-kotlin-version" } smithy-kotlin-telemetry-api = { module = "aws.smithy.kotlin:telemetry-api", version.ref = "smithy-kotlin-version" } smithy-kotlin-telemetry-defaults = { module = "aws.smithy.kotlin:telemetry-defaults", version.ref = "smithy-kotlin-version" } +smithy-kotlin-telemetry-provider-otel = { module = "aws.smithy.kotlin:telemetry-provider-otel", version.ref = "smithy-kotlin-version" } +smithy-kotlin-test-suite = { module = "aws.smithy.kotlin:test-suite", version.ref = "smithy-kotlin-version" } smithy-kotlin-testing = { module = "aws.smithy.kotlin:testing", version.ref = "smithy-kotlin-version" } smithy-kotlin-codegen = { module = "software.amazon.smithy.kotlin:smithy-kotlin-codegen", version.ref = "smithy-kotlin-version" } @@ -96,19 +103,19 @@ mockk = { module = "io.mockk:mockk", version.ref = "mockk-version" } [bundles] # bundle of smithy-kotlin dependencies all AWS service clients have smithy-kotlin-service-client = [ - "smithy-kotlin-runtime-core", - "smithy-kotlin-smithy-client", - "smithy-kotlin-http-client", - "smithy-kotlin-http-client-engine-default", - "smithy-kotlin-http", - "smithy-kotlin-http-auth", - "smithy-kotlin-http-auth-aws", + "smithy-kotlin-aws-credentials", "smithy-kotlin-aws-protocol-core", - "smithy-kotlin-serde-core", "smithy-kotlin-aws-signing-common", "smithy-kotlin-aws-signing-default", + "smithy-kotlin-http", + "smithy-kotlin-http-auth", + "smithy-kotlin-http-auth-aws", + "smithy-kotlin-http-client", + "smithy-kotlin-http-client-engine-default", "smithy-kotlin-identity-api", - "smithy-kotlin-aws-credentials", + "smithy-kotlin-runtime-core", + "smithy-kotlin-serde", + "smithy-kotlin-smithy-client", "smithy-kotlin-telemetry-api", "smithy-kotlin-telemetry-defaults", ] From e9a321e1a22ac83202087d2df468d752208e6fbb Mon Sep 17 00:00:00 2001 From: Matas Date: Wed, 25 Oct 2023 09:22:22 -0400 Subject: [PATCH 13/13] feat: add base implementation of linuxX64 target (#1058) --- .../07646ee7-9b1a-4d59-b298-ab1740caf763.json | 5 + .../3b368bab-1a77-400c-9777-be183dbe9bdc.json | 5 + .../80721b55-6e70-4bfe-a6b3-8806605c079e.json | 5 + .github/workflows/continuous-integration.yml | 2 +- aws-runtime/aws-config/api/aws-config.api | 1 + aws-runtime/aws-config/build.gradle.kts | 10 +- .../credentials/ImdsCredentialsProvider.kt | 5 +- .../ImdsCredentialsProviderTest.kt | 200 +++++------------- .../SystemPropertyCredentialsProviderTest.kt | 2 +- .../auth/credentials/SdkIOException.kt | 10 - .../ImdsCredentialsProviderTest.kt | 153 ++++++++++++++ .../ProcessCredentialsProviderTest.kt | 0 .../config/AbstractAwsSdkClientFactoryTest.kt | 3 + .../config/profile/AwsConfigLoaderTest.kt | 0 .../config/profile/AwsConfigParserTest.kt | 0 .../auth/credentials/executeCommandNative.kt | 18 ++ .../DefaultRegionProviderChainNative.kt | 26 +++ .../http/AwsUserAgentMetadataNative.kt | 8 + build.gradle.kts | 6 +- builder.json | 6 +- .../codegen/EndpointUrlConfigNamesTest.kt | 14 +- docs/dokka-presets/css/aws-styles.css | 32 ++- docs/dokka-presets/css/logo-styles.css | 19 +- docs/dokka-presets/templates/base.ftl | 46 ++-- .../templates/includes/footer.ftl | 7 +- .../templates/includes/header.ftl | 51 +++-- .../templates/includes/page_metadata.ftl | 1 + .../includes/source_set_selector.ftl | 3 +- .../aws/sdk/kotlin/dokka/AwsDokkaPlugin.kt | 5 + examples/build.gradle.kts | 2 +- gradle.properties | 7 +- gradle/libs.versions.toml | 16 +- gradle/wrapper/gradle-wrapper.properties | 2 +- .../sdk/kotlin/services/polly/PollyTest.kt | 22 +- ...angeResourceRecordSetsUnmarshallingTest.kt | 12 +- .../kotlin/services/s3/CreateClientTest.kt | 1 + ...BucketLocationOperationDeserializerTest.kt | 8 +- .../services/s3/presigners/PresignersTest.kt | 1 + .../service-benchmarks/build.gradle.kts | 2 +- .../benchmarks/service/BenchmarkHarness.kt | 0 .../sdk/kotlin/benchmarks/service/Common.kt | 0 .../kotlin/benchmarks/service/ResultsTable.kt | 0 .../definitions/CloudwatchBenchmark.kt | 0 .../definitions/CloudwatchEventsBenchmark.kt | 0 .../service/definitions/DynamoDbBenchmark.kt | 0 .../service/definitions/PinpointBenchmark.kt | 0 .../service/definitions/S3Benchmark.kt | 0 .../service/definitions/ServiceBenchmark.kt | 0 .../service/definitions/SnsBenchmark.kt | 0 .../service/definitions/StsBenchmark.kt | 0 .../telemetry/BenchmarkTelemetryProvider.kt | 0 .../telemetry/ConcurrentListBuilder.kt | 0 .../service/telemetry/MetricAggregator.kt | 0 .../telemetry/ConcurrentListBuilderTest.kt | 0 .../service/telemetry/MetricAggregatorTest.kt | 2 +- .../ecs-credentials/app/build.gradle.kts | 2 +- 56 files changed, 452 insertions(+), 268 deletions(-) create mode 100644 .changes/07646ee7-9b1a-4d59-b298-ab1740caf763.json create mode 100644 .changes/3b368bab-1a77-400c-9777-be183dbe9bdc.json create mode 100644 .changes/80721b55-6e70-4bfe-a6b3-8806605c079e.json delete mode 100644 aws-runtime/aws-config/jvm/src/aws/sdk/kotlin/runtime/auth/credentials/SdkIOException.kt create mode 100644 aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProviderTest.kt rename aws-runtime/aws-config/{common => jvm}/test/aws/sdk/kotlin/runtime/auth/credentials/ProcessCredentialsProviderTest.kt (100%) rename aws-runtime/aws-config/{common => jvm}/test/aws/sdk/kotlin/runtime/config/profile/AwsConfigLoaderTest.kt (100%) rename aws-runtime/aws-config/{common => jvm}/test/aws/sdk/kotlin/runtime/config/profile/AwsConfigParserTest.kt (100%) create mode 100644 aws-runtime/aws-config/native/src/aws/sdk/kotlin/runtime/auth/credentials/executeCommandNative.kt create mode 100644 aws-runtime/aws-config/native/src/aws/sdk/kotlin/runtime/region/DefaultRegionProviderChainNative.kt create mode 100644 aws-runtime/aws-http/native/src/aws/sdk/kotlin/runtime/http/AwsUserAgentMetadataNative.kt rename tests/benchmarks/service-benchmarks/{common => jvm}/src/aws/sdk/kotlin/benchmarks/service/BenchmarkHarness.kt (100%) rename tests/benchmarks/service-benchmarks/{common => jvm}/src/aws/sdk/kotlin/benchmarks/service/Common.kt (100%) rename tests/benchmarks/service-benchmarks/{common => jvm}/src/aws/sdk/kotlin/benchmarks/service/ResultsTable.kt (100%) rename tests/benchmarks/service-benchmarks/{common => jvm}/src/aws/sdk/kotlin/benchmarks/service/definitions/CloudwatchBenchmark.kt (100%) rename tests/benchmarks/service-benchmarks/{common => jvm}/src/aws/sdk/kotlin/benchmarks/service/definitions/CloudwatchEventsBenchmark.kt (100%) rename tests/benchmarks/service-benchmarks/{common => jvm}/src/aws/sdk/kotlin/benchmarks/service/definitions/DynamoDbBenchmark.kt (100%) rename tests/benchmarks/service-benchmarks/{common => jvm}/src/aws/sdk/kotlin/benchmarks/service/definitions/PinpointBenchmark.kt (100%) rename tests/benchmarks/service-benchmarks/{common => jvm}/src/aws/sdk/kotlin/benchmarks/service/definitions/S3Benchmark.kt (100%) rename tests/benchmarks/service-benchmarks/{common => jvm}/src/aws/sdk/kotlin/benchmarks/service/definitions/ServiceBenchmark.kt (100%) rename tests/benchmarks/service-benchmarks/{common => jvm}/src/aws/sdk/kotlin/benchmarks/service/definitions/SnsBenchmark.kt (100%) rename tests/benchmarks/service-benchmarks/{common => jvm}/src/aws/sdk/kotlin/benchmarks/service/definitions/StsBenchmark.kt (100%) rename tests/benchmarks/service-benchmarks/{common => jvm}/src/aws/sdk/kotlin/benchmarks/service/telemetry/BenchmarkTelemetryProvider.kt (100%) rename tests/benchmarks/service-benchmarks/{common => jvm}/src/aws/sdk/kotlin/benchmarks/service/telemetry/ConcurrentListBuilder.kt (100%) rename tests/benchmarks/service-benchmarks/{common => jvm}/src/aws/sdk/kotlin/benchmarks/service/telemetry/MetricAggregator.kt (100%) rename tests/benchmarks/service-benchmarks/{common => jvm}/test/aws/sdk/kotlin/benchmarks/service/telemetry/ConcurrentListBuilderTest.kt (100%) rename tests/benchmarks/service-benchmarks/{common => jvm}/test/aws/sdk/kotlin/benchmarks/service/telemetry/MetricAggregatorTest.kt (98%) diff --git a/.changes/07646ee7-9b1a-4d59-b298-ab1740caf763.json b/.changes/07646ee7-9b1a-4d59-b298-ab1740caf763.json new file mode 100644 index 00000000000..9f45233f982 --- /dev/null +++ b/.changes/07646ee7-9b1a-4d59-b298-ab1740caf763.json @@ -0,0 +1,5 @@ +{ + "id": "07646ee7-9b1a-4d59-b298-ab1740caf763", + "type": "misc", + "description": "Upgrade Kotlin to 1.9.10" +} \ No newline at end of file diff --git a/.changes/3b368bab-1a77-400c-9777-be183dbe9bdc.json b/.changes/3b368bab-1a77-400c-9777-be183dbe9bdc.json new file mode 100644 index 00000000000..b2d45d3fb40 --- /dev/null +++ b/.changes/3b368bab-1a77-400c-9777-be183dbe9bdc.json @@ -0,0 +1,5 @@ +{ + "id": "3b368bab-1a77-400c-9777-be183dbe9bdc", + "type": "misc", + "description": "Upgrade Dokka to 1.9.0" +} \ No newline at end of file diff --git a/.changes/80721b55-6e70-4bfe-a6b3-8806605c079e.json b/.changes/80721b55-6e70-4bfe-a6b3-8806605c079e.json new file mode 100644 index 00000000000..2e8b9591ddf --- /dev/null +++ b/.changes/80721b55-6e70-4bfe-a6b3-8806605c079e.json @@ -0,0 +1,5 @@ +{ + "id": "80721b55-6e70-4bfe-a6b3-8806605c079e", + "type": "misc", + "description": "Add skeleton implementation of a second KMP target" +} \ No newline at end of file diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 305348a26d4..e72098f0784 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -69,7 +69,7 @@ jobs: pwd ./gradlew publishToMavenLocal ./gradlew apiCheck - ./gradlew test allTests + ./gradlew test jvmTest ./gradlew testAllProtocols - name: Save Test Reports if: failure() diff --git a/aws-runtime/aws-config/api/aws-config.api b/aws-runtime/aws-config/api/aws-config.api index b92308801af..f14437aecbc 100644 --- a/aws-runtime/aws-config/api/aws-config.api +++ b/aws-runtime/aws-config/api/aws-config.api @@ -262,6 +262,7 @@ public final class aws/sdk/kotlin/runtime/config/imds/EndpointMode : java/lang/E public static final field Companion Laws/sdk/kotlin/runtime/config/imds/EndpointMode$Companion; public static final field IPv4 Laws/sdk/kotlin/runtime/config/imds/EndpointMode; public static final field IPv6 Laws/sdk/kotlin/runtime/config/imds/EndpointMode; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/runtime/config/imds/EndpointMode; public static fun values ()[Laws/sdk/kotlin/runtime/config/imds/EndpointMode; } diff --git a/aws-runtime/aws-config/build.gradle.kts b/aws-runtime/aws-config/build.gradle.kts index 719d66d39a9..8079078beec 100644 --- a/aws-runtime/aws-config/build.gradle.kts +++ b/aws-runtime/aws-config/build.gradle.kts @@ -53,11 +53,11 @@ kotlin { implementation(libs.kotlinx.coroutines.test) implementation(libs.smithy.kotlin.http.test) implementation(libs.kotlinx.serialization.json) - implementation(libs.mockk) } } jvmTest { dependencies { + implementation(libs.mockk) implementation(libs.kotest.runner.junit5) } } @@ -192,6 +192,9 @@ NOTE: We need the following tasks to depend on codegen for gradle caching/up-to- * `compileKotlinJvm` (Type=KotlinCompile) * `compileKotlinMetadata` (Type=KotlinCompileCommon) * `sourcesJar` and `jvmSourcesJar` (Type=org.gradle.jvm.tasks.Jar) +* +* For Kotlin/Native, an additional dependency is introduced: +* `compileKotlin` (Type=KotlinNativeCompile) (e.g. compileKotlinLinuxX64) */ val codegenTask = tasks.named("generateSmithyProjections") tasks.withType { @@ -201,6 +204,11 @@ tasks.withType { kotlinOptions.allWarningsAsErrors = false } +tasks.withType { + dependsOn(codegenTask) + kotlinOptions.allWarningsAsErrors = false +} + tasks.withType { dependsOn(codegenTask) } diff --git a/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProvider.kt b/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProvider.kt index 78d5f9f6bac..bb74892ebd8 100644 --- a/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProvider.kt +++ b/aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProvider.kt @@ -16,6 +16,7 @@ import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProviderExceptio import aws.smithy.kotlin.runtime.auth.awscredentials.DEFAULT_CREDENTIALS_REFRESH_SECONDS import aws.smithy.kotlin.runtime.config.resolve import aws.smithy.kotlin.runtime.http.HttpStatusCode +import aws.smithy.kotlin.runtime.io.IOException import aws.smithy.kotlin.runtime.serde.json.JsonDeserializer import aws.smithy.kotlin.runtime.telemetry.logging.info import aws.smithy.kotlin.runtime.telemetry.logging.warn @@ -33,8 +34,6 @@ private const val CREDENTIALS_BASE_PATH: String = "/latest/meta-data/iam/securit private const val CODE_ASSUME_ROLE_UNAUTHORIZED_ACCESS: String = "AssumeRoleUnauthorizedAccess" private const val PROVIDER_NAME = "IMDSv2" -internal expect class SdkIOException : Exception // FIXME move this to the proper place when we do the larger KMP Exception refactor - /** * [CredentialsProvider] that uses EC2 instance metadata service (IMDS) to provide credentials information. * 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) @@ -145,7 +144,7 @@ public class ImdsCredentialsProvider( } private suspend fun useCachedCredentials(ex: Exception): Credentials? = when { - ex is SdkIOException || ex is EC2MetadataError && ex.statusCode == HttpStatusCode.InternalServerError.value -> { + ex is IOException || ex is EC2MetadataError && ex.statusCode == HttpStatusCode.InternalServerError.value -> { mu.withLock { previousCredentials?.apply { nextRefresh = clock.now() + DEFAULT_CREDENTIALS_REFRESH_SECONDS.seconds } } diff --git a/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProviderTest.kt b/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProviderTest.kt index b3eebe13d62..2af476bfdac 100644 --- a/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProviderTest.kt +++ b/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProviderTest.kt @@ -2,24 +2,21 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package aws.sdk.kotlin.runtime.auth.credentials import aws.sdk.kotlin.runtime.config.AwsSdkSetting import aws.sdk.kotlin.runtime.config.imds.* +import aws.sdk.kotlin.runtime.config.imds.DEFAULT_TOKEN_TTL_SECONDS import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProviderException -import aws.smithy.kotlin.runtime.http.Headers -import aws.smithy.kotlin.runtime.http.HttpBody -import aws.smithy.kotlin.runtime.http.HttpCall -import aws.smithy.kotlin.runtime.http.HttpMethod -import aws.smithy.kotlin.runtime.http.HttpStatusCode +import aws.smithy.kotlin.runtime.http.* import aws.smithy.kotlin.runtime.http.engine.HttpClientEngineBase import aws.smithy.kotlin.runtime.http.engine.HttpClientEngineConfig import aws.smithy.kotlin.runtime.http.request.HttpRequest import aws.smithy.kotlin.runtime.http.response.HttpResponse import aws.smithy.kotlin.runtime.httptest.TestEngine import aws.smithy.kotlin.runtime.httptest.buildTestConnection +import aws.smithy.kotlin.runtime.io.IOException import aws.smithy.kotlin.runtime.net.Host import aws.smithy.kotlin.runtime.net.Scheme import aws.smithy.kotlin.runtime.net.Url @@ -30,24 +27,17 @@ import aws.smithy.kotlin.runtime.time.epochMilliseconds import aws.smithy.kotlin.runtime.time.fromEpochMilliseconds import aws.smithy.kotlin.runtime.util.TestPlatformProvider import io.kotest.matchers.string.shouldContain -import io.mockk.coVerify -import io.mockk.spyk import kotlinx.coroutines.test.runTest -import kotlin.test.Test -import kotlin.test.assertEquals -import kotlin.test.assertFailsWith -import kotlin.test.assertIs -import kotlin.test.assertNotEquals -import kotlin.time.Duration.Companion.minutes +import kotlin.test.* import kotlin.time.Duration.Companion.seconds -private val ec2MetadataDisabledPlatform = TestPlatformProvider( - env = mapOf(AwsSdkSetting.AwsEc2MetadataDisabled.envVar to "true"), -) -private val ec2MetadataEnabledPlatform = TestPlatformProvider() - class ImdsCredentialsProviderTest { + private val ec2MetadataDisabledPlatform = TestPlatformProvider( + env = mapOf(AwsSdkSetting.AwsEc2MetadataDisabled.envVar to "true"), + ) + private val ec2MetadataEnabledPlatform = TestPlatformProvider() + @Test fun testImdsDisabled() = runTest { val platform = ec2MetadataDisabledPlatform @@ -73,7 +63,10 @@ class ImdsCredentialsProviderTest { imdsResponse("imds-test-role"), ) expect( - imdsRequest("http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role", "TOKEN_A"), + imdsRequest( + "http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role", + "TOKEN_A", + ), imdsResponse( """ { @@ -95,7 +88,10 @@ class ImdsCredentialsProviderTest { imdsResponse("imds-test-role-2"), ) expect( - imdsRequest("http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role-2", "TOKEN_A"), + imdsRequest( + "http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role-2", + "TOKEN_A", + ), imdsResponse( """ { @@ -158,7 +154,10 @@ class ImdsCredentialsProviderTest { ) // no request for profile, go directly to retrieving role credentials expect( - imdsRequest("http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role", "TOKEN_A"), + imdsRequest( + "http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role", + "TOKEN_A", + ), imdsResponse( """ { @@ -286,7 +285,10 @@ class ImdsCredentialsProviderTest { tokenResponse(DEFAULT_TOKEN_TTL_SECONDS, "TOKEN_A"), ) expect( - imdsRequest("http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role", "TOKEN_A"), + imdsRequest( + "http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role", + "TOKEN_A", + ), imdsResponse( """ { @@ -329,128 +331,6 @@ class ImdsCredentialsProviderTest { assertEquals(expected, actual) } - // SDK can perform 3 successive requests with expired credentials. IMDS must only be called once. - @Test - fun testSuccessiveRequestsOnlyCallIMDSOnce() = runTest { - val connection = buildTestConnection { - expect( - tokenRequest("http://169.254.169.254", DEFAULT_TOKEN_TTL_SECONDS), - tokenResponse(DEFAULT_TOKEN_TTL_SECONDS, "TOKEN_A"), - ) - expect( - imdsRequest("http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role", "TOKEN_A"), - imdsResponse( - """ - { - "Code" : "Success", - "LastUpdated" : "2021-09-17T20:57:08Z", - "Type" : "AWS-HMAC", - "AccessKeyId" : "ASIARTEST", - "SecretAccessKey" : "xjtest", - "Token" : "IQote///test", - "Expiration" : "2021-09-18T03:31:56Z" - } - """, - ), - ) - } - - val testClock = ManualClock() - - val client = spyk( - ImdsClient { - engine = connection - clock = testClock - }, - ) - - val provider = ImdsCredentialsProvider( - profileOverride = "imds-test-role", - client = lazyOf(client), - clock = testClock, - platformProvider = ec2MetadataEnabledPlatform, - ) - - // call resolve 3 times - repeat(3) { - provider.resolve() - } - - // make sure ImdsClient only gets called once - coVerify(exactly = 1) { - client.get(any()) - } - } - - @Test - fun testDontRefreshUntilNextRefreshTimeHasPassed() = runTest { - val connection = buildTestConnection { - expect( - tokenRequest("http://169.254.169.254", DEFAULT_TOKEN_TTL_SECONDS), - tokenResponse(DEFAULT_TOKEN_TTL_SECONDS, "TOKEN_A"), - ) - expect( - imdsRequest("http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role", "TOKEN_A"), - imdsResponse( - """ - { - "Code" : "Success", - "LastUpdated" : "2021-09-17T20:57:08Z", - "Type" : "AWS-HMAC", - "AccessKeyId" : "ASIARTEST", - "SecretAccessKey" : "xjtest", - "Token" : "IQote///test", - "Expiration" : "2021-09-18T03:31:56Z" - } - """, - ), - ) - expect( - imdsRequest("http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role", "TOKEN_A"), - imdsResponse( - """ - { - "Code" : "Success", - "LastUpdated" : "2021-09-17T20:57:08Z", - "Type" : "AWS-HMAC", - "AccessKeyId" : "NEWCREDENTIALS", - "SecretAccessKey" : "shhh", - "Token" : "IQote///test", - "Expiration" : "2022-10-05T03:31:56Z" - } - """, - ), - ) - } - - val testClock = ManualClock() - - val client = spyk( - ImdsClient { - engine = connection - clock = testClock - }, - ) - - val provider = ImdsCredentialsProvider( - profileOverride = "imds-test-role", - client = lazyOf(client), - clock = testClock, - platformProvider = ec2MetadataEnabledPlatform, - ) - - val first = provider.resolve() - testClock.advance(20.minutes) // 20 minutes later, we should try to refresh the expired credentials - val second = provider.resolve() - - coVerify(exactly = 2) { - client.get(any()) - } - - // make sure we did not just serve the previous credentials - assertNotEquals(first, second) - } - @Test fun testUsesPreviousCredentialsOnReadTimeout() = runTest { val testClock = ManualClock() @@ -464,7 +344,7 @@ class ImdsCredentialsProviderTest { override suspend fun roundTrip(context: ExecutionContext, request: HttpRequest): HttpCall { if (successfulCallCount >= 2) { - throw SdkIOException() + throw IOException() } else { successfulCallCount += 1 @@ -475,8 +355,12 @@ class ImdsCredentialsProviderTest { testClock.now(), testClock.now(), ) + else -> HttpCall( - imdsRequest("http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role", "TOKEN_A"), + imdsRequest( + "http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role", + "TOKEN_A", + ), imdsResponse( """ { @@ -530,7 +414,7 @@ class ImdsCredentialsProviderTest { @Test fun testThrowsExceptionOnReadTimeoutWhenMissingPreviousCredentials() = runTest { - val readTimeoutEngine = TestEngine { _, _ -> throw SdkIOException() } + val readTimeoutEngine = TestEngine { _, _ -> throw IOException() } val testClock = ManualClock() val client = ImdsClient { @@ -564,7 +448,12 @@ class ImdsCredentialsProviderTest { override suspend fun roundTrip(context: ExecutionContext, request: HttpRequest): HttpCall { if (successfulCallCount >= 2) { return HttpCall( - HttpRequest(HttpMethod.GET, Url(Scheme.HTTP, Host.parse("test"), Scheme.HTTP.defaultPort, "/path/foo/bar"), Headers.Empty, HttpBody.Empty), + HttpRequest( + HttpMethod.GET, + Url(Scheme.HTTP, Host.parse("test"), Scheme.HTTP.defaultPort, "/path/foo/bar"), + Headers.Empty, + HttpBody.Empty, + ), HttpResponse(HttpStatusCode.InternalServerError, Headers.Empty, HttpBody.Empty), testClock.now(), testClock.now(), @@ -579,8 +468,12 @@ class ImdsCredentialsProviderTest { testClock.now(), testClock.now(), ) + else -> HttpCall( - imdsRequest("http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role", "TOKEN_A"), + imdsRequest( + "http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role", + "TOKEN_A", + ), imdsResponse( """ { @@ -639,7 +532,12 @@ class ImdsCredentialsProviderTest { // this engine just returns 500 errors val internalServerErrorEngine = TestEngine { _, _ -> HttpCall( - HttpRequest(HttpMethod.GET, Url(Scheme.HTTP, Host.parse("test"), Scheme.HTTP.defaultPort, "/path/foo/bar"), Headers.Empty, HttpBody.Empty), + HttpRequest( + HttpMethod.GET, + Url(Scheme.HTTP, Host.parse("test"), Scheme.HTTP.defaultPort, "/path/foo/bar"), + Headers.Empty, + HttpBody.Empty, + ), HttpResponse(HttpStatusCode.InternalServerError, Headers.Empty, HttpBody.Empty), testClock.now(), testClock.now(), diff --git a/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/SystemPropertyCredentialsProviderTest.kt b/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/SystemPropertyCredentialsProviderTest.kt index e33ce944f86..4c16609885f 100644 --- a/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/SystemPropertyCredentialsProviderTest.kt +++ b/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/SystemPropertyCredentialsProviderTest.kt @@ -9,7 +9,7 @@ import aws.sdk.kotlin.runtime.config.AwsSdkSetting import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials import io.kotest.matchers.string.shouldContain import kotlinx.coroutines.test.runTest -import org.junit.jupiter.api.Test +import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFailsWith diff --git a/aws-runtime/aws-config/jvm/src/aws/sdk/kotlin/runtime/auth/credentials/SdkIOException.kt b/aws-runtime/aws-config/jvm/src/aws/sdk/kotlin/runtime/auth/credentials/SdkIOException.kt deleted file mode 100644 index ac18d2bfb4f..00000000000 --- a/aws-runtime/aws-config/jvm/src/aws/sdk/kotlin/runtime/auth/credentials/SdkIOException.kt +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ -package aws.sdk.kotlin.runtime.auth.credentials - -import java.io.IOException - -@Suppress("ACTUAL_WITHOUT_EXPECT") -internal actual typealias SdkIOException = IOException diff --git a/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProviderTest.kt b/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProviderTest.kt new file mode 100644 index 00000000000..6065431eeb6 --- /dev/null +++ b/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProviderTest.kt @@ -0,0 +1,153 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +package aws.sdk.kotlin.runtime.auth.credentials + +import aws.sdk.kotlin.runtime.config.imds.* +import aws.sdk.kotlin.runtime.config.imds.DEFAULT_TOKEN_TTL_SECONDS +import aws.smithy.kotlin.runtime.httptest.buildTestConnection +import aws.smithy.kotlin.runtime.time.ManualClock +import aws.smithy.kotlin.runtime.util.TestPlatformProvider +import io.mockk.coVerify +import io.mockk.spyk +import kotlinx.coroutines.test.runTest +import kotlin.test.* +import kotlin.time.Duration.Companion.minutes + +class ImdsCredentialsProviderTestJvm { + private val ec2MetadataEnabledPlatform = TestPlatformProvider() + + // FIXME Refactor mocking for KMP + // SDK can perform 3 successive requests with expired credentials. IMDS must only be called once. + @Test + fun testSuccessiveRequestsOnlyCallIMDSOnce() = runTest { + val connection = buildTestConnection { + expect( + tokenRequest("http://169.254.169.254", DEFAULT_TOKEN_TTL_SECONDS), + tokenResponse(DEFAULT_TOKEN_TTL_SECONDS, "TOKEN_A"), + ) + expect( + imdsRequest( + "http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role", + "TOKEN_A", + ), + imdsResponse( + """ + { + "Code" : "Success", + "LastUpdated" : "2021-09-17T20:57:08Z", + "Type" : "AWS-HMAC", + "AccessKeyId" : "ASIARTEST", + "SecretAccessKey" : "xjtest", + "Token" : "IQote///test", + "Expiration" : "2021-09-18T03:31:56Z" + } + """, + ), + ) + } + + val testClock = ManualClock() + + val client = spyk( + ImdsClient { + engine = connection + clock = testClock + }, + ) + + val provider = ImdsCredentialsProvider( + profileOverride = "imds-test-role", + client = lazyOf(client), + clock = testClock, + platformProvider = ec2MetadataEnabledPlatform, + ) + + // call resolve 3 times + repeat(3) { + provider.resolve() + } + + // make sure ImdsClient only gets called once + coVerify(exactly = 1) { + client.get(any()) + } + } + + // FIXME Refactor mocking for KMP + @Test + fun testDontRefreshUntilNextRefreshTimeHasPassed() = runTest { + val connection = buildTestConnection { + expect( + tokenRequest("http://169.254.169.254", DEFAULT_TOKEN_TTL_SECONDS), + tokenResponse(DEFAULT_TOKEN_TTL_SECONDS, "TOKEN_A"), + ) + expect( + imdsRequest( + "http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role", + "TOKEN_A", + ), + imdsResponse( + """ + { + "Code" : "Success", + "LastUpdated" : "2021-09-17T20:57:08Z", + "Type" : "AWS-HMAC", + "AccessKeyId" : "ASIARTEST", + "SecretAccessKey" : "xjtest", + "Token" : "IQote///test", + "Expiration" : "2021-09-18T03:31:56Z" + } + """, + ), + ) + expect( + imdsRequest( + "http://169.254.169.254/latest/meta-data/iam/security-credentials/imds-test-role", + "TOKEN_A", + ), + imdsResponse( + """ + { + "Code" : "Success", + "LastUpdated" : "2021-09-17T20:57:08Z", + "Type" : "AWS-HMAC", + "AccessKeyId" : "NEWCREDENTIALS", + "SecretAccessKey" : "shhh", + "Token" : "IQote///test", + "Expiration" : "2022-10-05T03:31:56Z" + } + """, + ), + ) + } + + val testClock = ManualClock() + + val client = spyk( + ImdsClient { + engine = connection + clock = testClock + }, + ) + + val provider = ImdsCredentialsProvider( + profileOverride = "imds-test-role", + client = lazyOf(client), + clock = testClock, + platformProvider = ec2MetadataEnabledPlatform, + ) + + val first = provider.resolve() + testClock.advance(20.minutes) // 20 minutes later, we should try to refresh the expired credentials + val second = provider.resolve() + + coVerify(exactly = 2) { + client.get(any()) + } + + // make sure we did not just serve the previous credentials + assertNotEquals(first, second) + } +} diff --git a/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/ProcessCredentialsProviderTest.kt b/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/auth/credentials/ProcessCredentialsProviderTest.kt similarity index 100% rename from aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/auth/credentials/ProcessCredentialsProviderTest.kt rename to aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/auth/credentials/ProcessCredentialsProviderTest.kt diff --git a/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/AbstractAwsSdkClientFactoryTest.kt b/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/AbstractAwsSdkClientFactoryTest.kt index daf64bcb56b..0b84bc5ab07 100644 --- a/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/AbstractAwsSdkClientFactoryTest.kt +++ b/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/AbstractAwsSdkClientFactoryTest.kt @@ -21,6 +21,7 @@ import java.nio.file.Path import kotlin.io.path.absolutePathString import kotlin.io.path.deleteIfExists import kotlin.io.path.writeText +import kotlin.test.Ignore import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertIs @@ -58,6 +59,8 @@ class AbstractAwsSdkClientFactoryTest { } } + // FIXME java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Map java.util.Collections$UnmodifiableMap.m accessible: module java.base does not "opens java.util" to unnamed module @7ee7980d + @Ignore @Test fun testFromEnvironmentResolvesAppId() = runTest( timeout = 20.seconds, diff --git a/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/config/profile/AwsConfigLoaderTest.kt b/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/profile/AwsConfigLoaderTest.kt similarity index 100% rename from aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/config/profile/AwsConfigLoaderTest.kt rename to aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/profile/AwsConfigLoaderTest.kt diff --git a/aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/config/profile/AwsConfigParserTest.kt b/aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/profile/AwsConfigParserTest.kt similarity index 100% rename from aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/config/profile/AwsConfigParserTest.kt rename to aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/profile/AwsConfigParserTest.kt diff --git a/aws-runtime/aws-config/native/src/aws/sdk/kotlin/runtime/auth/credentials/executeCommandNative.kt b/aws-runtime/aws-config/native/src/aws/sdk/kotlin/runtime/auth/credentials/executeCommandNative.kt new file mode 100644 index 00000000000..065cbf8949d --- /dev/null +++ b/aws-runtime/aws-config/native/src/aws/sdk/kotlin/runtime/auth/credentials/executeCommandNative.kt @@ -0,0 +1,18 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +package aws.sdk.kotlin.runtime.auth.credentials + +import aws.smithy.kotlin.runtime.time.Clock +import aws.smithy.kotlin.runtime.util.PlatformProvider + +internal actual suspend fun executeCommand( + command: String, + platformProvider: PlatformProvider, + maxOutputLengthBytes: Long, + timeoutMillis: Long, + clock: Clock, +): Pair { + TODO("Not yet implemented") +} diff --git a/aws-runtime/aws-config/native/src/aws/sdk/kotlin/runtime/region/DefaultRegionProviderChainNative.kt b/aws-runtime/aws-config/native/src/aws/sdk/kotlin/runtime/region/DefaultRegionProviderChainNative.kt new file mode 100644 index 00000000000..699ce5304b5 --- /dev/null +++ b/aws-runtime/aws-config/native/src/aws/sdk/kotlin/runtime/region/DefaultRegionProviderChainNative.kt @@ -0,0 +1,26 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package aws.sdk.kotlin.runtime.region + +import aws.sdk.kotlin.runtime.config.imds.InstanceMetadataProvider +import aws.sdk.kotlin.runtime.config.profile.AwsProfile +import aws.smithy.kotlin.runtime.io.Closeable +import aws.smithy.kotlin.runtime.util.LazyAsyncValue +import aws.smithy.kotlin.runtime.util.PlatformProvider + +internal actual class DefaultRegionProviderChain actual constructor( + platformProvider: PlatformProvider, + imdsClient: Lazy, + profile: LazyAsyncValue, +) : RegionProvider, Closeable { + override suspend fun getRegion(): String? { + TODO("Not yet implemented") + } + + override fun close() { + TODO("Not yet implemented") + } +} diff --git a/aws-runtime/aws-http/native/src/aws/sdk/kotlin/runtime/http/AwsUserAgentMetadataNative.kt b/aws-runtime/aws-http/native/src/aws/sdk/kotlin/runtime/http/AwsUserAgentMetadataNative.kt new file mode 100644 index 00000000000..34e49a26afd --- /dev/null +++ b/aws-runtime/aws-http/native/src/aws/sdk/kotlin/runtime/http/AwsUserAgentMetadataNative.kt @@ -0,0 +1,8 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package aws.sdk.kotlin.runtime.http + +internal actual fun platformLanguageMetadata() = LanguageMetadata() diff --git a/build.gradle.kts b/build.gradle.kts index 65766de66a9..53fbe6ecb4d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,7 +14,7 @@ buildscript { classpath(libs.kotlinx.atomicfu.plugin) classpath("aws.sdk.kotlin:build-plugins") { version { - require("0.2.2") + require("0.2.7") } } } @@ -115,7 +115,9 @@ project.afterEvaluate { // This is especially important for inter-repo linking (e.g., via externalDocumentationLink) because the // package-list doesn't contain enough project path information to indicate where modules' documentation are // located. - fileLayout.set { parent, child -> parent.outputDirectory.get().resolve(child.project.name) } + fileLayout.set { parent, child -> + parent.outputDirectory.dir(child.moduleName) + } includes.from( // NOTE: these get concatenated diff --git a/builder.json b/builder.json index 3e77b666dca..338bfbd724b 100644 --- a/builder.json +++ b/builder.json @@ -19,7 +19,7 @@ "!test_steps": [ "{gradlew} publishToMavenLocal", "{gradlew} apiCheck", - "{gradlew} test allTests", + "{gradlew} test jvmTest", "systeminfo", "{gradlew} --status", "{gradlew} --stop", @@ -40,7 +40,7 @@ ], "test_steps": [ "{gradlew} apiCheck", - "{gradlew} test allTests", + "{gradlew} test jvmTest", "{gradlew} testAllProtocols" ], "upstream": [ @@ -55,7 +55,7 @@ "codebuild-svc-check": { "!imports": [], "!test_steps": [ - "{gradlew} test allTests" + "{gradlew} test jvmTest" ] } } diff --git a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/EndpointUrlConfigNamesTest.kt b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/EndpointUrlConfigNamesTest.kt index b47dda5934e..451635cfdb2 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/EndpointUrlConfigNamesTest.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/EndpointUrlConfigNamesTest.kt @@ -1742,7 +1742,7 @@ private const val javaClientNamesJson = """ "ServerlessApplicationRepository": "ServerlessApplicationRepositoryClient", "CodeStar connections": "CodeStarConnectionsClient", "Pinpoint SMS Voice V2": "PinpointSmsVoiceV2Client", - "IoTSiteWise": "IoTSiteWiseClient", + "IoTSiteWise": "IotSiteWiseClient", "ivs": "IvsClient", "InternetMonitor": "InternetMonitorClient", "mq": "MqClient", @@ -1897,8 +1897,8 @@ private const val javaClientNamesJson = """ "AccessAnalyzer": "AccessAnalyzerClient", "Route53 Recovery Readiness": "Route53RecoveryReadinessClient", "ComprehendMedical": "ComprehendMedicalClient", - "IoTThingsGraph": "IoTThingsGraphClient", - "IoTFleetWise": "IoTFleetWiseClient", + "IoTThingsGraph": "IotThingsGraphClient", + "IoTFleetWise": "IotFleetWiseClient", "RUM": "RumClient", "OpenSearch": "OpenSearchClient", "EC2 Instance Connect": "Ec2InstanceConnectClient", @@ -1906,7 +1906,7 @@ private const val javaClientNamesJson = """ "CloudFront": "CloudFrontClient", "WAFV2": "Wafv2Client", "Cost Explorer": "CostExplorerClient", - "IoTSecureTunneling": "IoTSecureTunnelingClient", + "IoTSecureTunneling": "IotSecureTunnelingClient", "Kinesis Analytics V2": "KinesisAnalyticsV2Client", "CodeCatalyst": "CodeCatalystClient", "RDS Data": "RdsDataClient", @@ -1935,7 +1935,7 @@ private const val javaClientNamesJson = """ "Config Service": "ConfigClient", "GroundStation": "GroundStationClient", "Inspector2": "Inspector2Client", - "IoTAnalytics": "IoTAnalyticsClient", + "IoTAnalytics": "IotAnalyticsClient", "SageMaker A2I Runtime": "SageMakerA2IRuntimeClient", "neptunedata": "NeptunedataClient", "Pinpoint Email": "PinpointEmailClient", @@ -1950,7 +1950,7 @@ private const val javaClientNamesJson = """ "WorkDocs": "WorkDocsClient", "NetworkManager": "NetworkManagerClient", "Omics": "OmicsClient", - "IoTFleetHub": "IoTFleetHubClient", + "IoTFleetHub": "IotFleetHubClient", "Cognito Sync": "CognitoSyncClient", "Outposts": "OutpostsClient", "BackupStorage": "BackupStorageClient", @@ -1999,7 +1999,7 @@ private const val javaClientNamesJson = """ "Timestream Write": "TimestreamWriteClient", "CodeBuild": "CodeBuildClient", "DocDB Elastic": "DocDbElasticClient", - "IoTTwinMaker": "IoTTwinMakerClient", + "IoTTwinMaker": "IotTwinMakerClient", "IotDeviceAdvisor": "IotDeviceAdvisorClient", "License Manager Linux Subscriptions": "LicenseManagerLinuxSubscriptionsClient", "forecast": "ForecastClient", diff --git a/docs/dokka-presets/css/aws-styles.css b/docs/dokka-presets/css/aws-styles.css index 45fabb7820d..2694fb8a090 100644 --- a/docs/dokka-presets/css/aws-styles.css +++ b/docs/dokka-presets/css/aws-styles.css @@ -3,15 +3,19 @@ * SPDX-License-Identifier: Apache-2.0 */ - :root { - --color-dark: #232f3e; + --aws-color-dark: #232f3e; + --horizontal-spacing-for-content: 16px; + --default-font-family: JetBrains Sans, Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI,Roboto, Oxygen, Ubuntu,Cantarell, Droid Sans, Helvetica Neue, Arial, sans-serif; } -#leftToggler { +.menu-toggle { background: none; - border: none; - padding: 0; +} + +.menu-toggle:focus { + outline: 2px solid #fff; /* White outline */ + outline-offset: 2px; /* Space between the outline and the button */ } #pages-search { @@ -26,3 +30,21 @@ #pages-search-label { display: none; } + +/* copied from Dokka except for background-color attribute */ +.navigation { + display: flex; + justify-content: space-between; + + color: #fff; + background-color: var(--aws-color-dark); + font-family: var(--default-font-family); + letter-spacing: -0.1px; + + /* Reset margin and use padding for border */ + margin-left: 0; + margin-right: 0; + padding: 10px var(--horizontal-spacing-for-content); + + z-index: 4; +} diff --git a/docs/dokka-presets/css/logo-styles.css b/docs/dokka-presets/css/logo-styles.css index 60d45fc1d48..e53d3a536c5 100644 --- a/docs/dokka-presets/css/logo-styles.css +++ b/docs/dokka-presets/css/logo-styles.css @@ -7,6 +7,12 @@ position: relative; --logo-width: 72px; margin-left: calc(var(--logo-width) + 5px); + display: flex; + align-items: center; + color: #fff; + font-weight: 700; + margin-top: 10px; + margin-right: 8px; } .library-name a::before { @@ -17,6 +23,17 @@ position: absolute; width: 59px; height: 35px; - top: -10px; left: calc(-1 * var(--logo-width) - 5px); + margin-right: 5px; +} + +/* Copied from Dokka except `top` replaced with `margin-top` attribute */ +.library-version { + position: relative; + margin-left: 3px; + color: rgba(255,255,255,.7); + font-size: 13px; + font-weight: normal; + line-height: 16px; + margin-top: 19px; } diff --git a/docs/dokka-presets/templates/base.ftl b/docs/dokka-presets/templates/base.ftl index 06c884c3ff2..68a5c651990 100644 --- a/docs/dokka-presets/templates/base.ftl +++ b/docs/dokka-presets/templates/base.ftl @@ -1,43 +1,45 @@ +<#-- This is an unchanged copy of Dokka's base.ftl --> <#import "includes/page_metadata.ftl" as page_metadata> <#import "includes/header.ftl" as header> <#import "includes/footer.ftl" as footer> - + <@page_metadata.display/> - <@template_cmd name="pathToRoot"> - - + <@template_cmd name="pathToRoot"> + <#-- This script doesn't need to be there but it is nice to have since app in dark mode doesn't 'blink' (class is added before it is rendered) --> <#-- Resources (scripts, stylesheets) are handled by Dokka. Use customStyleSheets and customAssets to change them. --> <@resources/> +
<@header.display/> -
-
-
-
-
- <@content/> - <@footer.display/> +
+ +
+ <@content/> + <@footer.display/> +
- + \ No newline at end of file diff --git a/docs/dokka-presets/templates/includes/footer.ftl b/docs/dokka-presets/templates/includes/footer.ftl index ea3df92ec4e..157f0b95428 100644 --- a/docs/dokka-presets/templates/includes/footer.ftl +++ b/docs/dokka-presets/templates/includes/footer.ftl @@ -1,7 +1,8 @@ +<#-- This is an unchanged copy of Dokka's footer.ftl --> <#macro display> - + \ No newline at end of file diff --git a/docs/dokka-presets/templates/includes/header.ftl b/docs/dokka-presets/templates/includes/header.ftl index 6ec0f8b26b2..4c620f1b0ba 100644 --- a/docs/dokka-presets/templates/includes/header.ftl +++ b/docs/dokka-presets/templates/includes/header.ftl @@ -1,25 +1,30 @@ +<#-- This is a modified copy of Dokka's header.ftl, adding a label to the search icon to allow focusing on it. --> <#import "source_set_selector.ftl" as source_set_selector> <#macro display> - - + + \ No newline at end of file diff --git a/docs/dokka-presets/templates/includes/page_metadata.ftl b/docs/dokka-presets/templates/includes/page_metadata.ftl index 7cab45828b6..fbfed49067c 100644 --- a/docs/dokka-presets/templates/includes/page_metadata.ftl +++ b/docs/dokka-presets/templates/includes/page_metadata.ftl @@ -1,3 +1,4 @@ +<#-- This is an unchanged copy of Dokka's page_metadata.ftl --> <#macro display> ${pageName} <@template_cmd name="pathToRoot"> diff --git a/docs/dokka-presets/templates/includes/source_set_selector.ftl b/docs/dokka-presets/templates/includes/source_set_selector.ftl index 2d848071f30..1e7ed967a81 100644 --- a/docs/dokka-presets/templates/includes/source_set_selector.ftl +++ b/docs/dokka-presets/templates/includes/source_set_selector.ftl @@ -1,3 +1,4 @@ +<#-- This is an unchanged copy of Dokka's source_set_selector.ftl --> <#macro display> <#if sourceSets?has_content>
@@ -6,4 +7,4 @@
- + \ No newline at end of file diff --git a/dokka-aws/src/main/kotlin/aws/sdk/kotlin/dokka/AwsDokkaPlugin.kt b/dokka-aws/src/main/kotlin/aws/sdk/kotlin/dokka/AwsDokkaPlugin.kt index b80787bd090..33bf11f403b 100644 --- a/dokka-aws/src/main/kotlin/aws/sdk/kotlin/dokka/AwsDokkaPlugin.kt +++ b/dokka-aws/src/main/kotlin/aws/sdk/kotlin/dokka/AwsDokkaPlugin.kt @@ -8,6 +8,8 @@ package aws.sdk.kotlin.dokka import aws.sdk.kotlin.dokka.transformers.FilterInternalApis import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.plugability.DokkaPlugin +import org.jetbrains.dokka.plugability.DokkaPluginApiPreview +import org.jetbrains.dokka.plugability.PluginApiPreviewAcknowledgement /** * Dokka plugin for customizing the AWS Kotlin SDK generated API docs @@ -22,4 +24,7 @@ class AwsDokkaPlugin : DokkaPlugin() { val filterInternalApis by extending { dokkaBase.preMergeDocumentableTransformer providing ::FilterInternalApis } + + @DokkaPluginApiPreview + override fun pluginApiPreviewAcknowledgement() = PluginApiPreviewAcknowledgement } diff --git a/examples/build.gradle.kts b/examples/build.gradle.kts index 00327bb2c87..a922097bc2b 100644 --- a/examples/build.gradle.kts +++ b/examples/build.gradle.kts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ plugins { - kotlin("jvm") version "1.8.22" + kotlin("jvm") version "1.9.10" } val awsSdkKotlinVersion: String by project diff --git a/gradle.properties b/gradle.properties index d55a0d7e4bd..12c59a1f606 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,10 @@ org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=2G sdkVersion=0.32.6-SNAPSHOT # kotlin -kotlinVersion=1.8.22 +kotlinVersion=1.9.10 # dokka config (values specified at build-time as needed) -smithyKotlinDocBaseUrl=https://sdk.amazonaws.com/kotlin/api/smithy-kotlin/api/$smithyKotlinVersion/ \ No newline at end of file +smithyKotlinDocBaseUrl=https://sdk.amazonaws.com/kotlin/api/smithy-kotlin/api/$smithyKotlinVersion/ + +# atomicfu +kotlinx.atomicfu.enableJvmIrTransformation=true \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 19dfa80b129..c05ca2e1c96 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,13 +1,13 @@ [versions] -kotlin-version = "1.8.22" -dokka-version = "1.7.10" +kotlin-version = "1.9.10" +dokka-version = "1.9.0" # libs coroutines-version = "1.7.3" -atomicfu-version = "0.19.0" +atomicfu-version = "0.22.0" # smithy-kotlin codegen and runtime are versioned together -smithy-kotlin-version = "0.27.8-SNAPSHOT" +smithy-kotlin-version = "0.28.0-SNAPSHOT" # codegen smithy-version = "1.39.0" @@ -15,9 +15,9 @@ smithy-gradle-version = "0.6.0" # testing junit-version = "5.9.2" -kotest-version = "5.5.4" -kotlinx-benchmark-version = "0.4.7" -kotlinx-serialization-version = "1.4.1" +kotest-version = "5.7.2" +kotlinx-benchmark-version = "0.4.9" +kotlinx-serialization-version = "1.6.0" mockk-version = "1.13.3" slf4j-version = "2.0.6" @@ -125,6 +125,6 @@ dokka = { id = "org.jetbrains.dokka", version.ref = "dokka-version"} kotlin-jvm = {id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin-version" } kotlin-multiplatform = {id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin-version" } kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "kotlinx-benchmark-version" } -kotlinx-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.12.1" } +kotlinx-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.13.2" } kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin-version"} smithy-gradle = { id = "software.amazon.smithy", version.ref = "smithy-gradle-version" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa991fceae6..068cdb2dc26 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/services/polly/common/test/aws/sdk/kotlin/services/polly/PollyTest.kt b/services/polly/common/test/aws/sdk/kotlin/services/polly/PollyTest.kt index 91250b24f4e..d0b7b35dcfb 100644 --- a/services/polly/common/test/aws/sdk/kotlin/services/polly/PollyTest.kt +++ b/services/polly/common/test/aws/sdk/kotlin/services/polly/PollyTest.kt @@ -30,23 +30,27 @@ class PollyPresignerTest { text = "hello world" } - val presignedRequest = PollyClient { + val pollyClient = PollyClient { region = "us-east-2" credentialsProvider = StaticCredentialsProvider { accessKeyId = "AKID" secretAccessKey = "secret" } httpClient = NoHttpEngine - }.use { polly -> - polly.presignSynthesizeSpeech(request, 10.seconds) } - assertEquals(HttpMethod.GET, presignedRequest.method) - assertTrue("Host".equals(presignedRequest.headers.entries().single().key, ignoreCase = true)) - assertEquals("polly.us-east-2.amazonaws.com", presignedRequest.headers["Host"]) - assertEquals("/v1/speech", presignedRequest.url.path) - val expectedQueryParameters = setOf("OutputFormat", "Text", "VoiceId", "X-Amz-Algorithm", "X-Amz-Credential", "X-Amz-Date", "X-Amz-SignedHeaders", "X-Amz-Expires", "X-Amz-Signature") - assertEquals(expectedQueryParameters, presignedRequest.url.parameters.entries().map { it.key }.toSet()) + try { + val presignedRequest = pollyClient.presignSynthesizeSpeech(request, 10.seconds) + + assertEquals(HttpMethod.GET, presignedRequest.method) + assertTrue("Host".equals(presignedRequest.headers.entries().single().key, ignoreCase = true)) + assertEquals("polly.us-east-2.amazonaws.com", presignedRequest.headers["Host"]) + assertEquals("/v1/speech", presignedRequest.url.path) + val expectedQueryParameters = setOf("OutputFormat", "Text", "VoiceId", "X-Amz-Algorithm", "X-Amz-Credential", "X-Amz-Date", "X-Amz-SignedHeaders", "X-Amz-Expires", "X-Amz-Signature") + assertEquals(expectedQueryParameters, presignedRequest.url.parameters.entries().map { it.key }.toSet()) + } finally { + pollyClient.close() + } } } diff --git a/services/route53/common/test/aws/sdk/kotlin/services/route53/internal/ChangeResourceRecordSetsUnmarshallingTest.kt b/services/route53/common/test/aws/sdk/kotlin/services/route53/internal/ChangeResourceRecordSetsUnmarshallingTest.kt index f2f8c38567b..b6bd664a3d3 100644 --- a/services/route53/common/test/aws/sdk/kotlin/services/route53/internal/ChangeResourceRecordSetsUnmarshallingTest.kt +++ b/services/route53/common/test/aws/sdk/kotlin/services/route53/internal/ChangeResourceRecordSetsUnmarshallingTest.kt @@ -15,9 +15,9 @@ import aws.smithy.kotlin.runtime.http.request.HttpRequestBuilder import aws.smithy.kotlin.runtime.http.response.HttpResponse import aws.smithy.kotlin.runtime.operation.ExecutionContext import kotlinx.coroutines.runBlocking -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.assertThrows +import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertFailsWith class ChangeResourceRecordSetsUnmarshallingTest { @Test @@ -40,7 +40,7 @@ class ChangeResourceRecordSetsUnmarshallingTest { val call = HttpCall(HttpRequestBuilder().build(), response) - val exception = assertThrows { + val exception = assertFailsWith { runBlocking { ChangeResourceRecordSetsOperationDeserializer().deserialize(ExecutionContext(), call) } @@ -69,7 +69,7 @@ class ChangeResourceRecordSetsUnmarshallingTest { val call = HttpCall(HttpRequestBuilder().build(), response) - val exception = assertThrows { + val exception = assertFailsWith { runBlocking { ChangeResourceRecordSetsOperationDeserializer().deserialize(ExecutionContext(), call) } @@ -99,7 +99,7 @@ class ChangeResourceRecordSetsUnmarshallingTest { val call = HttpCall(HttpRequestBuilder().build(), response) - val exception = assertThrows { + val exception = assertFailsWith { runBlocking { ChangeResourceRecordSetsOperationDeserializer().deserialize(ExecutionContext(), call) } @@ -130,7 +130,7 @@ class ChangeResourceRecordSetsUnmarshallingTest { val call = HttpCall(HttpRequestBuilder().build(), response) - val exception = assertThrows { + val exception = assertFailsWith { runBlocking { ChangeResourceRecordSetsOperationDeserializer().deserialize(ExecutionContext(), call) } diff --git a/services/s3/common/test/aws/sdk/kotlin/services/s3/CreateClientTest.kt b/services/s3/common/test/aws/sdk/kotlin/services/s3/CreateClientTest.kt index cba6cd92563..224a79de54c 100644 --- a/services/s3/common/test/aws/sdk/kotlin/services/s3/CreateClientTest.kt +++ b/services/s3/common/test/aws/sdk/kotlin/services/s3/CreateClientTest.kt @@ -5,6 +5,7 @@ package aws.sdk.kotlin.services.s3 +import aws.smithy.kotlin.runtime.io.use import kotlinx.coroutines.test.runTest import kotlin.test.Test diff --git a/services/s3/common/test/aws/sdk/kotlin/services/s3/internal/GetBucketLocationOperationDeserializerTest.kt b/services/s3/common/test/aws/sdk/kotlin/services/s3/internal/GetBucketLocationOperationDeserializerTest.kt index f7f44ed4f32..2d8cff75d01 100644 --- a/services/s3/common/test/aws/sdk/kotlin/services/s3/internal/GetBucketLocationOperationDeserializerTest.kt +++ b/services/s3/common/test/aws/sdk/kotlin/services/s3/internal/GetBucketLocationOperationDeserializerTest.kt @@ -17,9 +17,9 @@ import aws.smithy.kotlin.runtime.http.response.HttpResponse import aws.smithy.kotlin.runtime.operation.ExecutionContext import aws.smithy.kotlin.runtime.time.Instant import kotlinx.coroutines.runBlocking -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.assertThrows +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertFailsWith class GetBucketLocationOperationDeserializerTest { @Test @@ -61,7 +61,7 @@ class GetBucketLocationOperationDeserializerTest { ) val call = HttpCall(HttpRequestBuilder().build(), response, Instant.now(), Instant.now()) - val exception = assertThrows { + val exception = assertFailsWith { runBlocking { GetBucketLocationOperationDeserializer().deserialize(ExecutionContext(), call) } diff --git a/services/s3/common/test/aws/sdk/kotlin/services/s3/presigners/PresignersTest.kt b/services/s3/common/test/aws/sdk/kotlin/services/s3/presigners/PresignersTest.kt index b63f714f393..ea649c95813 100644 --- a/services/s3/common/test/aws/sdk/kotlin/services/s3/presigners/PresignersTest.kt +++ b/services/s3/common/test/aws/sdk/kotlin/services/s3/presigners/PresignersTest.kt @@ -13,6 +13,7 @@ import aws.smithy.kotlin.runtime.http.HttpCall import aws.smithy.kotlin.runtime.http.engine.HttpClientEngineBase import aws.smithy.kotlin.runtime.http.engine.HttpClientEngineConfig import aws.smithy.kotlin.runtime.http.request.HttpRequest +import aws.smithy.kotlin.runtime.io.use import aws.smithy.kotlin.runtime.operation.ExecutionContext import aws.smithy.kotlin.runtime.util.text.urlDecodeComponent import kotlinx.coroutines.test.runTest diff --git a/tests/benchmarks/service-benchmarks/build.gradle.kts b/tests/benchmarks/service-benchmarks/build.gradle.kts index d5628f61d22..98d956d2541 100644 --- a/tests/benchmarks/service-benchmarks/build.gradle.kts +++ b/tests/benchmarks/service-benchmarks/build.gradle.kts @@ -40,7 +40,7 @@ if (missingServices.isEmpty()) { optinAnnotations.forEach { languageSettings.optIn(it) } } - commonMain { + jvmMain { dependencies { api(libs.smithy.kotlin.runtime.core) implementation(project(":aws-runtime:aws-core")) diff --git a/tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/BenchmarkHarness.kt b/tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/BenchmarkHarness.kt similarity index 100% rename from tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/BenchmarkHarness.kt rename to tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/BenchmarkHarness.kt diff --git a/tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/Common.kt b/tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/Common.kt similarity index 100% rename from tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/Common.kt rename to tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/Common.kt diff --git a/tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/ResultsTable.kt b/tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/ResultsTable.kt similarity index 100% rename from tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/ResultsTable.kt rename to tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/ResultsTable.kt diff --git a/tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/definitions/CloudwatchBenchmark.kt b/tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/definitions/CloudwatchBenchmark.kt similarity index 100% rename from tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/definitions/CloudwatchBenchmark.kt rename to tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/definitions/CloudwatchBenchmark.kt diff --git a/tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/definitions/CloudwatchEventsBenchmark.kt b/tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/definitions/CloudwatchEventsBenchmark.kt similarity index 100% rename from tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/definitions/CloudwatchEventsBenchmark.kt rename to tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/definitions/CloudwatchEventsBenchmark.kt diff --git a/tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/definitions/DynamoDbBenchmark.kt b/tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/definitions/DynamoDbBenchmark.kt similarity index 100% rename from tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/definitions/DynamoDbBenchmark.kt rename to tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/definitions/DynamoDbBenchmark.kt diff --git a/tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/definitions/PinpointBenchmark.kt b/tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/definitions/PinpointBenchmark.kt similarity index 100% rename from tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/definitions/PinpointBenchmark.kt rename to tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/definitions/PinpointBenchmark.kt diff --git a/tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/definitions/S3Benchmark.kt b/tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/definitions/S3Benchmark.kt similarity index 100% rename from tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/definitions/S3Benchmark.kt rename to tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/definitions/S3Benchmark.kt diff --git a/tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/definitions/ServiceBenchmark.kt b/tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/definitions/ServiceBenchmark.kt similarity index 100% rename from tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/definitions/ServiceBenchmark.kt rename to tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/definitions/ServiceBenchmark.kt diff --git a/tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/definitions/SnsBenchmark.kt b/tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/definitions/SnsBenchmark.kt similarity index 100% rename from tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/definitions/SnsBenchmark.kt rename to tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/definitions/SnsBenchmark.kt diff --git a/tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/definitions/StsBenchmark.kt b/tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/definitions/StsBenchmark.kt similarity index 100% rename from tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/definitions/StsBenchmark.kt rename to tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/definitions/StsBenchmark.kt diff --git a/tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/telemetry/BenchmarkTelemetryProvider.kt b/tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/telemetry/BenchmarkTelemetryProvider.kt similarity index 100% rename from tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/telemetry/BenchmarkTelemetryProvider.kt rename to tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/telemetry/BenchmarkTelemetryProvider.kt diff --git a/tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/telemetry/ConcurrentListBuilder.kt b/tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/telemetry/ConcurrentListBuilder.kt similarity index 100% rename from tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/telemetry/ConcurrentListBuilder.kt rename to tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/telemetry/ConcurrentListBuilder.kt diff --git a/tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/telemetry/MetricAggregator.kt b/tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/telemetry/MetricAggregator.kt similarity index 100% rename from tests/benchmarks/service-benchmarks/common/src/aws/sdk/kotlin/benchmarks/service/telemetry/MetricAggregator.kt rename to tests/benchmarks/service-benchmarks/jvm/src/aws/sdk/kotlin/benchmarks/service/telemetry/MetricAggregator.kt diff --git a/tests/benchmarks/service-benchmarks/common/test/aws/sdk/kotlin/benchmarks/service/telemetry/ConcurrentListBuilderTest.kt b/tests/benchmarks/service-benchmarks/jvm/test/aws/sdk/kotlin/benchmarks/service/telemetry/ConcurrentListBuilderTest.kt similarity index 100% rename from tests/benchmarks/service-benchmarks/common/test/aws/sdk/kotlin/benchmarks/service/telemetry/ConcurrentListBuilderTest.kt rename to tests/benchmarks/service-benchmarks/jvm/test/aws/sdk/kotlin/benchmarks/service/telemetry/ConcurrentListBuilderTest.kt diff --git a/tests/benchmarks/service-benchmarks/common/test/aws/sdk/kotlin/benchmarks/service/telemetry/MetricAggregatorTest.kt b/tests/benchmarks/service-benchmarks/jvm/test/aws/sdk/kotlin/benchmarks/service/telemetry/MetricAggregatorTest.kt similarity index 98% rename from tests/benchmarks/service-benchmarks/common/test/aws/sdk/kotlin/benchmarks/service/telemetry/MetricAggregatorTest.kt rename to tests/benchmarks/service-benchmarks/jvm/test/aws/sdk/kotlin/benchmarks/service/telemetry/MetricAggregatorTest.kt index 4adb0b572d1..a3ade5656a1 100644 --- a/tests/benchmarks/service-benchmarks/common/test/aws/sdk/kotlin/benchmarks/service/telemetry/MetricAggregatorTest.kt +++ b/tests/benchmarks/service-benchmarks/jvm/test/aws/sdk/kotlin/benchmarks/service/telemetry/MetricAggregatorTest.kt @@ -4,8 +4,8 @@ */ package aws.sdk.kotlin.benchmarks.service.telemetry -import org.junit.jupiter.api.Test import kotlin.math.max +import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull diff --git a/tests/integration-tests/ecs-credentials/app/build.gradle.kts b/tests/integration-tests/ecs-credentials/app/build.gradle.kts index aa52181151f..f32ea601d9c 100644 --- a/tests/integration-tests/ecs-credentials/app/build.gradle.kts +++ b/tests/integration-tests/ecs-credentials/app/build.gradle.kts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ plugins { - kotlin("jvm") version "1.8.22" + kotlin("jvm") version "1.9.10" application id("com.github.johnrengelman.shadow") version "7.0.0" }