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

Amazon S3 needs credentials in the configuration #23

Closed
adlecluse opened this issue Aug 9, 2019 · 0 comments
Closed

Amazon S3 needs credentials in the configuration #23

adlecluse opened this issue Aug 9, 2019 · 0 comments

Comments

@adlecluse
Copy link
Contributor

adlecluse commented Aug 9, 2019

Hi

While using the Amazon S3 functionality I came across following error

NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors

I'm not sure what the best solution for this is, but when I include some credentials in the aws.Config object it works. But the NewAmazonS3Backend function has no parameter to pass credentials.

func NewAmazonS3Backend(bucket string, prefix string, region string, endpoint string, sse string) *AmazonS3Backend {
	service := s3.New(session.New(), &aws.Config{
		Credentials:      credentials.NewStaticCredentials("foo", "foo", ""), // <-- adding this fixes my issue
		Region:                        aws.String(region),
		Endpoint:                      aws.String(endpoint),
		DisableSSL:                    aws.Bool(strings.HasPrefix(endpoint, "http://")),
		S3ForcePathStyle:              aws.Bool(endpoint != ""),
	})
...

I think it should also be able to pass credentials to the function?
Or what steps should I take to have this implemented. I'm a newbie in Amazon related stuff and as there a multiple ways of creating credentials to connect to S3, I'm not sure what the best way is to fix this in a quite general way.

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

No branches or pull requests

1 participant