|
1 | 1 | package org.testcontainers.containers.localstack; |
2 | 2 |
|
3 | | -import com.amazonaws.auth.AWSCredentialsProvider; |
4 | | -import com.amazonaws.auth.AWSStaticCredentialsProvider; |
5 | | -import com.amazonaws.auth.BasicAWSCredentials; |
6 | | -import com.amazonaws.client.builder.AwsClientBuilder; |
7 | 3 | import lombok.Getter; |
8 | 4 | import lombok.RequiredArgsConstructor; |
9 | 5 | import lombok.experimental.FieldDefaults; |
@@ -201,38 +197,6 @@ public LocalStackContainer withServices(EnabledService... services) { |
201 | 197 | return self(); |
202 | 198 | } |
203 | 199 |
|
204 | | - /** |
205 | | - * Provides an endpoint configuration that is preconfigured to communicate with a given simulated service. |
206 | | - * The provided endpoint configuration should be set in the AWS Java SDK when building a client, e.g.: |
207 | | - * <pre><code>AmazonS3 s3 = AmazonS3ClientBuilder |
208 | | - .standard() |
209 | | - .withEndpointConfiguration(localstack.getEndpointConfiguration(S3)) |
210 | | - .withCredentials(localstack.getDefaultCredentialsProvider()) |
211 | | - .build(); |
212 | | - </code></pre> |
213 | | - * or for AWS SDK v2 |
214 | | - * <pre><code>S3Client s3 = S3Client |
215 | | - .builder() |
216 | | - .endpointOverride(localstack.getEndpointOverride(LocalStackContainer.Service.S3)) |
217 | | - .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create( |
218 | | - localstack.getAccessKey(), localstack.getSecretKey() |
219 | | - ))) |
220 | | - .region(Region.of(localstack.getRegion())) |
221 | | - .build() |
222 | | - </code></pre> |
223 | | - * <p><strong>Please note that this method is only intended to be used for configuring AWS SDK clients |
224 | | - * that are running on the test host. If other containers need to call this one, they should be configured |
225 | | - * specifically to do so using a Docker network and appropriate addressing.</strong></p> |
226 | | - * |
227 | | - * @param service the service that is to be accessed |
228 | | - * @return an {@link AwsClientBuilder.EndpointConfiguration} |
229 | | - * @deprecated {@link LocalStackContainer} will not depend on aws sdk. |
230 | | - */ |
231 | | - @Deprecated |
232 | | - public AwsClientBuilder.EndpointConfiguration getEndpointConfiguration(Service service) { |
233 | | - return new AwsClientBuilder.EndpointConfiguration(getEndpointOverride(service).toString(), getRegion()); |
234 | | - } |
235 | | - |
236 | 200 | public URI getEndpointOverride(Service service) { |
237 | 201 | return getEndpointOverride((EnabledService) service); |
238 | 202 | } |
@@ -272,33 +236,6 @@ private int getServicePort(EnabledService service) { |
272 | 236 | return legacyMode ? service.getPort() : PORT; |
273 | 237 | } |
274 | 238 |
|
275 | | - /** |
276 | | - * Provides a {@link AWSCredentialsProvider} that is preconfigured to communicate with a given simulated service. |
277 | | - * The credentials provider should be set in the AWS Java SDK when building a client, e.g.: |
278 | | - * <pre><code>AmazonS3 s3 = AmazonS3ClientBuilder |
279 | | - .standard() |
280 | | - .withEndpointConfiguration(localstack.getEndpointConfiguration(S3)) |
281 | | - .withCredentials(localstack.getDefaultCredentialsProvider()) |
282 | | - .build(); |
283 | | - </code></pre> |
284 | | - * or for AWS SDK v2 you can use {@link #getAccessKey()}, {@link #getSecretKey()} directly: |
285 | | - * <pre><code>S3Client s3 = S3Client |
286 | | - .builder() |
287 | | - .endpointOverride(localstack.getEndpointOverride(LocalStackContainer.Service.S3)) |
288 | | - .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create( |
289 | | - localstack.getAccessKey(), localstack.getSecretKey() |
290 | | - ))) |
291 | | - .region(Region.of(localstack.getRegion())) |
292 | | - .build() |
293 | | - </code></pre> |
294 | | - * @return an {@link AWSCredentialsProvider} |
295 | | - * @deprecated {@link LocalStackContainer} will not depend on aws sdk. |
296 | | - */ |
297 | | - @Deprecated |
298 | | - public AWSCredentialsProvider getDefaultCredentialsProvider() { |
299 | | - return new AWSStaticCredentialsProvider(new BasicAWSCredentials(getAccessKey(), getSecretKey())); |
300 | | - } |
301 | | - |
302 | 239 | /** |
303 | 240 | * Provides a default access key that is preconfigured to communicate with a given simulated service. |
304 | 241 | * The access key can be used to construct AWS SDK v2 clients: |
|
0 commit comments