Releases: awslabs/aws-sdk-rust
January 13th, 2023
Breaking Changes:
-
β π (smithy-rs#1784, smithy-rs#2074) Integrate Endpoints 2.0 into the Rust SDK. Endpoints 2.0 enables features like S3 virtual addressing & S3
object lambda. As part of this change, there are several breaking changes although efforts have been made to deprecate
where possible to smooth the upgrade path.aws_smithy_http::endpoint::Endpoint
and theendpoint_resolver
methods have been deprecated. In general, these usages
should be replaced with usages ofendpoint_url
instead.endpoint_url
accepts a string so anaws_smithy_http::Endpoint
does not need to be constructed. This structure and methods will be removed in a future release.- The
endpoint_resolver
method on<service>::config::Builder
now accepts a service specific endpoint resolver instead
of an implementation ofResolveAwsEndpoint
. Most users will be able to replace these usages with a usage ofendpoint_url
. ResolveAwsEndpoint
has been deprecated and will be removed in a future version of the SDK.- The SDK does not support "pseudo regions" anymore. Specifically, regions like
iam-fips
will no longer resolve to a FIPS endpoint.
-
β π (smithy-rs#1784, smithy-rs#2074) Add additional configuration parameters to
aws_sdk_s3::Config
.The launch of endpoints 2.0 includes more configuration options for S3. The default behavior for endpoint resolution has
been changed. Before, all requests hit the path-style endpoint. Going forward, all requests that can be routed to the
virtually hosted bucket will be routed there automatically.force_path_style
: Requests will now default to the virtually-hosted endpoint<bucketname>.s3.<region>.amazonaws.com
use_arn_region
: Enables this client to use an ARNβs region when constructing an endpoint instead of the clientβs configured region.accelerate
: Enables this client to use S3 Transfer Acceleration endpoints.
Note: the AWS SDK for Rust does not currently support Multi Region Access Points (MRAP).
-
β (smithy-rs#2108) Move types for AWS SDK credentials to a separate crate.
A new AWS runtime crate calledaws-credential-types
has been introduced. Types for AWS SDK credentials have been moved to that crate fromaws-config
andaws-types
. The new crate is placed at the top of the dependency graph among AWS runtime crates with the aim of the downstream crates having access to the types defined in it. -
β (smithy-rs#2162)
aws_config::profile::retry_config
&&aws_config::environment::retry_config
have been removed. Useaws_config::default_provider::retry_config
instead.
New this release:
-
π (smithy-rs#2168) Add support for resolving FIPS and dual-stack endpoints.
FIPS and dual-stack endpoints can each be configured in multiple ways:
- Automatically from the environment and AWS profile
- Across all clients loaded from the same
SdkConfig
viafrom_env().use_dual_stack(true).load().await
- At a client level when constructing the configuration for an individual client.
Note: Not all services support FIPS and dual-stack.
-
(smithy-rs#2152) Add support for overriding profile name and profile file location across all providers. Prior to this change, each provider needed to be updated individually.
Before
use aws_config::profile::{ProfileFileCredentialsProvider, ProfileFileRegionProvider}; use aws_config::profile::profile_file::{ProfileFiles, ProfileFileKind}; let profile_files = ProfileFiles::builder() .with_file(ProfileFileKind::Credentials, "some/path/to/credentials-file") .build(); let credentials_provider = ProfileFileCredentialsProvider::builder() .profile_files(profile_files.clone()) .build(); let region_provider = ProfileFileRegionProvider::builder() .profile_files(profile_files) .build(); let sdk_config = aws_config::from_env() .credentials_provider(credentials_provider) .region(region_provider) .load() .await;
After
use aws_config::profile::{ProfileFileCredentialsProvider, ProfileFileRegionProvider}; use aws_config::profile::profile_file::{ProfileFiles, ProfileFileKind}; let profile_files = ProfileFiles::builder() .with_file(ProfileFileKind::Credentials, "some/path/to/credentials-file") .build(); let sdk_config = aws_config::from_env() .profile_files(profile_files) .load() .await; /// ```
December 14th, 2022
Breaking Changes:
-
πβ (smithy-rs#1847) Support Sigv4 signature generation on PowerPC 32 and 64 bit. This architecture cannot compile
ring
, so the implementation has been updated to rely onhamc
+sha2
to achive the same result with broader platform compatibility and higher performance. We also updated the CI which is now running as many tests as possible against i686 and PowerPC 32 and 64 bit. -
β (smithy-rs#1225, smithy-rs#1918)
<service>::Client::from_conf_conn
has been removed since it's now possible to configure the connection from the
shared and service configs. To update your code, pass connections to thehttp_connector
method during config creation.Example
before:
let conf = aws_sdk_sts::Config::builder() // The builder has no defaults but setting other fields is omitted for brevity... .build(); let (server, request) = capture_request(None); let client = aws_sdk_sts::Client::from_conf_conn(conf, server);
after:
let (server, request) = capture_request(None); let conf = aws_sdk_sts::Config::builder() // The builder has no defaults but setting other fields is omitted for brevity... .http_connector(server) .build(); let client = aws_sdk_sts::Client::from_conf(conf);
-
β (smithy-rs#1935) Removed re-export of
aws_smithy_client::retry::Config
from themiddleware
module. -
β (smithy-rs#1926, smithy-rs#1819) Several breaking changes have been made to errors. See the upgrade guide for more information.
-
β (smithy-rs#1945) Generate enums that guide the users to write match expressions in a forward-compatible way.
Before this change, users could write a match expression against an enum in a non-forward-compatible way:match some_enum { SomeEnum::Variant1 => { /* ... */ }, SomeEnum::Variant2 => { /* ... */ }, Unknown(value) if value == "NewVariant" => { /* ... */ }, _ => { /* ... */ }, }
This code can handle a case for "NewVariant" with a version of SDK where the enum does not yet include
SomeEnum::NewVariant
, but breaks with another version of SDK where the enum definesSomeEnum::NewVariant
because the execution will hit a different match arm, i.e. the last one.
After this change, users are guided to write the above match expression as follows:match some_enum { SomeEnum::Variant1 => { /* ... */ }, SomeEnum::Variant2 => { /* ... */ }, other @ _ if other.as_str() == "NewVariant" => { /* ... */ }, _ => { /* ... */ }, }
This is forward-compatible because the execution will hit the second last match arm regardless of whether the enum defines
SomeEnum::NewVariant
or not. -
β (smithy-rs#1984, smithy-rs#1496) Functions on
aws_smithy_http::endpoint::Endpoint
now return aResult
instead of panicking. -
β (smithy-rs#1984, smithy-rs#1496)
Endpoint::mutable
now takesimpl AsRef<str>
instead ofUri
. For the old functionality, useEndpoint::mutable_uri
. -
β (smithy-rs#1984, smithy-rs#1496)
Endpoint::immutable
now takesimpl AsRef<str>
instead ofUri
. For the old functionality, useEndpoint::immutable_uri
. -
β (smithy-rs#1983, smithy-rs#2029) Implementation of the Debug trait for container shapes now redacts what is printed per the sensitive trait.
-
β (smithy-rs#2065)
SdkBody
callbacks have been removed. If you were using these, please file an issue so that we can better understand your use-case and provide the support you need. -
β (smithy-rs#2063)
AwsEndpointStage
, a middleware which set endpoints and auth has been split intoAwsAuthStage
andSmithyEndpointStage
. Related types have also been renamed. -
β (smithy-rs#1989) The Unit type for a Union member is no longer rendered. The serializers and parsers generated now function accordingly in the absence of the inner data associated with the Unit type.
New this release:
-
π (smithy-rs#1225, smithy-rs#1918)
The HTTP connector used when making requests is now configurable through `SdkConfig`.
use std::time::Duration; use aws_smithy_client::{Client, hyper_ext}; use aws_smithy_client::erase::DynConnector; use aws_smithy_client::http_connector::ConnectorSettings; use aws_types::SdkConfig; let https_connector = hyper_rustls::HttpsConnectorBuilder::new() .with_webpki_roots() .https_only() .enable_http1() .enable_http2() .build(); let smithy_connector = hyper_ext::Adapter::builder() // Optionally set things like timeouts as well .connector_settings( ConnectorSettings::builder() .connect_timeout(Duration::from_secs(5)) .build() ) .build(https_connector); let sdk_config = aws_config::from_env() .http_connector(smithy_connector) .load() .await; let client = Client::new(&sdk_config); // When sent, this operation will go through the custom smithy connector instead of // the default HTTP connector. let op = client .get_object() .bucket("some-test-bucket") .key("test.txt") .send() .await .unwrap();
-
π (aws-sdk-rust#641, smithy-rs#1892, @albe-rosado) Ability to add an inline policy or a list of policy ARNs to the
AssumeRoleProvider
builder. -
π (smithy-rs#2044, smithy-rs#371) Fixed and improved the request
tracing
span hierarchy to improve log messages, profiling, and debuggability. -
(smithy-rs#1890) Add test to exercise excluded headers in aws-sigv4.
-
(smithy-rs#1801) Add test ensuring that a response will error if the response body returns an EOF before the entire body has been read.
-
(smithy-rs#1923) Fix cargo audit issue on criterion.
-
(smithy-rs#1918) Add
to_vec
method toaws_smithy_http::byte_stream::AggregatedBytes
. -
π (smithy-rs#1957) It was possible in some cases to send some S3 requests without a required upload ID, causing a risk of unintended data
deletion and modification. Now, when an operation has query parameters that are marked as required, the omission of
those query parameters will cause a BuildError, preventing the invalid operation from being sent. -
π (smithy-rs#2018) Normalize URI paths per RFC3986 when constructing canonical requests, except for S3.
-
(smithy-rs#2064, aws-sdk-rust#632) The SDK clients now default max idle connections to 70 (previously unlimited) to reduce the likelihood of hitting max file handles in AWS Lambda.
-
(smithy-rs#2057, smithy-rs#371) Add more
tracing
events to signing and event streams -
(smithy-rs#2062) Log an
info
on credentials cache miss and adjust level of some credentialtracing
spans/events.
Contributors
Thank you for your contributions! β€
October 26th, 2022
Breaking Changes:
- β (smithy-rs#1825) Bump MSRV to be 1.62.0.
- β (smithy-rs#1740, smithy-rs#256) The SDK, by default, now times out if socket connect or time to first byte read takes longer than
3.1 seconds. There are a large number of breaking changes that come with this change that may
affect you if you customize the client configuration at all.
See the upgrade guide for information
on how to configure timeouts, and how to resolve compilation issues after upgrading.
New this release:
- π (aws-sdk-rust#237, smithy-rs#1770) It is now possible to programmatically customize the locations of the profile config/credentials files in
aws-config
:use aws_config::profile::{ProfileFileCredentialsProvider, ProfileFileRegionProvider}; use aws_config::profile::profile_file::{ProfileFiles, ProfileFileKind}; let profile_files = ProfileFiles::builder() .with_file(ProfileFileKind::Credentials, "some/path/to/credentials-file") .build(); let credentials_provider = ProfileFileCredentialsProvider::builder() .profile_files(profile_files.clone()) .build(); let region_provider = ProfileFileRegionProvider::builder() .profile_files(profile_files) .build(); let sdk_config = aws_config::from_env() .credentials_provider(credentials_provider) .region(region_provider) .load() .await;
- π (smithy-rs#1740, smithy-rs#256) Setting connect/read timeouts with
SdkConfig
now works. Previously, these timeout config values
were lost during connector creation, so the only reliable way to set them was to manually override
the HTTP connector. - π (aws-sdk-rust#620, smithy-rs#1748) Paginators now stop on encountering a duplicate token by default rather than panic. This behavior can be customized by toggling the
stop_on_duplicate_token
property on the paginator before callingsend
. - π (smithy-rs#1747, @kastolars) The client Config now has getters for every value that it holds.
- π (smithy-rs#1822, @kevinpark1217) Fix regression where
connect_timeout
andread_timeout
fields are unused in the IMDS client - (aws-sdk-rust#625, @kevinpark1217) Ability to override the IMDS client in
DefaultCredentialsChain
- π (smithy-rs#1656) Fix aws-sigv4 canonical request formatting fallibility.
- (smithy-rs#1890) Add test to exercise excluded headers in aws-sigv4.
Contributors
Thank you for your contributions! β€
October 13th, 2022
There were issues with release automation for this release, and it has been yanked from crates.io.
September 21st, 2022
Breaking Changes:
- β (smithy-rs#1603, aws-sdk-rust#586)
aws_config::RetryConfig
no longer implementsDefault
, and itsnew
function has been replaced withstandard
. - β (smithy-rs#1603, aws-sdk-rust#586) Direct configuration of
aws_config::SdkConfig
now defaults to retries being disabled.
If you're usingaws_config::load_from_env()
oraws_config::from_env()
to configure
the SDK, then you are NOT affected by this change. If you useSdkConfig::builder()
to
configure the SDK, then you ARE affected by this change and should set the retry config
on that builder. - β (smithy-rs#1603, aws-sdk-rust#586) Client creation now panics if retries or timeouts are enabled without an async sleep
implementation set on the SDK config.
If you're using the Tokio runtime and have thert-tokio
feature enabled (which is enabled by default),
then you shouldn't notice this change at all.
Otherwise, if using something other than Tokio as the async runtime, theAsyncSleep
trait must be implemented,
and that implementation given to the config builder via thesleep_impl
method. Alternatively, retry can be
explicitly turned off by setting the retry config toRetryConfig::disabled()
, which will result in successful
client creation without an async sleep implementation. - β (smithy-rs#1715, smithy-rs#1717)
ClassifyResponse
was renamed toClassifyRetry
and is no longer implemented for the unit type. - β (smithy-rs#1715, smithy-rs#1717) The
with_retry_policy
andretry_policy
functions onaws_smithy_http::operation::Operation
have been
renamed towith_retry_classifier
andretry_classifier
respectively. Public memberretry_policy
on
aws_smithy_http::operation::Parts
has been renamed toretry_classifier
.
New this release:
-
π (smithy-rs#1647, smithy-rs#1112) Implemented customizable operations per RFC-0017.
Before this change, modifying operations before sending them required using lower-level APIs:
let input = SomeOperationInput::builder().some_value(5).build()?; let operation = { let op = input.make_operation(&service_config).await?; let (request, response) = op.into_request_response(); let request = request.augment(|req, _props| { req.headers_mut().insert( HeaderName::from_static("x-some-header"), HeaderValue::from_static("some-value") ); Result::<_, Infallible>::Ok(req) })?; Operation::from_parts(request, response) }; let response = smithy_client.call(operation).await?;
Now, users may easily modify operations before sending with the
customize
method:let response = client.some_operation() .some_value(5) .customize() .await? .mutate_request(|mut req| { req.headers_mut().insert( HeaderName::from_static("x-some-header"), HeaderValue::from_static("some-value") ); }) .send() .await?;
-
π (smithy-rs#966, smithy-rs#1718) The AWS STS SDK now automatically retries
IDPCommunicationError
when callingAssumeRoleWithWebIdentity
-
π (aws-sdk-rust#303, smithy-rs#1717) The
SdkError::ResponseError
, typically caused by a connection terminating before the full response is received, is now treated as a transient failure and retried.
August 31st, 2022
Breaking Changes:
- β (smithy-rs#1641) Refactor endpoint resolution internals to use
aws_smithy_types::Endpoint
internally. The public internal
functionsaws_endpoint::set_endpoint_resolver
andaws_endpoint::get_endpoint_resolver
were removed. - πβ (smithy-rs#1274) Lossy converters into integer types for
aws_smithy_types::Number
have been
removed. Lossy converters into floating point types for
aws_smithy_types::Number
have been suffixed with_lossy
. If you were
directly using the integer lossy converters, we recommend you use the safe
converters.
Before:After:fn f1(n: aws_smithy_types::Number) { let foo: f32 = n.to_f32(); // Lossy conversion! let bar: u32 = n.to_u32(); // Lossy conversion! }
fn f1(n: aws_smithy_types::Number) { use std::convert::TryInto; // Unnecessary import if you're using Rust 2021 edition. let foo: f32 = n.try_into().expect("lossy conversion detected"); // Or handle the error instead of panicking. // You can still do lossy conversions, but only into floating point types. let foo: f32 = n.to_f32_lossy(); // To lossily convert into integer types, use an `as` cast directly. let bar: u32 = n as u32; // Lossy conversion! }
- β (smithy-rs#1669) Bump MSRV from 1.58.1 to 1.61.0 per our policy.
New this release:
-
π (smithy-rs#1598) Service configs are now generated with new accessors for:
Config::retry_config()
- Returns a reference to the inner retry configuration.Config::timeout_config()
- Returns a reference to the inner timeout configuration.Config::sleep_impl()
- Returns a clone of the inner async sleep implementation.
Previously, these were only accessible through
SdkConfig
. -
ππ (aws-sdk-rust#609) The AWS S3
GetObjectAttributes
operation will no longer fail with an XML error.
August 8th, 2022
Breaking Changes:
- β (smithy-rs#1157) Rename EventStreamInput to EventStreamSender
- β (smithy-rs#1157) The type of streaming unions that contain errors is generated without those errors.
Errors in a streaming unionUnion
are generated as members of the typeUnionError
.
Taking Transcribe as an example, theAudioStream
streaming union generates, in the client, both theAudioStream
type:and its error type,pub enum AudioStream { AudioEvent(crate::model::AudioEvent), Unknown, }
pub struct AudioStreamError { /// Kind of error that occurred. pub kind: AudioStreamErrorKind, /// Additional metadata about the error, including error code, message, and request ID. pub(crate) meta: aws_smithy_types::Error, }
AudioStreamErrorKind
contains all error variants for the union.
Before, the generated code looked as:pub enum AudioStream { AudioEvent(crate::model::AudioEvent), ... all error variants, Unknown, }
- β (smithy-rs#1157)
aws_smithy_http::event_stream::EventStreamSender
andaws_smithy_http::event_stream::Receiver
are now generic over<T, E>
,
whereT
is a streaming union andE
the union's errors.
This means that event stream errors are now sent asErr
of the union's error type.
With this example model:Before:@streaming union Event { throttlingError: ThrottlingError } @error("client") structure ThrottlingError {}
After:stream! { yield Ok(Event::ThrottlingError ...) }
An example from the SDK is in transcribe streaming.stream! { yield Err(EventError::ThrottlingError ...) }
New this release:
-
π (smithy-rs#1482) The AWS SDK for Rust now supports additional checksum algorithms for Amazon S3.
When getting and putting objects, you may now request that the request body be validated with a checksum. The supported
algorithms are SHA-1, SHA-256, CRC-32, and CRC-32C.#[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let sdk_config = aws_config::load_from_env().await; let s3_client = aws_sdk_s3::Client::new(&sdk_config); let body = aws_sdk_s3::types::ByteStream::read_from() .path(std::path::Path::new("./path/to/your/file.txt")) .build() .await .unwrap(); let _ = s3_client .put_object() .bucket("your-bucket") .key("file.txt") .body(body) // When using this field, the checksum will be calculated for you .checksum_algorithm(aws_sdk_s3::model::ChecksumAlgorithm::Crc32C) .send() .await?; let body = aws_sdk_s3::types::ByteStream::read_from() .path(std::path::Path::new("./path/to/your/other-file.txt")) .build() .await .unwrap(); let _ = s3_client .put_object() .bucket("your-bucket") .key("other-file.txt") .body(body) // Alternatively, you can pass a checksum that you've calculated yourself. It must be base64 // encoded. Also, make sure that you're base64 encoding the bytes of the checksum, not its // string representation. .checksum_crc32_c(aws_smithy_types::base64::encode(&A_PRECALCULATED_CRC_32_C_CHECKSUM[..])) .send() .await?; }
-
π (smithy-rs#1571, smithy-rs#1385) SDK crate READMEs now include an example of creating a client
-
(smithy-rs#1573, smithy-rs#1569) Non-streaming struct members are now marked
#[doc(hidden)]
since they will be removed in the future
July 21st, 2022
New this release:
-
π (smithy-rs#1457, @calavera) Re-export aws_types::SdkConfig in aws_config
-
π (aws-sdk-rust#581) Add
From<aws_smithy_client::erase::DynConnector>
impl foraws_smithy_client::http_connector::HttpConnector
-
π (aws-sdk-rust#567) Updated SDK Client retry behavior to allow for a configurable initial backoff. Previously, the initial backoff
(namedr
in the code) was set to 2 seconds. This is not an ideal default for services like DynamoDB that expect
clients to quickly retry failed request attempts. Now, users can set quicker (or slower) backoffs according to their
needs.#[tokio::main] async fn main() -> Result<(), aws_sdk_dynamodb::Error> { let retry_config = aws_smithy_types::retry::RetryConfigBuilder::new() .max_attempts(4) .initial_backoff(Duration::from_millis(20)); let shared_config = aws_config::from_env() .retry_config(retry_config) .load() .await; let client = aws_sdk_dynamodb::Client::new(&shared_config); // Given the 20ms backoff multiplier, and assuming this request fails 3 times before succeeding, // the first retry would take place between 0-20ms after the initial request, // the second retry would take place between 0-40ms after the first retry, // and the third retry would take place between 0-80ms after the second retry. let request = client .put_item() .table_name("users") .item("username", "Velfi") .item("account_type", "Developer") .send().await?; Ok(()) }
-
π (smithy-rs#1557, aws-sdk-rust#580) The
imds::Client
inaws-config
now implementsClone
-
π (smithy-rs#1541, @joshtriplett) Fix compilation of
aws-config
withrustls
andnative-tls
disabled. The
ProviderConfig::with_tcp_connector
method uses
aws_smithy_client::hyper_ext
, which only exists with theclient-hyper
feature enabled. Add a feature enabling that, and enable it by default. -
(smithy-rs#1263) Add support for aws-chunked content encoding. Only single-chunk encoding is supported. Multiple chunks and
chunk signing are not supported at this time. -
(smithy-rs#1540) Until now, SDK crates have all shared the exact same version numbers.
This changes with this release. From now on, SDK crates will only version
bump if they have changes. Coincidentally, they may share the same version
number for some releases since changes to the code generator will cause
a version bump in all of them, but this should not be relied upon. -
π (smithy-rs#1559, aws-sdk-rust#582) Remove warning for valid IMDS provider use-case
-
π (smithy-rs#1558, aws-sdk-rust#583) Only emit a warning about failing to expand a
~
to the home
directory in a profile file's path if that path was explicitly
set (don't emit it for the default paths) -
(smithy-rs#1556) The
sleep_impl
methods on theSdkConfig
builder are now exposed and documented.
Contributors
Thank you for your contributions! β€
v0.15.0 (June 29th, 2022)
Breaking Changes:
- β (smithy-rs#932) Replaced use of
pin-project
with equivalentpin-project-lite
. For pinned enum tuple variants and tuple structs, this
change requires that we switch to using enum struct variants and regular structs. Most of the structs and enums that
were updated had only private fields/variants and so have the same public API. However, this change does affect the
public API ofaws_smithy_http_tower::map_request::MapRequestFuture<F, E>
. TheInner
andReady
variants contained a
single value. Each have been converted to struct variants and the inner value is now accessible by theinner
field
instead of the0
field.
New this release:
- π (aws-sdk-rust#560, smithy-rs#1487) Add a trailing slash to the URI `/latest/meta-data/iam/security-credentials/ when loading credentials from IMDS
- (aws-sdk-rust#540, @jmklix) Add comments for docker settings needed when using this sdk
Contributors
Thank you for your contributions! β€
v0.14.0 (June 22nd, 2022)
New this release:
- π (aws-sdk-rust#547, smithy-rs#1458) Fix bug in profile file credential provider where a missing
default
profile lead to an unintended error. - (smithy-rs#1421) Add
Debug
implementation to several types inaws-config
- π (aws-sdk-rust#558, smithy-rs#1478) Fix bug in retry policy where user configured timeouts were not retried. With this fix, setting
with_call_attempt_timeout
will lead to a retry when retries are enabled. - π (aws-sdk-rust#554) Requests to Route53 that return
ResourceId
s often come with a prefix. When passing those IDs directly into another
request, the request would fail unless they manually stripped the prefix. Now, when making a request with a prefixed ID,
the prefix will be stripped automatically.