Skip to content

Commit

Permalink
Update aws testcontainer to make it compatible with testcontainers_ve…
Browse files Browse the repository at this point in the history
…rsion = "1.19.7" (#31531)
  • Loading branch information
bzablocki authored Jun 10, 2024
1 parent eda6a39 commit d01c24c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ class BeamModulePlugin implements Plugin<Project> {
def spark2_version = "2.4.8"
def spark3_version = "3.2.2"
def spotbugs_version = "4.0.6"
def testcontainers_version = "1.17.3"
def testcontainers_version = "1.19.7"
// [bomupgrader] determined by: org.apache.arrow:arrow-memory-core, consistent with: google_cloud_platform_libraries_bom
def arrow_version = "15.0.2"
def jmh_version = "1.34"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import static org.apache.beam.sdk.testing.TestPipeline.testingPipelineOptions;
import static org.testcontainers.containers.localstack.LocalStackContainer.Service.S3;

import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration;
import org.apache.beam.sdk.io.aws.options.AwsOptions;
Expand Down Expand Up @@ -139,6 +141,8 @@ private void startLocalstack() {
options.setAwsServiceEndpoint(
localstack.getEndpointOverride(S3).toString()); // service irrelevant
options.setAwsRegion(localstack.getRegion());
options.setAwsCredentialsProvider(localstack.getDefaultCredentialsProvider());
options.setAwsCredentialsProvider(
new AWSStaticCredentialsProvider(
new BasicAWSCredentials(localstack.getAccessKey(), localstack.getSecretKey())));
}
}

0 comments on commit d01c24c

Please sign in to comment.