Skip to content
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

docs(localstack): fix localstack example by setting force_path_style #132

Merged
merged 2 commits into from
May 10, 2024

Conversation

neilyio
Copy link
Contributor

@neilyio neilyio commented May 10, 2024

Closes #131, where I discovered the localstack example is broken when running:

cargo run --example localstack --features="localstack" 

Some research brought me to awslabs/aws-sdk-rust#1138, which uncovered that create_bucket is broken here because localstack uses the soon-to-be-deprecated "path-style" address style rather than the newer "virutal-hosted" style.

I reworked the configuration in the example to set force_path_style(true), which fixes create_bucket. The example now runs successfully.

I also updated the BehaviorVersion, because the currently referenced one is now deprecated and was causing a warning.

@DDtKey DDtKey changed the title fix: update behaviorversion and force_path_style in localstack example docs(localstack): fix localstack example by setting force_path_style May 10, 2024
.region(region_provider)

let config = aws_sdk_s3::config::Builder::default()
.behavior_version(BehaviorVersion::v2024_03_28())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one, in fact - not required change, because depends on your Cargo.lock (e.g - I have aws-smithy-runtime 1.1.6 in it - where v2024_03_28 doesn't present, and it corresponds to minimal versions declared in Cargo.toml).

But let's keep it, since it's more fresh version

@DDtKey
Copy link
Contributor

DDtKey commented May 10, 2024

Thank you for the contribution! 🙏

@DDtKey DDtKey merged commit 06efbb0 into testcontainers:main May 10, 2024
6 checks passed
@neilyio neilyio deleted the neil/localstack-example-fix branch May 10, 2024 20:12
@github-actions github-actions bot mentioned this pull request May 12, 2024
DDtKey pushed a commit that referenced this pull request May 12, 2024
## 🤖 New release
* `testcontainers-modules`: 0.4.2 -> 0.4.3 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

## [0.4.3] - 2024-05-12

### Documentation

- Fix localstack example by setting `force_path_style`
([#132](#132))

### Features

- Add kwok module
([#121](#121))
- K3s module
([#129](#129))

<!-- generated by git-cliff -->
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error running localstack example ("failed to look up address information")
2 participants