Skip to content

Conversation

@andrewharvey
Copy link
Contributor

up to you if you want to accept this, and I'm not even sure if it's the correct approach, but I found I needed to do this in order to do authentication via environment variables.

For the endpoint, I don't think it's possible to set this via an AWS profile so as far as I can tell this is the only way when trying to use an S3-compatible object storage not from Amazon.

@rowanwins
Copy link
Owner

Ah the joys of AWS credentials, far from my strong suite :)

In my bash_profile I have

export AWS_SDK_LOAD_CONFIG=1
export AWS_SHARED_CREDENTIALS_FILE=$HOME/.aws/credentials
export AWS_CONFIG_FILE=$HOME/.aws/config

If I'm using my default credentials I don't have to add any ENV's to run the cli.

That said your PR aligns with the doco here so think I'm happy to merge.

@andrewharvey
Copy link
Contributor Author

I think using the AWS credentials is fine, but when this is used on a CI environment setting environments can be a bit easier then setting up the credentials file. (also part of the reason behind my --force PR, when run in a scripted environment, you can't prompt the user to input)

That said your PR aligns with the doco here so think I'm happy to merge.

Actually after reading https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-environment.html I might be able to exclude the key and secret key since it seems they are automatically picked up. I'll test without them before we go ahead.

@andrewharvey
Copy link
Contributor Author

Actually after reading https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-environment.html I might be able to exclude the key and secret key since it seems they are automatically picked up. I'll test without them before we go ahead.

Seems these are indeed picked up automatically, but the endpoint one isn't and needs to be set.

@rowanwins
Copy link
Owner

Can you give an example of what AWS_S3_ENDPOINT might be set to? And is it worth adding something to the docs?

@andrewharvey
Copy link
Contributor Author

Can you give an example of what AWS_S3_ENDPOINT might be set to?

export AWS_S3_ENDPOINT=s3.us-west-000.backblazeb2.com
export AWS_S3_ENDPOINT=https://sgp1.digitaloceanspaces.com

And is it worth adding something to the docs?

I guess I could do that.

@andrewharvey
Copy link
Contributor Author

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants