Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Migrating to version 4 of the AWS SDK for .NET

Focus mode
Migrating to version 4 of the AWS SDK for .NET - AWS SDK for .NET (V4)

Version 4 (V4) of the AWS SDK for .NET has been released!

For information about breaking changes and migrating your applications, see the migration topic.

Version 4 (V4) of the AWS SDK for .NET has been released!

For information about breaking changes and migrating your applications, see the migration topic.

The AWS SDK for .NET version 4 (V4) has a significant number of breaking changes from version 3 (V3) of the SDK. This topic describes the breaking changes in version 4 and possible work that you might need to do to migrate your environment or code from V3. For additional information about other noteworthy changes in the SDK, see the following development-tracker issue on GitHub: https://github.com/aws/aws-sdk-net/issues/3362.

.NET Framework

The .NET Framework 3.5 target has been removed from V4 of the AWS SDK for .NET. As a result, the SDK no longer supports .NET Framework 3.5. This version of the SDK is compiled against .NET Framework 4.7.2 and runs in the .NET 4.0 runtime. For more information, see Supported platforms.

Value types

Properties that use value types in classes that are used for making requests and responses have been changed to use nullable value types. Properties with the following types have been changed:

  • bool has been changed to bool?

  • double has been changed to double?

  • int has been changed to int?

  • float has been changed to float?

  • long has been changed to long?

  • Datetime has been changed to Datetime?

Collections

Properties that use collections in classes that are used for making requests and responses now default to null. As a result, your code needs to verify that a collection isn't null before trying to use it. For example:

var sqsClient = new AmazonSQSClient(); var listResponse = await sqsClient.ListQueuesAsync(new ListQueuesRequest()); if (listResponse.QueueUrls != null) { foreach (string qUrl in listResponse.QueueUrls) { // Perform operations on each queue such as displaying all the attributes. } }

The V3 behavior of initializing collections can be restored by setting Amazon.AWSConfigs.InitializeCollections to true. This property also exists in V3 for users who want to try this behavior change before upgrading to V4.

AWS Security Token Service (STS)

  • The regional endpoint

    When using credential providers that rely on AWS STS, the calls always use the regional endpoint. This differs from V3 of the SDK, which used the us-east-1 Region by default when running in the public partition regardless of the configured Region.

  • The StsRegionalEndpointsValue enum

    The StsRegionalEndpointsValue enum was removed from the Amazon.Runtime namespace. Any code using that enum should be removed.

  • The STSAssumeRoleAWSCredentials class

    The deprecated STS assume role credential provider, STSAssumeRoleAWSCredentials, has been removed from the Amazon.SecurityToken namespace. Use AssumeRoleAWSCredentials from Amazon.Runtime instead.

Changes related to ClientConfig

The Amazon.Runtime.ClientConfig class is the base class of service client configuration classes like AmazonS3Config. The following changes were made to this base class.

  • Default retry mode

    The RetryMode property defaults to Standard instead of Legacy. As a result, the Legacy value has been removed from the Amazon.Runtime.RequestRetryMode enum.

  • Default configuration mode

    The DefaultConfigurationMode property defaults to Standard instead of Legacy. As a result, the Legacy value has been removed from the Amazon.Runtime.DefaultConfigurationMode enum.

  • The ReadWriteTimeout property

    The obsolete ReadWriteTimeout property was removed from all targets except .NET Framework 4.7.2.

The AWSSDK.Extensions.NETCore.Setup NuGet package

The AWSSDK.Extensions.NETCore.Setup NuGet package has been updated to alleviate issues that were present in V3 of the SDK as well as to make the package safe for Native AOT. These changes are summarized below. For detailed information see PR 3353 on GitHub.

  • The DefaultClientConfig class

    The DefaultClientConfig class is no longer inherited from the service client configuration base class Amazon.Runtime.ClientConfig. The relevant properties from ClientConfig have been replicated on DefaultClientConfig using nullable value types. This change allows us to detect when a value has been set on DefaultClientConfig when copying the values to the configuration being created for the service client.

  • Native AOT

    A new mechanism for creating service clients that uses C# 11 static interface methods has been added to the package. This change eliminates the need to do Assembly type loads to create instances of service clients, including string manipulation of the service interface name to compute the service client type, which is incompatible with Native AOT. This change is available only for .NET 8 and later; older versions still use the original mechanism.

The source code for this package is on GitHub at https://github.com/aws/aws-sdk-net/tree/main/extensions/src/AWSSDK.Extensions.NETCore.Setup.

CookieSigner and UrlSigner

The CookieSigner and UrlSigner extensions for Amazon CloudFront have been moved to a separate extension package called AWSSDK.Extensions.CloudFront.Signers. This change is to support OpenSSL 3 and take a dependency on BouncyCastle.Cryptography.

The source code for this package is on GitHub at https://github.com/aws/aws-sdk-net/tree/main/extensions/src/AWSSDK.Extensions.CloudFront.Signers.

DateTime versus UTC DateTime

Some V3 classes have a DateTime property that's marked as "deprecated" or "obsolete", as well as an alternative UTC DateTime property. In these classes, the obsolete DateTime property has been removed, and the name of the UTC DateTime property has been changed to the original name of the DateTime property.

The following are some examples of classes for which this change has been implemented.

  • DescribeSpotPriceHistoryRequest:

    • The obsolete StartTime property has been removed, and the name of the StartTimeUtc property has been changed to "StartTime".

    • The obsolete EndTime property has been removed, and the name of the EndTimeUtc property has been changed to "EndTime".

  • CreateFleetRequest

    • The obsolete ValidFrom property has been removed, and the name of the ValidFromUtc property has been changed to "ValidFrom".

    • The obsolete ValidUntil property has been removed, and the name of the ValidUntilUtc property has been changed to "ValidUntil".

This change might lead to offset times if an application is using the original, obsolete DateTime property. A compile time error will occur for code that uses the UTC DateTime property.

DateTime parsing

The DateTimeUnmarshaller class has been updated. This class had been parsing and returning DateTime strings as local time. In some cases, these values were being converted back to UTC due to a prior update, but not always. Now, DateTime strings that are unmarshalled are assumed to be UTC and will be specified and unmarshalled as UTC. This update includes the following behavior changes.

Certain timestamp properties that are based on the DateTime class were being parsed into local times. These included response unmarshallers for timestamps and list timestamps for formats TimestampFormat.ISO8601 and TimestampFormat.RFC822. DateTime parsing has been updated to return UTC times instead.

ConvertFromUnixEpochSeconds and ConvertFromUnixEpochMilliseconds

The ConvertFromUnixEpochSeconds and ConvertFromUnixEpochMilliseconds methods, which convert Unix epoch seconds to a DateTime structure, were returning the Unix Epoch time as a local time instead of a UTC time. These methods now return UTC time.

Logging

The way in which you enable logging in the SDK has been updated for V4. Logging to the console and system diagnostics works the same as V3; that is, by setting the LoggingConfig.LogTo property of the AWSConfigs class to either LoggingOptions.Console or LoggingOptions.SystemDiagnostics. The LoggingOptions option for log4net has been removed along with the SDK's internal logic for using reflection to attach to an 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 logging framework. Use the AWSSDK.Extensions.Logging.Log4NetAdaptor package for log4net and the AWSSDK.Extensions.Logging.ILoggerAdaptor package for Microsoft.Extensions.Logging. The following code examples show you how to configure logging in these two cases.

Add the AWSSDK.Extensions.Logging.Log4NetAdaptor NuGet package and call the static ConfigureAWSSDKLogging method from Log4NetAWSExtensions.

using Amazon.DynamoDBv2; using Amazon.Extensions.Logging.Log4NetAdaptor; using log4net; [assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config")] Log4NetAWSExtensions.ConfigureAWSSDKLogging(); var logger = LogManager.GetLogger(typeof(Program));

Add the AWSSDK.Extensions.Logging.Log4NetAdaptor NuGet package and call the static ConfigureAWSSDKLogging method from Log4NetAWSExtensions.

using Amazon.DynamoDBv2; using Amazon.Extensions.Logging.Log4NetAdaptor; using log4net; [assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config")] Log4NetAWSExtensions.ConfigureAWSSDKLogging(); var logger = LogManager.GetLogger(typeof(Program));

Add the AWSSDK.Extensions.Logging.ILoggerAdaptor NuGet package and call the ConfigureAWSSDKLogging extension method from the ILoggerFactory interface.

var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); app.Services.GetRequiredService<ILoggerFactory>() .ConfigureAWSSDKLogging();

Add the AWSSDK.Extensions.Logging.ILoggerAdaptor NuGet package and call the ConfigureAWSSDKLogging extension method from the ILoggerFactory interface.

var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); app.Services.GetRequiredService<ILoggerFactory>() .ConfigureAWSSDKLogging();

Support for HTTP 2

Support for HTTP 2 has been added to enable bi-directional streaming. For more information see Support for HTTP 2.

Single sign-on

The default value of the SupportsGettingNewToken property of the SSOAWSCredentialsOptions class has been changed from true to false. If you have applications that use the SSOAWSCredentials class to obtain SSO credentials, you might need to set the Options.SupportsGettingNewToken property to true. For examples of this configuration, see the code examples in Tutorial for SSO using only .NET applications. For additional information, see PR 3737 in the aws-sdk-net GitHub repository.

Changes specific to DynamoDB

The following changes are specific to Amazon DynamoDB. Many of them are breaking changes.

V4 changes in the SDK for DynamoDB address some issues around testability, but primarily center around the high-level libraries:

For detailed information about these programming modes, see DynamoDB in this guide.

Document Model: Updated exception for mocked IAmazonDynamoDB interface

In the document model prior to V4 of the SDK, if a Table was initialized with a mocked IAmazonDynamoDB interface, it would return NullReferenceException. V4 of the SDK returns InvalidOperationException instead. Async Table methods should work with a mocked client but you might still see exceptions when calling synchronous methods from .NET/Core/Standard.

For more information about this change, see PR 3388 on GitHub.

Document Model: FromJson and ToJson methods

The FromJson and ToJson methods of the Document class now use System.Text.Json instead of LitJson for serialization, and LitJson has been removed from V4 of the SDK. A benefit of using System.Text.Json is that this parser supports using the .NET Decimal type, which supports higher precision for numeric floating point properties.

Object Persistence Model: The DynamoDBOperationConfig class

In the object persistence model, the following changes have been made to the shared DynamoDBOperationConfig class:

  • The class has been separated into new operation-specific classes such as SaveConfig, LoadConfig, and QueryConfig. Methods that take DynamoDBOperationConfig have been marked as obsolete and are subject to removal in the future.

    For more information about this change, see PR 3421 on GitHub.

  • The MetadataCachingMode and DisableFetchingTableMetadata properties have been removed from the class. These properties were not included in the new operation-specific classes mentioned earlier. The removed properties are table-level settings that should be specified on the global Context property of the AWSConfigsDynamoDB class or on the DynamoDBContextConfig class.

    For more information about this change, see PR 3422 on GitHub.

  • The class no longer inherits from the DynamoDBContextConfig class. This prevents you from passing a DynamoDBOperationConfig object in to the constructor for DynamoDBContext, where some properties on the operation-specific config (such as OverrideTableName) don't apply.

    For more information about this change, see PR 3422 on GitHub.

Object Persistence Model: Polymorphism

The DynamoDBPolymorphicTypeAttribute class was added to the object persistence model. This class enables support for serialization and deserialization of polymorphic types. For more information, see PR 3643 on GitHub.

Document Model and Object Persistence Model: Mockable operations

New operation-specific interfaces have been added that allow customers to mock DynamoDB operations. The factory methods on the IDynamoDBContext interface have been updated to return the new interfaces.

For more information about this change, see PR 3450 on GitHub.

  • Object Persistence Model

    • Mock BatchGet operations via the IBatchGet and IMultiTableBatchGet interfaces.

    • Mock BatchWrite operations via the IBatchWrite and IMultiTableBatchWrite interfaces.

    • Mock TransactGet operations via the ITransactGet and IMultiTableTransactGet interfaces.

    • Mock TransactWrite operations via the ITransactWrite and IMultiTableTransactWrite interfaces.

    • Mock Scan and Query operations via the IAsyncSearch interface.

  • Document Model

    • Mock Table operations via the ITable interface.

    • Mock Scan and Query operations via the ISearch interface.

    • Mock TransactWrite operations via the IDocumentTransactWrite and IMultiTableDocumentTransactWrite interfaces.

    • Mock TransactGet operations via the IDocumentTransactGet and IMultiTableDocumentTransactGet interfaces.

    • Mock BatchWrite operations via the IDocumentBatchWrite and IMultiTableDocumentBatchWrite interfaces.

    • Mock BatchGet operations via the IDocumentBatchGet and IMultiTableDocumentBatchGet interfaces.

Document Model and Object Persistence Model: Support for Native AOT

A limitation of Native AOT is support for nested .NET types. In some cases, these nested types might go unnoticed by the trimming component of the .NET compiler. In this case, you might receive an exception such as: "System.InvalidOperationException: Type <type> is unsupported, it cannot be instantiated."

You can work around this limitation by adding the DynamicDependency 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. The following code example shows you how to use the DynamicDependency attribute:

[DynamoDBTable("TestTable")] class TypeWithNestedTypeProperty { [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(SubType))] public TypeWithNestedTypeProperty() { } [DynamoDBHashKey] public string Id { get; set; } public string Name { get; set; } public SubType SubType { get; set; } } class SubType { public string SubName { get; set; } }

DynamoDBStreams

DynamoDBStreams has been removed from the AWSSDK.DynamoDB NuGet package and is available in its own package, AWSSDK.DynamoDBStreams, and has its own namespace, Amazon.DynamoDBStreams.

Allow removal of the TableNamePrefix value

You can now remove the value of the TableNamePrefix property in the DynamoDBContextConfig class on the individual operation level. For more information about this change, see PR 3476 on GitHub.

RetrieveDateTimeInUtc property

For the DynamoDBContextConfig class, the default value of the RetrieveDateTimeInUtc property has been changed to true.

DynamoDBContextTableNamePrefix property

Removed the DynamoDBContextTableNamePrefix property from AWSConfigsDynamoDB class. Users should call AWSConfigsDynamoDB.Context.TableNamePrefix instead of

V4 changes in the SDK for DynamoDB address some issues around testability, but primarily center around the high-level libraries:

For detailed information about these programming modes, see DynamoDB in this guide.

Document Model: Updated exception for mocked IAmazonDynamoDB interface

In the document model prior to V4 of the SDK, if a Table was initialized with a mocked IAmazonDynamoDB interface, it would return NullReferenceException. V4 of the SDK returns InvalidOperationException instead. Async Table methods should work with a mocked client but you might still see exceptions when calling synchronous methods from .NET/Core/Standard.

For more information about this change, see PR 3388 on GitHub.

Document Model: FromJson and ToJson methods

The FromJson and ToJson methods of the Document class now use System.Text.Json instead of LitJson for serialization, and LitJson has been removed from V4 of the SDK. A benefit of using System.Text.Json is that this parser supports using the .NET Decimal type, which supports higher precision for numeric floating point properties.

Object Persistence Model: The DynamoDBOperationConfig class

In the object persistence model, the following changes have been made to the shared DynamoDBOperationConfig class:

  • The class has been separated into new operation-specific classes such as SaveConfig, LoadConfig, and QueryConfig. Methods that take DynamoDBOperationConfig have been marked as obsolete and are subject to removal in the future.

    For more information about this change, see PR 3421 on GitHub.

  • The MetadataCachingMode and DisableFetchingTableMetadata properties have been removed from the class. These properties were not included in the new operation-specific classes mentioned earlier. The removed properties are table-level settings that should be specified on the global Context property of the AWSConfigsDynamoDB class or on the DynamoDBContextConfig class.

    For more information about this change, see PR 3422 on GitHub.

  • The class no longer inherits from the DynamoDBContextConfig class. This prevents you from passing a DynamoDBOperationConfig object in to the constructor for DynamoDBContext, where some properties on the operation-specific config (such as OverrideTableName) don't apply.

    For more information about this change, see PR 3422 on GitHub.

Object Persistence Model: Polymorphism

The DynamoDBPolymorphicTypeAttribute class was added to the object persistence model. This class enables support for serialization and deserialization of polymorphic types. For more information, see PR 3643 on GitHub.

Document Model and Object Persistence Model: Mockable operations

New operation-specific interfaces have been added that allow customers to mock DynamoDB operations. The factory methods on the IDynamoDBContext interface have been updated to return the new interfaces.

For more information about this change, see PR 3450 on GitHub.

  • Object Persistence Model

    • Mock BatchGet operations via the IBatchGet and IMultiTableBatchGet interfaces.

    • Mock BatchWrite operations via the IBatchWrite and IMultiTableBatchWrite interfaces.

    • Mock TransactGet operations via the ITransactGet and IMultiTableTransactGet interfaces.

    • Mock TransactWrite operations via the ITransactWrite and IMultiTableTransactWrite interfaces.

    • Mock Scan and Query operations via the IAsyncSearch interface.

  • Document Model

    • Mock Table operations via the ITable interface.

    • Mock Scan and Query operations via the ISearch interface.

    • Mock TransactWrite operations via the IDocumentTransactWrite and IMultiTableDocumentTransactWrite interfaces.

    • Mock TransactGet operations via the IDocumentTransactGet and IMultiTableDocumentTransactGet interfaces.

    • Mock BatchWrite operations via the IDocumentBatchWrite and IMultiTableDocumentBatchWrite interfaces.

    • Mock BatchGet operations via the IDocumentBatchGet and IMultiTableDocumentBatchGet interfaces.

Document Model and Object Persistence Model: Support for Native AOT

A limitation of Native AOT is support for nested .NET types. In some cases, these nested types might go unnoticed by the trimming component of the .NET compiler. In this case, you might receive an exception such as: "System.InvalidOperationException: Type <type> is unsupported, it cannot be instantiated."

You can work around this limitation by adding the DynamicDependency 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. The following code example shows you how to use the DynamicDependency attribute:

[DynamoDBTable("TestTable")] class TypeWithNestedTypeProperty { [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(SubType))] public TypeWithNestedTypeProperty() { } [DynamoDBHashKey] public string Id { get; set; } public string Name { get; set; } public SubType SubType { get; set; } } class SubType { public string SubName { get; set; } }

DynamoDBStreams

DynamoDBStreams has been removed from the AWSSDK.DynamoDB NuGet package and is available in its own package, AWSSDK.DynamoDBStreams, and has its own namespace, Amazon.DynamoDBStreams.

Allow removal of the TableNamePrefix value

You can now remove the value of the TableNamePrefix property in the DynamoDBContextConfig class on the individual operation level. For more information about this change, see PR 3476 on GitHub.

RetrieveDateTimeInUtc property

For the DynamoDBContextConfig class, the default value of the RetrieveDateTimeInUtc property has been changed to true.

DynamoDBContextTableNamePrefix property

Removed the DynamoDBContextTableNamePrefix property from AWSConfigsDynamoDB class. Users should call AWSConfigsDynamoDB.Context.TableNamePrefix instead of

Changes specific to EC2

The following changes are specific to Amazon EC2. Most or all of them are breaking changes.

GetDecryptedPassword

The GetDecryptedPassword extension for Amazon EC2 has been moved to a separate extension package called AWSSDK.Extensions.EC2.DecryptPassword. This change is to support OpenSSL 3 and take a dependency on BouncyCastle.Cryptography.

The source code for this package is on GitHub at https://github.com/aws/aws-sdk-net/tree/main/extensions/src/AWSSDK.Extensions.EC2.DecryptPassword.

Support for Amazon EC2 IMDSv1

Support for Instance Metadata Service Version 1 (IMDSv1) has been removed. V4 of the SDK always uses Instance Metadata Service Version 2 (IMDSv2) when fetching credentials and other metadata from the IMDS. For more information about the IMDS, see Use the IMDS in the Amazon EC2 User Guide.

Programming elements that were changed or removed

  • The entire Amazon.EC2.Import namespace and code have been removed.

  • The entire Amazon.EC2.Util namespace and code have been removed, which includes the AMI utilities that were used to look up EC2 AMIs for Windows.

  • The obsolete IpRanges property has been removed from the IpPermission class. Use the Ipv4Ranges or Ipv6Ranges properties instead.

  • The following obsolete fields have been removed from the EC2InstanceMetadata class: EC2_METADATA_SVC, EC2_METADATA_ROOT, EC2_USERDATA_ROOT, EC2_DYNAMICDATA_ROOT, and EC2_APITOKEN_URL.

GetDecryptedPassword

The GetDecryptedPassword extension for Amazon EC2 has been moved to a separate extension package called AWSSDK.Extensions.EC2.DecryptPassword. This change is to support OpenSSL 3 and take a dependency on BouncyCastle.Cryptography.

The source code for this package is on GitHub at https://github.com/aws/aws-sdk-net/tree/main/extensions/src/AWSSDK.Extensions.EC2.DecryptPassword.

Support for Amazon EC2 IMDSv1

Support for Instance Metadata Service Version 1 (IMDSv1) has been removed. V4 of the SDK always uses Instance Metadata Service Version 2 (IMDSv2) when fetching credentials and other metadata from the IMDS. For more information about the IMDS, see Use the IMDS in the Amazon EC2 User Guide.

Programming elements that were changed or removed

  • The entire Amazon.EC2.Import namespace and code have been removed.

  • The entire Amazon.EC2.Util namespace and code have been removed, which includes the AMI utilities that were used to look up EC2 AMIs for Windows.

  • The obsolete IpRanges property has been removed from the IpPermission class. Use the Ipv4Ranges or Ipv6Ranges properties instead.

  • The following obsolete fields have been removed from the EC2InstanceMetadata class: EC2_METADATA_SVC, EC2_METADATA_ROOT, EC2_USERDATA_ROOT, EC2_DYNAMICDATA_ROOT, and EC2_APITOKEN_URL.

Changes specific to S3

The following changes are specific to Amazon S3. Most or all of them are breaking changes.

AWS Region us-east-1

Amazon S3 service clients configured for the us-east-1 Region can no longer access buckets in other Regions. Buckets must be accessed with S3 service clients configured for the Region the bucket is in.

S3 encryption client

The Amazon S3 encryption client, which is defined in the Amazon.S3.Encryption namespace, has been removed from the AWSSDK.S3 package. This client has been moved to its own package called Amazon.Extensions.S3.Encryption, and the documentation for it is at https://aws.github.io/amazon-s3-encryption-client-dotnet/api/Amazon.Extensions.S3.Encryption.html. For information about migration, see Amazon S3 Encryption Client Migration. For more information about S3 encryption, see Supported encryption algorithms in the Amazon S3 Encryption Client Developer Guide.

S3 tagging directive for CopyObject

The TaggingDirective property has been exposed as a public property of the CopyObjectRequest class, which is used by AmazonS3Client.CopyObject methods. This property corresponds to the Amazon S3 x-amz-tagging-directive parameter, as defined in the CopyObject action.

The tagging directive is no longer automatically set to COPY. If a developer doesn't specify a tagging directive, the S3 backend automatically assumes it is COPY, but if a developer explicitly sets the property to null, then the value isn't set at all.

The UseArnRegion property for S3 configuration

The UseArnRegion property of the Amazon.S3.AmazonS3Config class has been updated such that the AWS_S3_USE_ARN_REGION environment variable takes precedence over the s3_use_arn_region setting in the shared AWS config file. For more information about these variables and settings, see Settings reference in the AWS SDKs and Tools Reference Guide.

Leading slashes for the CopyObject and CopyPart methods

Leading slashes will no longer be trimmed for the Amazon S3 CopyObject and CopyPart methods. The DisableTrimmingLeadingSlash property has been removed from the CopyObjectRequest and CopyPartRequest classes.

The DoesS3BucketExist... methods

The obsolete DoesS3BucketExist and DoesS3BucketExistAsync methods have been removed from the AmazonS3Util class, which implements the ICoreAmazonS3 interface. These methods were removed because they always use HTTP. Use DoesS3BucketExistV2 and DoesS3BucketExistV2Async instead.

SDK always uses SigV4

Version 4 of the AWS SDK for .NET always uses AWS Signature Version 4 (SigV4) for signing requests. This change results in the following related changes:

  • The UseSignatureVersion4 property of the AWSConfigsS3 class has been removed.

  • The SignatureVersion property of the Amazon.Runtime.ClientConfig class has been removed. This property was used only by Amazon S3 for backward compatibility.

  • The RegionEndpoint.Endpoint class has been removed. This includes the SignatureVersionOverride property, which was used to override signature versions for Amazon S3. Use the service-specific client.DetermineServiceOperationEndPoint() method instead.

  • Updated methods AmazonS3Util.PostUpload and S3PostUploadSignedPolicy.GetSignedPolicy to use SigV4. As a consequence, the S3PostUploadSignedPolicy.GetSignedPolicyV4 method was removed because GetSignedPolicy now performs the same function. In addition, GetSignedPolicy has been given a third parameter for Region endpoint.

The GetACL and PutACL methods

The GetACL and PutACL methods of the AmazonS3Client class have been marked as obsolete. To access the functionality of these methods, use the following new methods instead: GetBucketACL, PutBucketACL, GetObjectACL, and PutObjectACL.

Obsolete programing elements removed

A number of programming elements of the Amazon S3 implementation were removed from V4 of the SDK, including enumeration values, types, methods, namespaces, etc. These are listed below, if not already covered previously, along with potential steps that you can take to accommodate their removal.

  • The DisableMD5Stream property has been removed from the TransferUtilityUploadRequest class. Use the DisableDefaultChecksumValidation property instead.

    In addition, the CalculateContentMD5Header property has been removed from the TransferUtilityUploadRequest class. This property is no longer needed because the SDK computes a checksum by default.

  • The ServerSideEncryptionMethod and ServerSideEncryptionKeyManagementServiceKeyId properties have been removed from the CopyPartRequest class. Use the properties with the same names in the InitiateMultipartUploadRequest class instead, which is used in some of the InitiateMultipartUpload... methods of the AmazonS3Client class.

  • The Expires property has been removed from the GetObjectResponse class. Use the ExpiresString property instead. The string might not be in a valid timestamp format, so your code should use the TryParse method when converting to a DateTime.

  • Obsolete AWS Region identifiers have been removed from the S3Region enumeration.

  • The Prefix property has been removed from the LifecycleRule class. Use the Filter property instead.

    In addition, the NoncurrentVersionTransition and Transition properties have been removed from the LifecycleRule class. Use the NoncurrentVersionTransitions and Transitions collections instead.

  • The Event property has been removed from the TopicConfiguration class. Use the Events collection instead.

  • CalculateContentMD5Header property. This property no longer needed to be set because the SDK will compute a checksum by default.

  • The Bucket property has been removed from the SelectObjectContentRequest class. Use the BucketName property instead.

  • The NumberOfUploadThreads property has been removed from the TransferUtilityConfig class. Use ConcurrentServiceRequests property instead.

AWS Region us-east-1

Amazon S3 service clients configured for the us-east-1 Region can no longer access buckets in other Regions. Buckets must be accessed with S3 service clients configured for the Region the bucket is in.

S3 encryption client

The Amazon S3 encryption client, which is defined in the Amazon.S3.Encryption namespace, has been removed from the AWSSDK.S3 package. This client has been moved to its own package called Amazon.Extensions.S3.Encryption, and the documentation for it is at https://aws.github.io/amazon-s3-encryption-client-dotnet/api/Amazon.Extensions.S3.Encryption.html. For information about migration, see Amazon S3 Encryption Client Migration. For more information about S3 encryption, see Supported encryption algorithms in the Amazon S3 Encryption Client Developer Guide.

S3 tagging directive for CopyObject

The TaggingDirective property has been exposed as a public property of the CopyObjectRequest class, which is used by AmazonS3Client.CopyObject methods. This property corresponds to the Amazon S3 x-amz-tagging-directive parameter, as defined in the CopyObject action.

The tagging directive is no longer automatically set to COPY. If a developer doesn't specify a tagging directive, the S3 backend automatically assumes it is COPY, but if a developer explicitly sets the property to null, then the value isn't set at all.

The UseArnRegion property for S3 configuration

The UseArnRegion property of the Amazon.S3.AmazonS3Config class has been updated such that the AWS_S3_USE_ARN_REGION environment variable takes precedence over the s3_use_arn_region setting in the shared AWS config file. For more information about these variables and settings, see Settings reference in the AWS SDKs and Tools Reference Guide.

Leading slashes for the CopyObject and CopyPart methods

Leading slashes will no longer be trimmed for the Amazon S3 CopyObject and CopyPart methods. The DisableTrimmingLeadingSlash property has been removed from the CopyObjectRequest and CopyPartRequest classes.

The DoesS3BucketExist... methods

The obsolete DoesS3BucketExist and DoesS3BucketExistAsync methods have been removed from the AmazonS3Util class, which implements the ICoreAmazonS3 interface. These methods were removed because they always use HTTP. Use DoesS3BucketExistV2 and DoesS3BucketExistV2Async instead.

SDK always uses SigV4

Version 4 of the AWS SDK for .NET always uses AWS Signature Version 4 (SigV4) for signing requests. This change results in the following related changes:

  • The UseSignatureVersion4 property of the AWSConfigsS3 class has been removed.

  • The SignatureVersion property of the Amazon.Runtime.ClientConfig class has been removed. This property was used only by Amazon S3 for backward compatibility.

  • The RegionEndpoint.Endpoint class has been removed. This includes the SignatureVersionOverride property, which was used to override signature versions for Amazon S3. Use the service-specific client.DetermineServiceOperationEndPoint() method instead.

  • Updated methods AmazonS3Util.PostUpload and S3PostUploadSignedPolicy.GetSignedPolicy to use SigV4. As a consequence, the S3PostUploadSignedPolicy.GetSignedPolicyV4 method was removed because GetSignedPolicy now performs the same function. In addition, GetSignedPolicy has been given a third parameter for Region endpoint.

The GetACL and PutACL methods

The GetACL and PutACL methods of the AmazonS3Client class have been marked as obsolete. To access the functionality of these methods, use the following new methods instead: GetBucketACL, PutBucketACL, GetObjectACL, and PutObjectACL.

Obsolete programing elements removed

A number of programming elements of the Amazon S3 implementation were removed from V4 of the SDK, including enumeration values, types, methods, namespaces, etc. These are listed below, if not already covered previously, along with potential steps that you can take to accommodate their removal.

  • The DisableMD5Stream property has been removed from the TransferUtilityUploadRequest class. Use the DisableDefaultChecksumValidation property instead.

    In addition, the CalculateContentMD5Header property has been removed from the TransferUtilityUploadRequest class. This property is no longer needed because the SDK computes a checksum by default.

  • The ServerSideEncryptionMethod and ServerSideEncryptionKeyManagementServiceKeyId properties have been removed from the CopyPartRequest class. Use the properties with the same names in the InitiateMultipartUploadRequest class instead, which is used in some of the InitiateMultipartUpload... methods of the AmazonS3Client class.

  • The Expires property has been removed from the GetObjectResponse class. Use the ExpiresString property instead. The string might not be in a valid timestamp format, so your code should use the TryParse method when converting to a DateTime.

  • Obsolete AWS Region identifiers have been removed from the S3Region enumeration.

  • The Prefix property has been removed from the LifecycleRule class. Use the Filter property instead.

    In addition, the NoncurrentVersionTransition and Transition properties have been removed from the LifecycleRule class. Use the NoncurrentVersionTransitions and Transitions collections instead.

  • The Event property has been removed from the TopicConfiguration class. Use the Events collection instead.

  • CalculateContentMD5Header property. This property no longer needed to be set because the SDK will compute a checksum by default.

  • The Bucket property has been removed from the SelectObjectContentRequest class. Use the BucketName property instead.

  • The NumberOfUploadThreads property has been removed from the TransferUtilityConfig class. Use ConcurrentServiceRequests property instead.

Programming elements that were removed

A number of programming elements were removed from V4 of the SDK, including enumeration values, types, methods, namespaces, etc. These are listed below, if not already covered previously, along with potential steps that you can take to accommodate their removal.

The Amazon.Auth.AccessControlPolicy.ActionIdentifiers namespace

The Amazon.Auth.AccessControlPolicy.ActionIdentifiers namespace has been removed. This includes IAM action identifiers, which were defined in the IdentityandAccessManagementActionIdentifiers class. Code that uses these action identifiers should be changed to use string values of the action name.

For additional information, see Creating IAM managed policies from JSON and Overview of JSON policies in the IAM User Guide.

The ClientConfig class

The Amazon.Runtime.ClientConfig class is the base class of service client configuration classes like AmazonS3Config. The following programming elements have been removed from this class.

  • The DetermineServiceURL and DetermineDnsSuffix methods have been removed. Use the DetermineServiceOperationEndpoint method of the service client instead; for example, AmazonS3Client.DetermineServiceOperationEndpoint.

  • The ReadEntireResponse property has been removed. Use one of the following instead:

The Amazon.Runtime namespace

The Amazon.Runtime namespace was updated as follows:

  • The obsolete ECSTaskCredentials class has been removed from the namespace. Use the GenericContainerCredentials provider instead, which also supports Amazon EKS Pod Identities.

  • The obsolete StoredProfileAWSCredentials and StoredProfileCredentials classes have been removed from the namespace. Use the NetSDKCredentialsFile or the SharedCredentialsFile class of the Amazon.Runtime.CredentialManagement namespace instead.

  • The obsolete HasCachedAccessTokenAvailable method of the SSOAWSCredentials class has been removed from the namespace.

  • The obsolete EnvironmentAWSCredentials class has been removed from the namespace. Use the AppConfigAWSCredentials class instead.

  • The obsolete StoredProfileFederatedCredentials class has been removed from the namespace. Use the FederatedAWSCredentials class instead.

  • The following obsolete classes have been removed from the namespace: EnvironmentVariableAWSEndpointDiscoveryEnabled, ProfileAWSEndpointDiscoveryEnabled, and FallbackEndpointDiscoveryEnabledFactory.

  • The obsolete UseSigV4 property has been removed from the AmazonWebServiceRequest class. Use the SignatureVersion property instead.

  • The ProfileIniFile class in the Amazon.Runtime.Internal.Util namespace has an overloaded method called TryGetSection. The versions of the method that don't support the out parameter for nestedProperties have been removed from the class.

  • The obsolete EventBridgeSigner class in the Amazon.Runtime.Internal.Auth namespace has been removed.

  • The obsolete Parameters dictionary property has been removed from the WebServiceRequestEventArgs class. Use the ParameteCollection property instead.

BouncyCastle

The source copy of BouncyCastle has been removed from V4 of the SDK.

The StoredProfileSAMLCredentials class

The obsolete StoredProfileSAMLCredentials class in the Amazon.SecurityToken.SAML namespace has been removed. Use the FederatedAWSCredentials class in the Amazon.Runtime namespace instead.

The AWSSDKUtils class

The following methods have been removed from the AWSSDKUtils class: ResolveResourcePath, ProtectEncodedSlashUrlEncode, and ConvertToUnixEpochMilliSeconds.

The ProfileManager class

The obsolete ProfileManager class has been removed from the Amazon.Util namespace. Use the NetSDKCredentialsFile or SharedCredentialsFile class from the Amazon.Runtime.CredentialManagement namespace instead.

The AWSConfigs class

The following obsolete properties have been removed from the AWSConfigs class: Logging, ResponseLogging, and LogMetrics. Use the LoggingConfig property instead.

The ConditionFactory class

The method with the following signature has been removed from the ConditionFactory class: NewCondition(ConditionFactory.DateComparisonType, DateTime). Use the NewConditionUtc method instead.

Amazon CloudFront utilities

The obsolete Amazon.CloudFront.Util namespace and AmazonCloudFrontUtil class have been removed.

AWS IoT

In the ListPrincipalThingsResponse class, a legacy customization for a NextToken override has been removed in favor of pagination.

AWS Lambda

The following Invoke... methods of the AmazonLambdaClient class have been removed because the names were confusing.

  • The V3 method with the following signature has been removed: InvokeAsyncResponse InvokeAsync(InvokeAsyncRequest). This is a synchronous method in V3 of the SDK. Use InvokeResponse Invoke(InvokeRequest) (for synchronous processing) or Task InvokeAsync(InvokeRequest, CancellationToken) (for asynchronous processing) instead.

  • The V3 method with the following signature has been removed: Task InvokeAsyncAsync(InvokeAsyncRequest, CancellationToken). This is an asynchronous method in V3 of the SDK. Use Task InvokeAsync(InvokeRequest, CancellationToken) instead.

Amazon SageMaker Runtime

Obsolete constructors for the PayloadPart class have been removed.

The Amazon.Auth.AccessControlPolicy.ActionIdentifiers namespace

The Amazon.Auth.AccessControlPolicy.ActionIdentifiers namespace has been removed. This includes IAM action identifiers, which were defined in the IdentityandAccessManagementActionIdentifiers class. Code that uses these action identifiers should be changed to use string values of the action name.

For additional information, see Creating IAM managed policies from JSON and Overview of JSON policies in the IAM User Guide.

The ClientConfig class

The Amazon.Runtime.ClientConfig class is the base class of service client configuration classes like AmazonS3Config. The following programming elements have been removed from this class.

  • The DetermineServiceURL and DetermineDnsSuffix methods have been removed. Use the DetermineServiceOperationEndpoint method of the service client instead; for example, AmazonS3Client.DetermineServiceOperationEndpoint.

  • The ReadEntireResponse property has been removed. Use one of the following instead:

The Amazon.Runtime namespace

The Amazon.Runtime namespace was updated as follows:

  • The obsolete ECSTaskCredentials class has been removed from the namespace. Use the GenericContainerCredentials provider instead, which also supports Amazon EKS Pod Identities.

  • The obsolete StoredProfileAWSCredentials and StoredProfileCredentials classes have been removed from the namespace. Use the NetSDKCredentialsFile or the SharedCredentialsFile class of the Amazon.Runtime.CredentialManagement namespace instead.

  • The obsolete HasCachedAccessTokenAvailable method of the SSOAWSCredentials class has been removed from the namespace.

  • The obsolete EnvironmentAWSCredentials class has been removed from the namespace. Use the AppConfigAWSCredentials class instead.

  • The obsolete StoredProfileFederatedCredentials class has been removed from the namespace. Use the FederatedAWSCredentials class instead.

  • The following obsolete classes have been removed from the namespace: EnvironmentVariableAWSEndpointDiscoveryEnabled, ProfileAWSEndpointDiscoveryEnabled, and FallbackEndpointDiscoveryEnabledFactory.

  • The obsolete UseSigV4 property has been removed from the AmazonWebServiceRequest class. Use the SignatureVersion property instead.

  • The ProfileIniFile class in the Amazon.Runtime.Internal.Util namespace has an overloaded method called TryGetSection. The versions of the method that don't support the out parameter for nestedProperties have been removed from the class.

  • The obsolete EventBridgeSigner class in the Amazon.Runtime.Internal.Auth namespace has been removed.

  • The obsolete Parameters dictionary property has been removed from the WebServiceRequestEventArgs class. Use the ParameteCollection property instead.

BouncyCastle

The source copy of BouncyCastle has been removed from V4 of the SDK.

The StoredProfileSAMLCredentials class

The obsolete StoredProfileSAMLCredentials class in the Amazon.SecurityToken.SAML namespace has been removed. Use the FederatedAWSCredentials class in the Amazon.Runtime namespace instead.

The AWSSDKUtils class

The following methods have been removed from the AWSSDKUtils class: ResolveResourcePath, ProtectEncodedSlashUrlEncode, and ConvertToUnixEpochMilliSeconds.

The ProfileManager class

The obsolete ProfileManager class has been removed from the Amazon.Util namespace. Use the NetSDKCredentialsFile or SharedCredentialsFile class from the Amazon.Runtime.CredentialManagement namespace instead.

The AWSConfigs class

The following obsolete properties have been removed from the AWSConfigs class: Logging, ResponseLogging, and LogMetrics. Use the LoggingConfig property instead.

The ConditionFactory class

The method with the following signature has been removed from the ConditionFactory class: NewCondition(ConditionFactory.DateComparisonType, DateTime). Use the NewConditionUtc method instead.

Amazon CloudFront utilities

The obsolete Amazon.CloudFront.Util namespace and AmazonCloudFrontUtil class have been removed.

AWS IoT

In the ListPrincipalThingsResponse class, a legacy customization for a NextToken override has been removed in favor of pagination.

AWS Lambda

The following Invoke... methods of the AmazonLambdaClient class have been removed because the names were confusing.

  • The V3 method with the following signature has been removed: InvokeAsyncResponse InvokeAsync(InvokeAsyncRequest). This is a synchronous method in V3 of the SDK. Use InvokeResponse Invoke(InvokeRequest) (for synchronous processing) or Task InvokeAsync(InvokeRequest, CancellationToken) (for asynchronous processing) instead.

  • The V3 method with the following signature has been removed: Task InvokeAsyncAsync(InvokeAsyncRequest, CancellationToken). This is an asynchronous method in V3 of the SDK. Use Task InvokeAsync(InvokeRequest, CancellationToken) instead.

Amazon SageMaker Runtime

Obsolete constructors for the PayloadPart class have been removed.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.