Skip to content

Commit

Permalink
Merge branch 'main' of github.com:awslabs/aws-sdk-kotlin into feat-gp…
Browse files Browse the repository at this point in the history
…-anno
  • Loading branch information
lauzadis committed Aug 21, 2024
2 parents 6343977 + d13b314 commit 751be6b
Show file tree
Hide file tree
Showing 68 changed files with 13,233 additions and 2,498 deletions.
155 changes: 155 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,160 @@
# Changelog

## [1.3.16] - 08/21/2024

### Features
* (**ec2**) DescribeInstanceStatus now returns health information on EBS volumes attached to Nitro instances
* (**entityresolution**) Increase the mapping attributes in Schema to 35.
* (**glue**) Add optional field JobRunQueuingEnabled to CreateJob and UpdateJob APIs.
* (**lambda**) Release FilterCriteria encryption for Lambda EventSourceMapping, enabling customers to encrypt their filter criteria using a customer-owned KMS key.
* (**securityhub**) Security Hub documentation and definition updates
* (**ses**) Enable email receiving customers to provide SES with access to their S3 buckets via an IAM role for "Deliver to S3 Action"

## [1.3.15] - 08/20/2024

### Features
* (**opensearchserverless**) Added FailureCode and FailureMessage to BatchGetCollectionResponse for BatchGetVPCEResponse for non-Active Collection and VPCE.
* (**s3**) Amazon Simple Storage Service / Features : Add support for conditional writes for PutObject and CompleteMultipartUpload APIs.

### Documentation
* (**ecs**) Documentation only release to address various tickets

## [1.3.14] - 08/19/2024

### Features
* (**bedrock**) Amazon Bedrock Batch Inference/ Model Invocation is a feature which allows customers to asynchronously run inference on a large set of records/files stored in S3.
* (**codebuild**) AWS CodeBuild now supports creating fleets with macOS platform for running builds.
* (**deadline**) This release adds additional search fields and provides sorting by multiple fields.
* (**lambda**) Release Lambda FunctionRecursiveConfig, enabling customers to turn recursive loop detection on or off on individual functions. This release adds two new APIs, GetFunctionRecursionConfig and PutFunctionRecursionConfig.
* (**ssmsap**) Add new attributes to the outputs of GetApplication and GetDatabase APIs.

### Fixes
* [#1326](https://github.com/awslabs/aws-sdk-kotlin/issues/1326) Correctly terminate pagination for CloudWatch Logs `GetLogEvents` operation

## [1.3.13] - 08/16/2024

### Features
* (**batch**) Improvements of integration between AWS Batch and EC2.
* (**inspector2**) Update the correct format of key and values for resource tags
* (**quicksight**) Amazon QuickSight launches Customer Managed Key (CMK) encryption for Data Source metadata
* (**sagemaker**) Introduce Endpoint and EndpointConfig Arns in sagemaker:ListPipelineExecutionSteps API response
* (**sesv2**) Marking use case description field of account details as deprecated.

## [1.3.12] - 08/15/2024

### Features
* (**docdb**) This release adds Global Cluster Failover capability which enables you to change your global cluster's primary AWS region, the region that serves writes, during a regional outage. Performing a failover action preserves your Global Cluster setup.
* (**ecs**) This release introduces a new ContainerDefinition configuration to support the customer-managed keys for ECS container restart feature.
* (**iam**) Make the LastUsedDate field in the GetAccessKeyLastUsed response optional. This may break customers who only call the API for access keys with a valid LastUsedDate. This fixes a deserialization issue for access keys without a LastUsedDate, because the field was marked as required but could be null.
* (**s3**) Amazon Simple Storage Service / Features : Adds support for pagination in the S3 ListBuckets API.

## [1.3.11] - 08/14/2024

### Features
* (**codebuild**) AWS CodeBuild now supports using Secrets Manager to store git credentials and using multiple source credentials in a single project.

### Fixes
* [#1368](https://github.com/awslabs/aws-sdk-kotlin/issues/1368) Correctly handle all empty HeadObject/HeadBucket responses

## [1.3.10] - 08/13/2024

### Features
* (**amplify**) Add a new field "cacheConfig" that enables users to configure the CDN cache settings for an App
* (**appstream**) This release includes following new APIs: CreateThemeForStack, DescribeThemeForStack, UpdateThemeForStack, DeleteThemeForStack to support custom branding programmatically.
* (**fis**) This release adds support for additional error information on experiment failure. It adds the error code, location, and account id on relevant failures to the GetExperiment and ListExperiment API responses.
* (**glue**) Add AttributesToGet parameter support for Glue GetTables
* (**neptunegraph**) Amazon Neptune Analytics provides a new option for customers to load data into a graph using the RDF (Resource Description Framework) NTRIPLES format. When loading NTRIPLES files, use the value `convertToIri` for the `blankNodeHandling` parameter.

### Fixes
* Stop using double slashes in `ImdsCredentialsProvider` URLs

## [1.3.9] - 08/12/2024

### Features
* (**configservice**) Documentation update for the OrganizationConfigRuleName regex pattern.
* (**ec2**) This release adds new capabilities to manage On-Demand Capacity Reservations including the ability to split your reservation, move capacity between reservations, and modify the instance eligibility of your reservation.
* (**eks**) Added support for new AL2023 GPU AMIs to the supported AMITypes.
* (**medialive**) AWS Elemental MediaLive now supports now supports editing the PID values for a Multiplex.
* (**sagemaker**) Releasing large data support as part of CreateAutoMLJobV2 in SageMaker Autopilot and CreateDomain API for SageMaker Canvas.

### Documentation
* (**computeoptimizer**) Doc only update for Compute Optimizer that fixes several customer-reported issues relating to ECS finding classifications
* (**groundstation**) Updating documentation for OEMEphemeris to link to AWS Ground Station User Guide

## [1.3.8] - 08/09/2024

### Features
* (**connect**) This release supports adding RoutingCriteria via UpdateContactRoutingData public API.

### Documentation
* (**cognitoidentityprovider**) Fixed a description of AdvancedSecurityAdditionalFlows in Amazon Cognito user pool configuration.
* (**ssm**) Systems Manager doc-only updates for August 2024.

## [1.3.7] - 08/08/2024

### Features
* (**cognitoidentityprovider**) Added support for threat protection for custom authentication in Amazon Cognito user pools.
* (**connect**) This release fixes a regression in number of access control tags that are allowed to be added to a security profile in Amazon Connect. You can now add up to four access control tags on a single security profile.
* (**ec2**) Launch of private IPv6 addressing for VPCs and Subnets. VPC IPAM supports the planning and monitoring of private IPv6 usage.
* (**glue**) This release adds support to retrieve the validation status when creating or updating Glue Data Catalog Views. Also added is support for BasicCatalogTarget partition keys.

## [1.3.6] - 08/07/2024

### Features
* (**appintegrations**) Updated CreateDataIntegration and CreateDataIntegrationAssociation API to support bulk data export from Amazon Connect Customer Profiles to the customer S3 bucket.
* (**glue**) Introducing AWS Glue Data Quality anomaly detection, a new functionality that uses ML-based solutions to detect data anomalies users have not explicitly defined rules for.

### Miscellaneous
* Upgrade to Kotlin 2.0.10

## [1.3.5] - 08/06/2024

### Features
* (**bedrockagentruntime**) Introduce model invocation output traces for orchestration traces, which contain the model's raw response and usage.
* (**cognitoidentityprovider**) Advanced security feature updates to include password history and log export for Cognito user pools.
* (**costoptimizationhub**) This release adds savings percentage support to the ListRecommendationSummaries API.
* (**workspaces**) Added support for BYOL_GRAPHICS_G4DN_WSP IngestionProcess

## [1.3.4] - 08/05/2024

### Features
* (**datazone**) This releases Data Product feature. Data Products allow grouping data assets into cohesive, self-contained units for ease of publishing for data producers, and ease of finding and accessing for data consumers.
* (**ecr**) Released two new APIs along with documentation updates. The GetAccountSetting API is used to view the current basic scan type version setting for your registry, while the PutAccountSetting API is used to update the basic scan type version for your registry.
* (**kinesisvideowebrtcstorage**) Add JoinStorageSessionAsViewer API

### Documentation
* (**pi**) Added a description for the Dimension db.sql.tokenized_id on the DimensionGroup data type page.

## [1.3.3] - 08/02/2024

### Features
* (**cloudwatch**) Add v2 smoke tests and smithy smokeTests trait for SDK testing.
* (**ecs**) Add v2 smoke tests and smithy smokeTests trait for SDK testing.
* (**glue**) Add v2 smoke tests and smithy smokeTests trait for SDK testing.
* (**ivs**) updates cloudtrail event source for SDKs
* (**ivschat**) updates cloudtrail event source for SDKs
* (**ivsrealtime**) updates cloudtrail event source for SDKs
* (**kinesis**) Add v2 smoke tests and smithy smokeTests trait for SDK testing.
* (**resiliencehub**) Customers are presented with the grouping recommendations and can determine if the recommendations are accurate and apply to their case. This feature simplifies onboarding by organizing resources into appropriate AppComponents.
* (**route53**) Add v2 smoke tests and smithy smokeTests trait for SDK testing.
* (**ssm**) Add v2 smoke tests and smithy smokeTests trait for SDK testing.
* (**wafregional**) Add v2 smoke tests and smithy smokeTests trait for SDK testing.

## [1.3.2] - 08/01/2024

### Features
* (**bedrock**) API and Documentation for Bedrock Model Copy feature. This feature lets you share and copy a custom model from one region to another or one account to another.
* (**controlcatalog**) AWS Control Tower provides two new public APIs controlcatalog:ListControls and controlcatalog:GetControl under controlcatalog service namespace, which enable customers to programmatically retrieve control metadata of available controls.
* (**iam**) Add v2 smoke tests and smithy smokeTests trait for SDK testing.
* (**rds**) This release adds support for specifying optional MinACU parameter in CreateDBShardGroup and ModifyDBShardGroup API. DBShardGroup response will contain MinACU if specified.
* (**sagemaker**) This release adds support for Amazon EMR Serverless applications in SageMaker Studio for running data processing jobs.
* (**ssmquicksetup**) This release adds API support for the QuickSetup feature of AWS Systems Manager

### Documentation
* (**controltower**) Updated Control Tower service documentation for controlcatalog control ARN support with existing Control Tower public APIs
* (**memorydb**) Doc only update for changes to deletion API.
* (**support**) Doc only updates to CaseDetails

## [1.3.1] - 07/30/2024

### Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public class ImdsCredentialsProvider(
}

val payload = try {
client.value.get("$CREDENTIALS_BASE_PATH/$profileName")
client.value.get("$CREDENTIALS_BASE_PATH$profileName")
} catch (ex: Exception) {
return useCachedCredentials(ex) ?: throw CredentialsProviderException("failed to load credentials", ex)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ class ImdsCredentialsProviderTest {
"IMDSv2",
)
assertEquals(expected1, actual1)

connection.assertRequests()
}

@Test
Expand Down Expand Up @@ -195,6 +197,8 @@ class ImdsCredentialsProviderTest {
"IMDSv2",
)
assertEquals(expected, actual)

connection.assertRequests()
}

@Test
Expand Down Expand Up @@ -225,6 +229,8 @@ class ImdsCredentialsProviderTest {
ex.message.shouldContain("failed to load instance profile")
assertIs<EC2MetadataError>(ex.cause)
ex.cause!!.message.shouldContain("Request forbidden")

connection.assertRequests()
}

@Test
Expand Down Expand Up @@ -272,6 +278,8 @@ class ImdsCredentialsProviderTest {
assertFailsWith<CredentialsProviderException> {
provider.resolve()
}.message.shouldContain("failed to load instance profile")

connection.assertRequests()
}

// SDK can send a request if expired credentials are available.
Expand Down Expand Up @@ -329,6 +337,8 @@ class ImdsCredentialsProviderTest {
)

assertEquals(expected, actual)

connection.assertRequests()
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* 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.KotlinSettings
import software.amazon.smithy.kotlin.codegen.integration.KotlinIntegration
import software.amazon.smithy.kotlin.codegen.model.traits.PaginationEndBehavior
import software.amazon.smithy.kotlin.codegen.model.traits.PaginationEndBehaviorTrait
import software.amazon.smithy.model.Model
import software.amazon.smithy.model.shapes.BooleanShape
import software.amazon.smithy.model.shapes.OperationShape
import software.amazon.smithy.model.shapes.StructureShape
import software.amazon.smithy.model.transform.ModelTransformer

private val TRUNCATION_MEMBER_IDS = mapOf(
"com.amazonaws.s3#ListParts" to "IsTruncated",
)

private val IDENTICAL_TOKEN_OPERATION_IDS = setOf(
"com.amazonaws.cloudwatchlogs#GetLogEvents", // https://github.com/awslabs/aws-sdk-kotlin/issues/1326
)

/**
* Applies [PaginationEndBehaviorTrait] to a manually-curated list of operations/members for which pagination terminates
* in a non-standard manner
*/
class PaginationEndBehaviorIntegration : KotlinIntegration {
override fun preprocessModel(model: Model, settings: KotlinSettings): Model = ModelTransformer
.create()
.mapShapes(model) { shape ->
val shapeId = shape.id.toString()
when {
shape !is OperationShape -> shape // Pagination behavior trait only applied to operations

shapeId in TRUNCATION_MEMBER_IDS -> {
val output = model.expectShape(shape.outputShape)
require(output is StructureShape) { "Operation output must be a structure shape" }
val memberName = TRUNCATION_MEMBER_IDS.getValue(shapeId)
val member = output.allMembers[memberName] ?: error("Cannot find $memberName in ${output.id}")
val target = model.expectShape(member.target)
check(target is BooleanShape) { "Truncation member must be a boolean shape" }

val behavior = PaginationEndBehavior.TruncationMember(memberName)
shape.toBuilder().addTrait(PaginationEndBehaviorTrait(behavior)).build()
}

shapeId in IDENTICAL_TOKEN_OPERATION_IDS ->
shape.toBuilder().addTrait(PaginationEndBehaviorTrait(PaginationEndBehavior.IdenticalToken)).build()

else -> shape
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ package aws.sdk.kotlin.codegen.customization.s3

import software.amazon.smithy.kotlin.codegen.KotlinSettings
import software.amazon.smithy.kotlin.codegen.aws.protocols.core.AwsHttpBindingProtocolGenerator
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.KotlinIntegration
import software.amazon.smithy.kotlin.codegen.integration.SectionWriter
import software.amazon.smithy.kotlin.codegen.integration.SectionWriterBinding
Expand Down Expand Up @@ -66,28 +63,27 @@ class S3OperationErrorHandler : KotlinIntegration {
writer.write("val wrappedResponse = call.response.#T(payload)", RuntimeTypes.AwsProtocolCore.withPayload)
.write("val wrappedCall = call.copy(response = wrappedResponse)")
.write("")
.write("val errorDetails = try {")
.indent()
.call {
// customize error matching to handle HeadObject/HeadBucket error responses which have no payload
writer.write("if (payload == null && call.response.status == #T.NotFound) {", RuntimeTypes.Http.StatusCode)
.indent()
.write("#T(code = #S)", s3ErrorDetails, "NotFound")
.dedent()
.write("} else {")
.indent()
.write("""checkNotNull(payload){ "unable to parse error from empty response" }""")
.write("#T(payload)", parseS3ErrorResponse)
.dedent()
.write("}")
}
.dedent()
.withBlock("} catch (ex: Exception) {", "}") {
withBlock("""throw #T("Failed to parse response as '${ctx.protocol.name}' error", ex).also {""", "}", exceptionBaseSymbol) {
write("#T(it, wrappedCall.response, null)", setS3ErrorMetadata)

writer.withInlineBlock("val errorDetails = try {", "} ") {
// customize error matching to handle HeadObject/HeadBucket error responses which have no payload
withInlineBlock("if (payload == null) {", "} ") {
withInlineBlock("if (call.response.status == #T.NotFound) {", "} ", RuntimeTypes.Http.StatusCode) {
write("#T(code = #S)", s3ErrorDetails, "NotFound")
}
withInlineBlock("else {", "}") {
write("#T(code = #L)", s3ErrorDetails, "call.response.status.toString()")
}
}
.write("")
withInlineBlock("else {", "}") {
write("#T(payload)", parseS3ErrorResponse)
}
}

writer.withBlock("catch (ex: Exception) {", "}") {
withBlock("throw #T(#S).also {", "}", exceptionBaseSymbol, "Failed to parse response as ${ctx.protocol.name} error") {
write("#T(it, wrappedCall.response, null)", setS3ErrorMetadata)
}
}

writer.withBlock("val ex = when(errorDetails.code) {", "}") {
op.errors.forEach { err ->
Expand All @@ -96,7 +92,7 @@ class S3OperationErrorHandler : KotlinIntegration {
name = "${errSymbol.name}Deserializer"
namespace = ctx.settings.pkg.serde
}
writer.write("#S -> #T().deserialize(context, wrappedCall, payload)", err.name, errDeserializerSymbol)
write("#S -> #T().deserialize(context, wrappedCall, payload)", err.name, errDeserializerSymbol)
}
write("else -> #T(errorDetails.message)", exceptionBaseSymbol)
}
Expand Down
Loading

0 comments on commit 751be6b

Please sign in to comment.