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

destination-s3 use instanceprofile if credentials are not provided #9399

Merged
merged 18 commits into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ public S3FormatConfig getFormatConfig() {
public AmazonS3 getS3Client() {
final AWSCredentials awsCreds = new BasicAWSCredentials(accessKeyId, secretAccessKey);

if (accessKeyId == null && secretAccessKey == null || accessKeyId.isEmpty() && secretAccessKey.isEmpty()) {
if (accessKeyId.isEmpty() && !secretAccessKey.isEmpty()
|| !accessKeyId.isEmpty() && secretAccessKey.isEmpty()) {
throw new RuntimeException("Either both accessKeyId and secretAccessKey are provided, or none");
}

if (accessKeyId.isEmpty() && secretAccessKey.isEmpty()) {
return AmazonS3ClientBuilder.standard()
.withCredentials(new InstanceProfileCredentialsProvider(false))
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@
},
"access_key_id": {
"type": "string",
"description": "The access key id to access the S3 bucket. Airbyte requires Read and Write permissions to the given bucket, if not set, Airbyte will rely on Instance Profile",
"description": "The access key id to access the S3 bucket. Airbyte requires Read and Write permissions to the given bucket, if not set, Airbyte will rely on Instance Profile.",
"title": "S3 Key Id",
"airbyte_secret": true,
"examples": ["A012345678910EXAMPLE"]
},
"secret_access_key": {
"type": "string",
"description": "The corresponding secret to the access key id.",
"description": "The corresponding secret to the access key id, if S3 Key Id is set, then S3 Access Key must also be provided",
"title": "S3 Access Key",
"airbyte_secret": true,
"examples": ["a012345678910ABCDEFGH/AbCdEfGhEXAMPLEKEY"]
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/destinations/s3.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Under the hood, an Airbyte data stream in Json schema is first converted to an A
#### Requirements

1. Allow connections from Airbyte server to your AWS S3/ Minio S3 cluster \(if they exist in separate VPCs\).
2. An S3 bucket with credentials or a instanceprofile with read/write permissions configured for the host(ec2, eks).
2. An S3 bucket with credentials or an instanceprofile with read/write permissions configured for the host (ec2, eks).

#### Setup Guide

Expand Down