Skip to content

Commit

Permalink
Destination Snowflake: correct files and format (airbytehq#9529)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosmarxm authored Jan 15, 2022
1 parent 103c224 commit 64f127f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

package io.airbyte.integrations.destination.s3;

import com.amazonaws.auth.InstanceProfileCredentialsProvider;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.auth.InstanceProfileCredentialsProvider;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
Expand Down Expand Up @@ -129,17 +129,17 @@ public S3FormatConfig getFormatConfig() {
public AmazonS3 getS3Client() {
final AWSCredentials awsCreds = new BasicAWSCredentials(accessKeyId, secretAccessKey);

if (accessKeyId.isEmpty() && !secretAccessKey.isEmpty()
|| !accessKeyId.isEmpty() && secretAccessKey.isEmpty()) {
if (accessKeyId.isEmpty() && !secretAccessKey.isEmpty()
|| !accessKeyId.isEmpty() && secretAccessKey.isEmpty()) {
throw new RuntimeException("Either both accessKeyId and secretAccessKey should be provided, or neither");
}

if (accessKeyId.isEmpty() && secretAccessKey.isEmpty()) {
return AmazonS3ClientBuilder.standard()
.withCredentials(new InstanceProfileCredentialsProvider(false))
.build();
}
.withCredentials(new InstanceProfileCredentialsProvider(false))
.build();
}

else if (endpoint == null || endpoint.isEmpty()) {
return AmazonS3ClientBuilder.standard()
.withCredentials(new AWSStaticCredentialsProvider(awsCreds))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,19 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableMap;
import io.airbyte.commons.io.IOs;
import io.airbyte.commons.jackson.MoreMappers;
import io.airbyte.commons.json.Jsons;
import io.airbyte.commons.resources.MoreResources;
import io.airbyte.db.jdbc.JdbcDatabase;
import io.airbyte.integrations.base.AirbyteMessageConsumer;
import io.airbyte.integrations.base.Destination;
<<<<<<< HEAD
import io.airbyte.protocol.models.AirbyteMessage;
import io.airbyte.protocol.models.AirbyteRecordMessage;
import io.airbyte.protocol.models.CatalogHelpers;
import io.airbyte.protocol.models.ConfiguredAirbyteCatalog;
import io.airbyte.protocol.models.DestinationSyncMode;
import io.airbyte.protocol.models.Field;
import io.airbyte.protocol.models.JsonSchemaPrimitive;
=======
import io.airbyte.protocol.models.*;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

>>>>>>> master
import java.nio.file.Path;
import java.sql.SQLException;
import java.time.Instant;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"schema": "AIRBYTE_SCHEMA",
"username": "AIRBYTE_INTEGRATION_TEST",
"password": "testPass"
}
}

0 comments on commit 64f127f

Please sign in to comment.