-
Notifications
You must be signed in to change notification settings - Fork 867
V4 Development Tracker #3362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is there any way to test those packages? Some preview nuget source? |
We'll publish the preview packages to NuGet (e.g. |
First preview packages have been released. Blog post for the release https://aws.amazon.com/blogs/developer/preview-1-of-aws-sdk-for-net-v4/ |
Are you able to provide a preview version of Trying to enable native AoT for a project that depends on the SSM package gives a bunch of warnings:
It's possible some of the above are also coming from internal libraries for transient dependencies that haven't been compiled against v4 yet either. The app is still blocked from 0 AoT warnings due to a dependency on another third-party library that hasn't published some fixes I made yet, but otherwise this SSM package is the final hurdle. |
@martincostello I don't have a timeline yet but we would like push out preview versions of all of our high level packages like |
FYI this is the error I get from an .NET 8 app running as a Lambda with the latest version of
|
@martincostello A preview version of |
Thanks @normj. I've tested the latest version of the packages with three of our applications collectively using the v4 packages listed below, and I've not encountered any issues:
I've also tried native AoT publishing with two of the three, and there were also no trim warnings. |
Awesome @martincostello! Thanks for the feedback. |
Would it make sense to drop 'netcoreapp3.1' target framework as well in V4? It is not supported by Microsoft. Anyone who uses it for whatever reason - would still be able to use netstandard2.0 version. |
@Dreamescaper When we choose to drop a target we look at is it supported by Microsoft and our customer usage of the target. For example .NET 6 goes out of support by Microsoft tomorrow but we know there are still a lot of users still using .NET 6 and that would pretty rough to force everybody to update to get access to the latest AWS changes. I can't give numbers but when we started the V4 effort last spring there was still a lot of .NET Core 3.1 usage. The usage is dropping pretty fast now but given the amount of required heads up time we have to give for dropping a platform it would delay V4. I suspect we will do a follow up 4.1 sometime in the near future that drops .NET Core 3.1. There are also some slight differences between the .NET Core 3.1 target and .NET Standard 2.0 target with dependencies and a few APIs that are only available in .NET Core 3.1 given it has access to more .NET APIs. |
Is there any rough timeline on a preview 2 or GA? Excited to use this and see the perf benefits. |
@SamuelCox We are currently on preview 4. I'm hesitant to put a timeframe because as a team that is involved with almost every AWS release you can imagine we get randomized quite a bit. The intention was for V4 to have a relatively short development cycle to get to GA avoid it getting delayed due to our team's nature of being pulled in so many directions. Given we are in re:Invent time and then moving into the holiday season here in the US I don't see us GAing in 2024. |
is there an ETA when this will be GA? |
Updated the main description for preview 13 and status of V4. |
Hello. Sorry if this isn't the right place to report, but i'm receiving a 414 response from AWS when trying to receive messages from a SQS queue using the 4.0.0-preview.13 version. I've added a log to the request message and saw that, on each iteration, the User-Agent header is growing. It appears that the SDK is appending the following string to the header:
After the first requet, the SDK duplicates the portion |
We did release an user-agent related change as part of preview 13 too. Please create a separate issue and we'll take a look (I'm interested in the trying to receive messages part - are you just calling the API in a loop or are you doing something else? Reproduction code will be needed for the investigation). |
Added an to the main description about some branch changes in preparation for V4 GA. |
Updated description for the GA announcement of V4. Thank you all for your support and feedback as developed V4. |
For anybody that noticed the AWSSDK.Extensions.Bedrock.MEAI package mistakenly got released without the preview suffix. Since it has a dependency on Microsoft.Extensions.AI.Abstractions which is still in preview then |
Just bumping this old comment as it doesn't have a v4 version yet: #3362 (comment) |
Does Aspire.Hosting.AWS also need updating to support v4? |
@martincostello planning on updating |
This may be a stupid question, but I can't see any information in the documentation about why this change was made and how to migrate existing code to accomodate:
I understand the change, but what does a |
@SamWilliamsGS There are cases where a value for a value type property is optional from a response. For example in CloudWatch Logs the Another problematic situation in V3 is there are some sets of APIs where you call the GET operation to get the object, do some mutation and then send the same instance in on an update cases. There were a class of bugs we had in V3 when we did that round trip and this value types that default to their default value like To add more context when the SDK generates a type for the service operations the type could be used for either or both request and responses. Even if it is only used in one direction there is no rule it won't change in the future and be used in both directions. So we debated about different behavior depending on request or response usage but that turned not to be possible. |
Hi, thank you for the great update. I'm not sure if this is the right thread for the question. But it would be great if the AWS.Cryptography.EncryptionSDK package will be updated to AWSSDK v4 too. |
Agreed. That library isn't own by our team but I'm reaching out to them to figure out how to get the library updated. |
I understand the reason for change for value type properties like bool properties but now if (response.CommonPrefixes != null)
foreach (var prefix in response.CommonPrefixes)
{
}
if (response.S3Objects != null)
foreach (var s3Object in response.S3Objects)
{
} So get ready to have NullReferenceException crashes with your app when you update to v4.x. Other value type properties are easier to handle: Size = s3Object.Size ?? 0;
DateModified = s3Object.LastModified ?? DateTime.MinValue; |
@catester It's mentioned in the announcement, but you can use the
|
Thanks, I read all but forgot that setting when running the app I think. Anyway it's not a big deal, I already added the null checks |
Just to confirm, lack of support for this is blocking one of my projects from upgrading as it blocks my Aspire host tests. |
@martincostello We just pushed out version |
@normj Thanks - successfully upgraded to v4 now 🚀 |
@dscpinheiro Hi, we just stumbled upon this problem and I understand the reasons behind possibly null fields and collections. However, I don't understand why the fields and return values are not marked as nullable. This is a major problem because the AWS SDK is asking us to check for null on values that are marked as not-null, which actually is a problem detected by IDEs and the suggested solution by the IDE is to remove the null check. What plans do you have to address this issue? I'm not complaining about breaking backwards compatibility (that is fine), but about working against the language and IDEs. Right now, using V4 SDK is a sure way to introduce runtime |
|
V4 Development Tracker
This issue is for tracking the changes being made for V4 of the AWS SDK for .NET. Development of V4 is happening in the
v4-development
branch in this repository. V4 is an evolutionary major version change with minimal breaking changes so application code using the AWS SDK can upgrade to V4 with low effort.Update April 28th, 2025
V4 has been released general availability. We recommend all users of the AWS SDK for .NET to upgrade to V4 to take advantage of V4's performance improvements and continue to get support for the SDK before V3 reaches maintenance mode.
https://aws.amazon.com/blogs/developer/general-availability-of-aws-sdk-for-net-v4-0/
Updated libraries that depend on the AWS SDK for .NET
The following are the list of AWS .NET libraries that have updated to V4.
Update April 25th, 2025
In preparation of V4 GA we have made some branch changes in the repository. Checkout this GitHub issue for details. #3771
Update April 9th, 2025
Preview 13 has been released that includes support for AWS service operations that require bi-directional streaming over HTTP 2. This support is available for .NET 8 and later. Examples operations are Transcribe Streaming's
StartStreamTranscription
API and the new BedrockInvokeModelWithBidirectionalStream
operation. TheInvokeModelWithBidirectionalStream
brings support to .NET Amazon Nova Sonics's speech to speech feature. The .NET Framework target of the SDK will not have the bi-directional operations due to .NET Framework not supporting HTTP 2.At this point we consider V4 feature complete for GA. We will stay in preview mode for a little longer to collect feedback on the latest preview. We also have a bit of internal work hooking up V4 to our daily release cycle and finishing up documentation tasks. There will possibly be a few more small previews before GA for minor tweaks and fixes based on feedback.
Our ask to the AWS .NET community is to try out the latest preview of V4 to help confirm for us that V4 is ready to be GA.
Update November 11, 2024
New blog post released for preview 4 catching up some of the major changes since preview 1. https://aws.amazon.com/blogs/developer/preview-4-of-aws-sdk-for-net-v4/
Update August 15, 2024
First preview packages have been released. Blog post for the release https://aws.amazon.com/blogs/developer/preview-1-of-aws-sdk-for-net-v4/
Breaking changes
The list of breaking changes made in V4.
bool
are changed tobool?
.null
. The V3 behavior of initializing collections can be restored by setting theAmazon.AWSConfigs.InitializeCollections
totrue
. This property also exists in V3 for users that want to try this behavior change before upgrading to V4.us-east-1
will no longer be able to access buckets in other regions. Buckets musts be accessed with S3 service clients configured for the region the bucket is in. This change avoids surprises in applications using the S3 service client when under the covers it makes multiple AWS requests to access buckets that are not in service clients configuredus-east-1
region.Amazon.Auth.AccessControlPolicy.ActionIdentifiers
namespace. These identifiers were previously marked as obsolete due to be being out of date with no mechanism to keep them up to date. Code using theseActionIdentifiers
should be upgrade to use the string value of the IAM action name.AWSSDK.S3
package. This client had been marked as obsolete with the encryption client moved to its separate packageAmazon.Extensions.S3.Encryption
package. The following migration guide to transition to the separate package. https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/s3-encryption-migration.htmlDetermineServiceURL
method on theClientConfig
, the base class of service client configs likeAmazonS3Config
, was removed. This had been marked obsolete and was tied to an internal endpoint resolution system that was removed in V4. Application code calling this method should switch to using theDetermineServiceOperationEndpoint
method on the service client.us-east-1
regardless of the configured region when running in the public partition. As part of this change theStsRegionalEndpointsValue
enum was removed. Any code using that enum should be removed.RetryMode
defaults toStandard
instead ofLegacy
. TheLegacy
enum value was removed.DefaultConfigurationMode
defaults toStandard
instead ofLegacy
. TheLegacy
enum value was removed.DefaultClientConfig
inAWSSDK.Extensions.NETCore.Setup
no longer extends from service client config base classClientConfig
. The service client config properties have been replicated onDefaultClientConfig
using nullable value types to allow detecting when a value has been set onDefaultClientConfig
when copying the values to the service client config being created for the service client.CookieSigner
andUrlSigner
have been moved to a separate extension package calledAWSSDK.Extensions.CloudFront.Signers
to support SSL3 and take a dependency onBouncyCastle.Cryptography
.GetDecryptedPassword
has been moved to a separate package calledAWSSDK.Extensions.EC2.DecryptPassword
to support OpenSSL 3 and take a dependency onBouncyCastle.Cryptography
.Tagging-Directive
has been exposed as a public property onCopyObjectRequest
and is no longer automatically set to COPY. If a user doesn't specify a tagging directive the S3 backend automatically assumes it is COPY but if a user explicitly sets it to null, then we won't set the value at all.AmazonS3Config
'sUseArnRegion
will take the value set in the environment variable over that set in the~/.aws/config
file. This follows other config environment variable + config file precedence.DisableTrimmingLeadingSlash
has been removed.EndTime
then changedEndTimeUtc
toEndTime
. This could lead to offset times if anyone was still using the marked obsolete originalEndTime
for example. A compile time error will occur for anyone usingEndTimeUtc
. Removing BackwardCompatibility properties and code in the generator is part of this change. Also id this to the manual S3 models.TimestampFormat.ISO8601 || TimestampFormat.RFC822
datetimes were being parsed into local times. Adjusted DateTime parsing to return UTC times. (BaseResponseUnmarshaller.tt, MultiValueHeaderParser.cs)true
as the default.Other noteworthy changes
The following DateTime related changes were made in these two PRs:
#3572
#3601
Removed Code
ECSTaskCredentials
class is removed. Please use theGenericContainerCredentials
provider which also supports EKS Pod Identities.StoredProfileAWSCredentials
andStoredProfileCredentials
is removed. Please use theNetSDKCredentialsFile
or theSharedCredentialsFile
.HasCachedAccessTokenAvailable
method on the SSOAWSCredentials class is removed.EnvironmentAWSCredentials
is removed. Please useAppConfigAWSCredentials
instead.StoredProfileFederatedCredentials
is removed. Please useFederatedAWSCredentials
instead.StoredProfileSAMLCredentials
class in SecurityTokenService is removed. Please useFederatedAWSCredentials
instead.EndpointDiscoveryEnabled
class is removed. Please use theEnvironmentVariableAWSConfiguration
instead.UseSigV4
property on theAmazonWebServiceRequest
class is removed.SignatureVersion
will be used directly instead.TryGetSection
methods inProfileIniFile
that don't take in nested properties is removed. Please use theTryGetSection
method inProfileIniFile
that accounts for nested properties.Parameters
dictionary inWebServiceRequestEventArgs
is obsolete.ParameteCollection
will be used instead.DoesS3BucketExistAsync
(string bucketName) in ICoreAmazonS3 is removed because it always uses HTTP. Please useAmazon.S3.Util.AmazonS3Util.DoesS3BucketExistV2Async
instead.AWSSDKUtils
are removedResolveResourcePath
,ProtectEncodedSlashUrlEncode
,ConvertToUnixEpochMilliSeconds
EC2_METADATA_SVC
,EC2_METADATA_ROOT
,EC2_USERDATA_ROOT
,EC2_DYNAMICDATA_ROOT
,EC2_APITOKEN_URL
inEC2InstanceMetadata
are removed. The fields were marked as obsolete in v3.ProfileManager
class in Amazon.Util is removed. Please use the SharedCredentialsFile or the NetSDKCredentialsFile instead.AWSConfigs
are removed:Logging
,ResponseLogging
, andLogMetrics
. UseLoggingConfig
instead.public static Condition NewCondition(DateComparisonType type, DateTime date)
inAmazon.Auth/AccessControlPolicy/ConditionFactory
is removed. Please useNewConditionUtc
instead.ClientConfig
class, the obsoleteDetermineDnsSuffix
has been removed. Use the service specificclient.DetermineServiceOperationEndpoint
method instead. TheReadEntireResponse
property has been removed, use theAWSConfigs.LoggingConfig.LogResponses
orClientConfig.LogResponse
instead.DynamoDB Changes
In V4 we're addressing issues around testability, improving configuring the high-level
Table
andDynamoDBContext
clients, and potentially additional fixes that require breaking changes.Table
with a mockedIAmazonDynamoDB
now returns anInvalidOperationException
instead of aNullReferenceException
. AsyncTable
methods should now work with a mocked client but you may still see exceptions when calling sync methods from .NET/Core/Standard. See PR #3388, this mostly addresses DynamoDBTable
misrepresents dependency onIAmazonDynamoDB
#1589.DynamoDBOperationConfig
into new operation-specific objects (SaveConfig
,LoadConfig
,QueryConfig
, etc.). The shared config has grown overtime, and contains properties that don't apply to every operation which can lead to confusion. we've marked the methods that takeDynamoDBOperationConfig
as obsolete. We won't remove them from V4 yet, though may do so in a future version. See PR #3421MetadataCachingMode
andDisableFetchingTableMetadata
fromDynamoDBOperationConfig
, and did not include these on the new operation-specific configs that were introduced above. These are table-level settings that should be specified on the globalAWSConfigsDynamoDB.Context
or onDynamoDBContextConfig
. See PR #3422DynamoDBOperationConfig
no longer inherits fromDynamoDBContextConfig
. This prevents you from passing aDynamoDBOperationConfig
in to the constructor forDynamoDBContext
, where some properties on the operation-specific config (such asOverrideTableName
) do not apply. See PR #3422IDynamoDBContext
have been updated to return the new interfaces.IBatchGet
andIMultiTableBatchGet
interfaces.IBatchWrite
andIMultiTableBatchWrite
interfaces.ITransactGet
andIMultiTableTransactGet
interfaces.ITransactWrite
andIMultiTableTransactWrite
interfaces.IAsyncSearch
interface.ITable
interface.ISearch
interface.IDocumentTransactWrite
andIMultiTableDocumentTransactWrite
interfaces.IDocumentTransactGet
andIMultiTableDocumentTransactGet
interfaces.IDocumentBatchWrite
andIMultiTableDocumentBatchWrite
interfaces.IDocumentBatchGet
andIMultiTableDocumentBatchGet
interfaces.FromJson
andToJson
methods on theDocument
object now use System.Text.Json instead of LitJson for serialization. A benefit of using System.Text.Json is this parser supports using the .NET Decimal type supporting higher precision for numeric floating point properties.System.InvalidOperationException: Type <type> is unsupported, it cannot be instantiated
. The work around is to add theDynamicDependency
somewhere in the code path that informs the trimmer about the dependency on the sub type. The constructor of the top level .NET type being saved is a likely place to use the constructor. The code below shows how to use theDynamicDependency
attribute:Logging
How to enable logging for the SDK has been reworked for V4. Logging to the console and system diagnostics works the same as V3 by setting the
AWSConfigs.LoggingConfig.LogTo
property to eitherLoggingOptions.Console
orLoggingOptions.SystemDiagnostics
. TheLoggingOptions
option forlog4net
has been removed along with the SDK's internal logic for using reflection to attach to in memory instance of log4net.To include the SDK's logging into a logging framework a separate adaptor package is used to connect the SDK with the the logging framework. We have released AWSSDK.Extensions.Logging.Log4NetAdaptor for 'log4net' and AWSSDK.Extensions.Logging.ILoggerAdaptor for
Microsoft.Extensions.Logging
.Example configuring Microsoft.Extensions.Logging
Add
AWSSDK.Extensions.Logging.ILoggerAdaptor
NuGet package and call theConfigureAWSSDKLogging
extension method from theILoggerFactory
.Example configuring for log4net
Add
AWSSDK.Extensions.Logging.Log4NetAdaptor
NuGet package and call the staticConfigureAWSSDKLogging
method fromLog4NetAWSExtensions
.The following changes were made in the SDK. They do not require changes to applications code using the SDK.
System.Text.Json
for serialization. For Non-NetFramework targets, the SDK will utilize buffer pooling for writing. For reading, the SDK will utilize buffer pooling for all targets.AssemblyVersion
will match theAssemblyFileVersion
. In .NET Framework 4.7.2 targetAssemblyVersion
will continue to use the V3 pattern of locking the version to the first 2 parts of the theAssemblyFileVersion
. This is done because .NET Framework treats theAssemblyVersion
as part of the identity assembly. This causes assembly collisions and forced recompilation when mixing versions of the SDK.endpoints.json
file in AWSSDK.Core was removed. This was a 1 MB json file that was parsed at startup for the SDK to determine the service endpoint for a region. Endpoint resolution has been replaced with a new system that generates rules into each individual service assembly for determining the service endpoints.AWSSDK.ToHex
performance. Thanks Steven WeerdenburgAWSSDK.CopyTo
performance. Thanks Daniel MarbachAWSSDKUtils.ParameterAsString
performance. Thanks Daniel MarbachAWSSDKUtils.DetermineService
performance. Thanks Daniel MarbachAWSSDKUtils.UrlEncode
performance. Thanks Daniel MarbachThanks Paulo Morgado
The text was updated successfully, but these errors were encountered: