Skip to content

Commit 1153ec5

Browse files
committed
misc: merge from main
2 parents d165547 + 8302989 commit 1153ec5

39 files changed

+10667
-1123
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ local.properties
1616
# ignore generated files
1717
services/*/generated-src
1818
services/*/build.gradle.kts
19+
services/*/API.md
1920
.kotest/
2021
.kotlin/
2122
*.klib

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
11
# Changelog
22

3+
## [1.4.42] - 03/17/2025
4+
5+
### Features
6+
* (**applicationsignals**) This release adds support for adding, removing, and listing SLO time exclusion windows with the BatchUpdateExclusionWindows and ListServiceLevelObjectiveExclusionWindows APIs.
7+
* (**geomaps**) Provide support for vector map styles in the GetStaticMap operation.
8+
* (**rum**) CloudWatch RUM now supports unminification of JS error stack traces.
9+
* (**taxsettings**) Adjust Vietnam PaymentVoucherNumber regex and minor API change.
10+
* (**wafv2**) AWS WAF now lets you inspect fragments of request URIs. You can specify the scope of the URI to inspect and narrow the set of URI fragments.
11+
12+
## [1.4.41] - 03/14/2025
13+
14+
### Features
15+
* (**glue**) This release added AllowFullTableExternalDataAccess to glue catalog resource.
16+
* (**lakeformation**) This release added "condition" to LakeFormation OptIn APIs, also added WithPrivilegedAccess flag to RegisterResource and DescribeResource.
17+
18+
### Documentation
19+
* (**cognitoidentity**) Updated API model build artifacts for identity pools
20+
* (**cognitoidentityprovider**) Minor description updates to API parameters
21+
22+
## [1.4.40] - 03/13/2025
23+
24+
### Features
25+
* (**acmpca**) Private Certificate Authority service now supports P521 and RSA3072 key algorithms.
26+
* (**amplify**) Introduced support for Skew Protection. Added enableSkewProtection field to createBranch and updateBranch API.
27+
* (**cloudwatchlogs**) Updated CreateLogAnomalyDetector to accept only kms key arn
28+
* (**codebuild**) AWS CodeBuild now supports webhook filtering by organization name
29+
* (**datazone**) This release adds support to update projects and environments
30+
* (**dynamodb**) Generate account endpoints for DynamoDB requests using ARN-sourced account ID when available
31+
* (**ec2**) This release changes the CreateLaunchTemplate, CreateLaunchTemplateVersion, ModifyLaunchTemplate CLI and SDKs such that if you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.
32+
* (**ivsrealtime**) IVS Real-Time now offers customers the ability to adjust the participant & composition recording segment duration
33+
* (**mediapackagev2**) This release adds the ResetChannelState and ResetOriginEndpointState operation to reset MediaPackage V2 channel and origin endpoint. This release also adds a new field, UrlEncodeChildManifest, for HLS/LL-HLS to allow URL-encoding child manifest query string based on the requirements of AWS SigV4.
34+
* (**s3control**) Updating GetDataAccess response for S3 Access Grants to include the matched Grantee for the requested prefix
35+
36+
## [1.4.39] - 03/11/2025
37+
38+
### Features
39+
* (**ec2**) This release adds the GroupLongName field to the response of the DescribeAvailabilityZones API.
40+
* (**ecr**) This release adds Amazon ECR to Amazon ECR pull through cache rules support.
41+
* (**inspector2**) Adding componentArn to network reachability details
42+
* (**medialive**) Add an enum option DISABLED for Output Locking Mode under Global Configuration.
43+
44+
### Documentation
45+
* (**ecs**) This is a documentation only update for Amazon ECS to address various tickets.
46+
347
## [1.4.38] - 03/10/2025
448

549
### Features

aws-runtime/aws-config/api/aws-config.api

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@ public final class aws/sdk/kotlin/runtime/config/endpoints/AccountIdEndpointMode
307307
public static fun values ()[Laws/sdk/kotlin/runtime/config/endpoints/AccountIdEndpointMode;
308308
}
309309

310+
public final class aws/sdk/kotlin/runtime/config/endpoints/AccountIdEndpointModeKt {
311+
public static final fun toBusinessMetric (Laws/sdk/kotlin/runtime/config/endpoints/AccountIdEndpointMode;)Laws/smithy/kotlin/runtime/businessmetrics/BusinessMetric;
312+
}
313+
310314
public final class aws/sdk/kotlin/runtime/config/endpoints/ResolversKt {
311315
public static final fun resolveAccountId (Laws/sdk/kotlin/runtime/config/endpoints/AccountIdEndpointMode;Laws/smithy/kotlin/runtime/collections/Attributes;)Ljava/lang/String;
312316
public static final fun resolveAccountIdEndpointMode (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/util/LazyAsyncValue;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/endpoints/AccountIdEndpointMode.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
*/
55
package aws.sdk.kotlin.runtime.config.endpoints
66

7+
import aws.smithy.kotlin.runtime.InternalApi
8+
import aws.smithy.kotlin.runtime.businessmetrics.BusinessMetric
9+
import aws.smithy.kotlin.runtime.businessmetrics.SmithyBusinessMetric
10+
711
/**
812
* Controls how the account ID endpoint parameter is bound for services that support routing
913
* endpoints based on it.
@@ -25,3 +29,11 @@ public enum class AccountIdEndpointMode {
2529
*/
2630
REQUIRED,
2731
}
32+
33+
@InternalApi
34+
public fun AccountIdEndpointMode.toBusinessMetric(): BusinessMetric = when (this) {
35+
AccountIdEndpointMode.PREFERRED -> SmithyBusinessMetric.ACCOUNT_ID_MODE_PREFERRED
36+
AccountIdEndpointMode.DISABLED -> SmithyBusinessMetric.ACCOUNT_ID_MODE_DISABLED
37+
AccountIdEndpointMode.REQUIRED -> SmithyBusinessMetric.ACCOUNT_ID_MODE_REQUIRED
38+
else -> throw IllegalStateException("Unexpected AccountIdEndpointMode value: ${this::class.simpleName}")
39+
}

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ allprojects {
6767

6868
tasks.withType<org.jetbrains.dokka.gradle.DokkaTaskPartial>().configureEach {
6969
// each module can include their own top-level module documentation
70-
// see https://kotlinlang.org/docs/kotlin-doc.html#module-and-package-documentation
70+
// see https://kotlinlang.org/docs/dokka-module-and-package-docs.html
7171
if (project.file("API.md").exists()) {
7272
dokkaSourceSets.configureEach {
7373
includes.from(project.file("API.md"))

codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/AwsRuntimeTypes.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ object AwsRuntimeTypes {
1919

2020
object Client : RuntimeTypePackage(AwsKotlinDependency.AWS_CORE, "client") {
2121
val AwsSdkClientConfig = symbol("AwsSdkClientConfig")
22+
val AwsClientOption = symbol("AwsClientOption")
2223
}
2324
}
2425

@@ -41,6 +42,7 @@ object AwsRuntimeTypes {
4142
val resolveEndpointUrl = symbol("resolveEndpointUrl")
4243
val resolveAccountId = symbol("resolveAccountId")
4344
val resolveAccountIdEndpointMode = symbol("resolveAccountIdEndpointMode")
45+
val toBusinessMetric = symbol("toBusinessMetric")
4446
}
4547

4648
object Profile : RuntimeTypePackage(AwsKotlinDependency.AWS_CONFIG, "config.profile") {
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
package aws.sdk.kotlin.codegen
2+
3+
import software.amazon.smithy.kotlin.codegen.KotlinSettings
4+
import software.amazon.smithy.kotlin.codegen.core.CodegenContext
5+
import software.amazon.smithy.kotlin.codegen.core.KotlinDelegator
6+
import software.amazon.smithy.kotlin.codegen.integration.KotlinIntegration
7+
import software.amazon.smithy.kotlin.codegen.model.expectShape
8+
import software.amazon.smithy.kotlin.codegen.model.getTrait
9+
import software.amazon.smithy.model.Model
10+
import software.amazon.smithy.model.shapes.ServiceShape
11+
import software.amazon.smithy.model.traits.TitleTrait
12+
import java.io.File
13+
14+
/**
15+
* Maps a service's SDK ID to its code examples
16+
*/
17+
private val CODE_EXAMPLES_SERVICES_MAP = mapOf(
18+
"API Gateway" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_api-gateway_code_examples.html",
19+
"Auto Scaling" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_auto-scaling_code_examples.html",
20+
"Bedrock" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_bedrock_code_examples.html",
21+
"CloudWatch" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_cloudwatch_code_examples.html",
22+
"Comprehend" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_comprehend_code_examples.html",
23+
"DynamoDB" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_dynamodb_code_examples.html",
24+
"EC2" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_ec2_code_examples.html",
25+
"ECR" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_ecr_code_examples.html",
26+
"OpenSearch" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_opensearch_code_examples.html",
27+
"EventBridge" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_eventbridge_code_examples.html",
28+
"Glue" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_glue_code_examples.html",
29+
"IAM" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_iam_code_examples.html",
30+
"IoT" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_iot_code_examples.html ",
31+
"Keyspaces" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_keyspaces_code_examples.html",
32+
"KMS" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_kms_code_examples.html",
33+
"Lambda" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_lambda_code_examples.html",
34+
"MediaConvert" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_mediaconvert_code_examples.html",
35+
"Pinpoint" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_pinpoint_code_examples.html",
36+
"RDS" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_rds_code_examples.html",
37+
"Redshift" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_redshift_code_examples.html",
38+
"Rekognition" to "https://docs.aws.amazon.com/code-library/latest/ug/kotlin_1_rekognition_code_examples.html",
39+
)
40+
41+
/**
42+
* Generates an `API.md` file that will be used as module documentation in our API ref docs.
43+
* Some services have code example documentation we need to generate. Others have handwritten documentation.
44+
* The integration renders both into the `API.md` file.
45+
*
46+
* See: https://kotlinlang.org/docs/dokka-module-and-package-docs.html
47+
*
48+
* See: https://github.com/awslabs/aws-sdk-kotlin/blob/0581f5c5eeaa14dcd8af4ea0dfc088b1057f5ba5/build.gradle.kts#L68-L75
49+
*/
50+
class ModuleDocumentationIntegration(
51+
private val codeExamples: Map<String, String> = CODE_EXAMPLES_SERVICES_MAP,
52+
) : KotlinIntegration {
53+
override fun enabledForService(model: Model, settings: KotlinSettings): Boolean =
54+
codeExamples.keys.contains(
55+
model
56+
.expectShape<ServiceShape>(settings.service)
57+
.sdkId,
58+
) ||
59+
handWrittenDocsFile(settings).exists()
60+
61+
override fun writeAdditionalFiles(ctx: CodegenContext, delegator: KotlinDelegator) {
62+
delegator.fileManifest.writeFile(
63+
"API.md",
64+
generateModuleDocumentation(ctx),
65+
)
66+
}
67+
68+
internal fun generateModuleDocumentation(
69+
ctx: CodegenContext,
70+
) = buildString {
71+
val handWrittenDocsFile = handWrittenDocsFile(ctx.settings)
72+
if (handWrittenDocsFile.exists()) {
73+
append(
74+
handWrittenDocsFile.readText(),
75+
)
76+
appendLine()
77+
}
78+
if (codeExamples.keys.contains(ctx.settings.sdkId)) {
79+
if (!handWrittenDocsFile.exists()) {
80+
append(
81+
boilerPlate(ctx),
82+
)
83+
}
84+
append(
85+
codeExamplesDocs(ctx),
86+
)
87+
}
88+
}
89+
90+
private fun boilerPlate(ctx: CodegenContext) = buildString {
91+
// Title must be "Module" followed by the exact module name or dokka won't render it
92+
appendLine("# Module ${ctx.settings.pkg.name.split(".").last()}")
93+
appendLine()
94+
ctx
95+
.model
96+
.expectShape<ServiceShape>(ctx.settings.service)
97+
.getTrait<TitleTrait>()
98+
?.value
99+
?.let {
100+
appendLine(it)
101+
appendLine()
102+
}
103+
}
104+
105+
private fun codeExamplesDocs(ctx: CodegenContext) = buildString {
106+
val sdkId = ctx.settings.sdkId
107+
val codeExampleLink = codeExamples[sdkId]
108+
val title = ctx
109+
.model
110+
.expectShape<ServiceShape>(ctx.settings.service)
111+
.getTrait<TitleTrait>()
112+
?.value
113+
114+
appendLine("## Code Examples")
115+
append("To see full code examples, see the ${title ?: sdkId} examples in the AWS code example library. ")
116+
appendLine("See $codeExampleLink")
117+
appendLine()
118+
}
119+
}
120+
121+
private fun handWrittenDocsFile(settings: KotlinSettings): File {
122+
val sdkRootDir = System.getProperty("user.dir")
123+
val serviceDir = "$sdkRootDir/services/${settings.pkg.name.split(".").last()}"
124+
125+
return File("$serviceDir/DOCS.md")
126+
}

codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/businessmetrics/EndpointBusinessMetricsIntegration.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ class EndpointBusinessMetricsIntegration : KotlinIntegration {
3838
RuntimeTypes.Core.BusinessMetrics.emitBusinessMetric,
3939
AwsRuntimeTypes.Http.Interceptors.BusinessMetrics.AwsBusinessMetric,
4040
)
41+
writer.write(
42+
"if (request.identity.attributes.contains(#T.AccountId)) request.context.#T(#T.RESOLVED_ACCOUNT_ID)",
43+
AwsRuntimeTypes.Core.Client.AwsClientOption,
44+
RuntimeTypes.Core.BusinessMetrics.emitBusinessMetric,
45+
RuntimeTypes.Core.BusinessMetrics.SmithyBusinessMetric,
46+
)
4147
writer.write("")
4248
}
4349
}

codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/customization/AccountIdEndpointBuiltinCustomization.kt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ import aws.sdk.kotlin.codegen.ServiceClientCompanionObjectWriter
99
import aws.sdk.kotlin.codegen.endpoints.AwsBuiltins
1010
import software.amazon.smithy.kotlin.codegen.KotlinSettings
1111
import software.amazon.smithy.kotlin.codegen.core.CodegenContext
12+
import software.amazon.smithy.kotlin.codegen.core.KotlinWriter
1213
import software.amazon.smithy.kotlin.codegen.integration.AppendingSectionWriter
1314
import software.amazon.smithy.kotlin.codegen.integration.KotlinIntegration
1415
import software.amazon.smithy.kotlin.codegen.integration.SectionWriterBinding
1516
import software.amazon.smithy.kotlin.codegen.model.expectShape
1617
import software.amazon.smithy.kotlin.codegen.model.getEndpointRules
18+
import software.amazon.smithy.kotlin.codegen.rendering.protocol.ProtocolGenerator
19+
import software.amazon.smithy.kotlin.codegen.rendering.protocol.ProtocolMiddleware
1720
import software.amazon.smithy.kotlin.codegen.rendering.util.ConfigProperty
1821
import software.amazon.smithy.kotlin.codegen.rendering.util.ConfigPropertyType
1922
import software.amazon.smithy.model.Model
23+
import software.amazon.smithy.model.shapes.OperationShape
2024
import software.amazon.smithy.model.shapes.ServiceShape
2125

2226
/**
@@ -59,4 +63,20 @@ class AccountIdEndpointBuiltinCustomization : KotlinIntegration {
5963

6064
override fun additionalServiceConfigProps(ctx: CodegenContext): List<ConfigProperty> =
6165
listOf(AccountIdEndpointModeProp)
66+
67+
override fun customizeMiddleware(
68+
ctx: ProtocolGenerator.GenerationContext,
69+
resolved: List<ProtocolMiddleware>,
70+
): List<ProtocolMiddleware> = resolved + listOf(emitAccountIdEndpointModeMiddleware)
71+
}
72+
73+
private val emitAccountIdEndpointModeMiddleware = object : ProtocolMiddleware {
74+
override val name: String = "EmitAccountIdEndpointModeMiddleware"
75+
76+
override fun render(ctx: ProtocolGenerator.GenerationContext, op: OperationShape, writer: KotlinWriter) {
77+
writer.write(
78+
"op.context.emitBusinessMetric(config.accountIdEndpointMode.#T())",
79+
AwsRuntimeTypes.Config.Endpoints.toBusinessMetric,
80+
)
81+
}
6282
}

codegen/aws-sdk-codegen/src/main/resources/META-INF/services/software.amazon.smithy.kotlin.codegen.integration.KotlinIntegration

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ aws.sdk.kotlin.codegen.smoketests.SmokeTestsDenyListIntegration
4848
aws.sdk.kotlin.codegen.smoketests.testing.SmokeTestSuccessHttpEngineIntegration
4949
aws.sdk.kotlin.codegen.smoketests.testing.SmokeTestFailHttpEngineIntegration
5050
aws.sdk.kotlin.codegen.customization.AwsQueryModeCustomization
51+
aws.sdk.kotlin.codegen.ModuleDocumentationIntegration

0 commit comments

Comments
 (0)