Comments (6)
Thanks for sharing a working example. getEndpointOverride(LocalStackContainer.Service.S3)
is not needed with recent LocalStack and Testcontainers versions, instead use getMappedPort(4566)
.
I think the best place to add this information is https://docs.localstack.cloud/user-guide/integrations/testcontainers/ sending a PR to LocalStack docs repository because it is a useful information for all Testcontainers modules.
I'm reopening the issue and wait for LocalStack team on this.
from testcontainers-java.
Hi, please check this comment in LocalStack. So, in order to add the valid certificate and accept localhost or 127.0.0.1, you should follow this guide. For what I see, Testcontainers API already provides everything to make this happen
from testcontainers-java.
@eddumelendez I dug into this a bit deeper and actually localstack https already works without any configuration changes. The only issue I see with TestContainers it test containers doesn't make it easy to discover the https endpoint since org.testcontainers.containers.localstack.LocalStackContainer.getEndpointOverride(EnabledService)
hard codes http and doesn't use the localstack.cloud
urls. So, it would be nice if LocalStackContainer made it easier to discover and use the https endpoint. This sample code works for me for S3:
s3Client =
S3Client.builder()
.credentialsProvider(awsCredentialsProvider)
.region(Region.of(LOCAL_STACK.getRegion()))
.endpointOverride(
URI.create(
"https://s3.localhost.localstack.cloud:"
+ LOCAL_STACK
.getEndpointOverride(LocalStackContainer.Service.S3)
.getPort()))
.build();
from testcontainers-java.
Hello, just chiming in here, but AWS S3 still supports HTTP:
$ % curl -v http://s3.amazonaws.com/<bucket-name>/test.txt
* Trying 52.217.105.54:80...
* Connected to s3.amazonaws.com (52.217.105.54) port 80 (#0)
> GET /<bucket-name>/test.txt HTTP/1.1
> Host: s3.amazonaws.com
> User-Agent: curl/8.1.2
> Accept: */*
>
< HTTP/1.1 200 OK
< x-amz-id-2: OaOOtJDvnS4NATj47JDgU488Pgd0OiN7r9dmnv57tUUAqkHnriBjDt/S9s85rfzInNqkNfi/tn4=
< x-amz-request-id: G6DPR9XJZ7HDCM2H
< Date: Wed, 06 Dec 2023 09:53:11 GMT
< Last-Modified: Wed, 06 Dec 2023 09:51:42 GMT
< ETag: "2ca44c915180271304dc38eece525ac4"
< x-amz-server-side-encryption: AES256
< Accept-Ranges: bytes
< Content-Type: binary/octet-stream
< Server: AmazonS3
< Content-Length: 570
So I believe the AWS Java SDK team should still fix the issue above as it could affect real S3 users (not sure how the SDK handles the case when the bucket has .
in the name, as it won't support HTTPS when using virtual hosted requests due to SSL certs not matching with a bucket like this test.dot.name.s3.amazonaws.com
).
from testcontainers-java.
Thanks for the input @bentsku !
from testcontainers-java.
I agree. For the record here is the issue I created for the aws-sdk aws/aws-sdk-java-v2#4746
from testcontainers-java.
Related Issues (20)
- [Bug]: Many custom variables do not take effect when using custom configurations HOT 1
- [Bug]: JDBC host-less URI (///) are not parsed correctly
- [Feature]: Add consumer for logging into file
- [Bug]: Containers not shut down between tests when using .withReuse(true) but env. does not support reuse HOT 2
- [Bug]: CosmosDBEmulatorContainer 'EOFException: SSL peer shut down incorrectly' when building keystore HOT 8
- [Bug]: Vulnerable dependency commons-compress 1.24.0 HOT 3
- [Enhancement]: Add OpenFGAContainer
- [Bug]: Building a container when running inside another one with mounted socket is not possible
- [Feature]: Document and provide tooling for running testcontainers from windows (ie: intellij) using docker ce on wsl without desktop
- [Enhancement]: use official kafka image HOT 3
- [Enhancement]: clickhouse should be supported by r2dbc
- [Enhancement]: Proposal to Upgrade Alpine Version in DockerClientFactory.java due to Impending EOL
- [Bug]: Cannot run redpanda testcontainer with podman HOT 1
- [Bug]: Can't connect to Ryuk possibly due to some strange docker network interaction.
- [Bug]: Unexpected exit of vnc-recorder when closing pop-ups on MacOS
- [Bug]: Docker Image Pulls Have No Interval between failed attempts
- [Bug]: DockerComposeContainer: Stop exception when variable substitution is used in compose file HOT 1
- [Enhancement]: Support new Weaviate container registry
- [Enhancement]: Support TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE to be read from ~/.testcontainers.properties
- [Bug]: Race condition between DB init and test executions from JdbcDatabaseContainer based containers HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from testcontainers-java.