Releases: awslabs/aws-sdk-rust
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.
v0.13.0 (June 9th, 2022)
New this release:
- 🎉 (smithy-rs#1390) Add method
ByteStream::into_async_read
. This makes it easy to convertByteStream
s into a struct implementingtokio:io::AsyncRead
. Available on crate featurert-tokio
only. - 🎉 (smithy-rs#1356, @jszwedko) Add support for
credential_process
in AWS configs for fetching credentials from an external process. - (smithy-rs#1404, @petrosagg) Switch to RustCrypto's implementation of MD5.
Contributors
Thank you for your contributions! ❤
v0.12.0 (May 13th, 2022)
New this release:
- (smithy-rs#1352) Log a debug event when a retry is going to be peformed
v0.11.0 (April 28th 2022)
Breaking Changes:
- ⚠ (smithy-rs#1318) Bump MSRV from 1.56.1 to 1.58.1 per our "two versions behind" policy.
New this release:
- 🐛 (smithy-rs#1344, @ryansb) Suppress irrelevant
$HOME
expansion warning when running in a Lambda Extension
Contributors
Thank you for your contributions! ❤
0.10.1 (April 14th, 2022)
Breaking Changes:
- ⚠ (aws-sdk-rust#490) Update all SDK and runtime crates to edition 2021
New this release:
- (smithy-rs#1262, @liubin) Fix link to Developer Guide in crate's README.md
- 🐛 (smithy-rs#1271, @elrob) Treat blank environment variable credentials (
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
) as missing instead of attempting to use them to sign requests. - (aws-sdk-rust#479, smithy-rs#1296) Add support for configuring the session length in AssumeRoleProvider
- (smithy-rs#1296) Add caching to AssumeRoleProvider
- (smithy-rs#1300, @benesch) Add endpoint resolver to SdkConfig. This enables overriding the endpoint resolver for all services build from a single SdkConfig.
Contributors
Thank you for your contributions! ❤
0.9.0 (March 17, 2022)
Breaking Changes:
-
⚠ (aws-sdk-rust#406)
aws_types::config::Config
has been renamed toaws_types::sdk_config::SdkConfig
. This is to better differentiate it
from service-specific configs likeaws_sdk_s3::Config
. If you were creating shared configs with
aws_config::load_from_env()
, then you don't have to do anything. If you were directly referring to a shared config,
update youruse
statements andstruct
names.Before:
use aws_types::config::Config; fn main() { let config = Config::builder() // config builder methods... .build() .await; }
After:
// We re-export this type from the root module so it's easier to reference use aws_types::SdkConfig; fn main() { let config = SdkConfig::builder() // config builder methods... .build() .await; }
-
⚠ (smithy-rs#724) Timeout configuration has been refactored a bit. If you were setting timeouts through environment variables or an AWS
profile, then you shouldn't need to change anything. Take note, however, that we don't currently support HTTP connect,
read, write, or TLS negotiation timeouts. If you try to set any of those timeouts in your profile or environment, we'll
log a warning explaining that those timeouts don't currently do anything.If you were using timeouts programmatically,
you'll need to update your code. In previous versions, timeout configuration was stored in a singleTimeoutConfig
struct. In this new version, timeouts have been broken up into several different config structs that are then collected
in atimeout::Config
struct. As an example, to get the API per-attempt timeout in previous versions you would access
it with<your TimeoutConfig>.api_call_attempt_timeout()
and in this new version you would access it with
<your timeout::Config>.api.call_attempt_timeout()
. We also made some unimplemented timeouts inaccessible in order to
avoid giving users the impression that setting them had an effect. We plan to re-introduce them once they're made
functional in a future update.
New this release:
- 🎉 (aws-sdk-rust#475, aws-sdk-rust#473) Enable presigning for S3 operations UploadPart and DeleteObject
0.8.0 (Februrary 24, 2022)
Breaking Changes:
- ⚠ (smithy-rs#1216)
aws-sigv4
no longer skips thecontent-length
andcontent-type
headers when signing withSignatureLocation::QueryParams
New this release:
- 🎉 (smithy-rs#1220, aws-sdk-rust#462) Made it possible to change settings, such as load timeout, on the credential cache used by the
DefaultCredentialsChain
. - 🐛 (smithy-rs#1197) Fixed a bug that caused clients to eventually stop retrying. The cross-request retry allowance wasn't being reimbursed upon receiving a successful response, so once this allowance reached zero, no further retries would ever be attempted.
- 🐛 (smithy-rs#1217, aws-sdk-rust#467)
ClientBuilder
helpersrustls()
andnative_tls()
now returnDynConnector
so that they once again work when constructing clients with custom middleware in the SDK. - 🐛 (smithy-rs#1216, aws-sdk-rust#466) Fixed a bug in S3 that prevented the
content-length
andcontent-type
inputs from being included in a presigned request signature. With this fix, customers can generate presigned URLs that enforcecontent-length
andcontent-type
for requests to S3.