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

aws-cli #78

Closed
guumaster opened this issue Jun 23, 2016 · 6 comments
Closed

aws-cli #78

guumaster opened this issue Jun 23, 2016 · 6 comments
Labels

Comments

@guumaster
Copy link

guumaster commented Jun 23, 2016

Is there a way to connect aws-cli with this server?

I've tried with a docker image and npm start, but every time I get InvalidAccessKeyId error.

This is my ~/.aws/config:

[profile local]
access_key = accessKey1
secret_key = verySecretKey1
host_base = 127.0.0.1:8000
host_bucket = %(bucket).localhost:8000
signature_v2 = True
use_https = False
website_endpoint = http://127.0.0.1:8000/answertoall

And ~/.aws/credentials:

[local]
aws_access_key_id = accessKey1
aws_secret_access_key = verySecretKey1
@ghost
Copy link

ghost commented Jun 23, 2016

Hello @guumaster
We mostly have the habit of testing with aws-sdk, s3cmd, cyberduck and similar tools.
I am unsure whether we tested it with the aws-cli tool, but if there is a compatibility issue, we indeed need to dig into it.

As a first set of information to help us investigate, can you provide:

  • Are you using from source or container bundled server ? (I'd suspect from source given the command you provide)
  • git commit hash if you are using the source-based version.
  • The command you attempt to run

On our side, we'll try to reproduce it and tell you the status of the issue (bug, etc)

@ghost
Copy link

ghost commented Jun 23, 2016

Hi again, @guumaster

After a bit of investigation (and some code grepping in the pip awscli package...), I found out that the only way with aws-cli to provide a different endpoint than the standard one is to use the --endpoint-url CLI parameter, as follows:

aws --endpoint-url http://127.0.0.1:8000/ s3api create-bucket --bucket TestBucket

Given this fact, I'm guessing that the ini config you showed as .aws/config is actually more of a s3cmd configuration file, as aws-cli actually does not offer much configuration options (the commanbd aws configure only offers accessKey, secretKey, region, and output-format).

Could you try the endpoint-url option and tell me if it works for you ?

@ghost ghost self-assigned this Jun 23, 2016
@guumaster
Copy link
Author

I'm on linux and have DragonDisk or aws-cli. Both can't connect to it.

I tried that command, and it worked with minor tweaks:

$> aws --endpoint-url http://127.0.0.1:8000/ s3api create-bucket --bucket guumaster  --profile=local  #TestBucket seems to be a wrong name for aws-cli

$> aws --endpoint-url http://127.0.0.1:8000/ s3 cp README.md s3://guumaster/  --profile=local

$> aws --endpoint-url http://127.0.0.1:8000/ s3 ls s3://gustavo/ --profile=local
2016-06-23 15:25:28       1983 README.md

The --profile=local is necessary for the credentials. I'll try to add the endpoint to the config file and update this thread if I can get it right.

Thanks

@ghost
Copy link

ghost commented Jun 23, 2016

I am unsure whether you can actually set this option in the aws config file.
As for the profile option, that is because you are using a profile named "local" rather than the usual "default", which is fine, but adds to the list of traps.

Mhh the TestBucket worked for me, though, but I'll concede that it's not exactly dns compliant, so no surprise there, we might be using different versions of awscli.

I will close this issue as "invalid" (not a bug), feel free to add more information after your investigations on the config improvements.

@ghost ghost added the question label Jun 23, 2016
@ghost ghost closed this as completed Jun 23, 2016
@guumaster
Copy link
Author

Well, I couldn't find a way to save the endpoint-url on any config file, only by command line. But it works fine with that. Thanks.

@nicolas2bert
Copy link
Contributor

nicolas2bert commented Jun 23, 2016

Hey @guumaster ,
For now, with aws-cli, there is no way to specify an endpoint URL in your ~/.aws/config file
Open issue aws-cli : https://github.com/aws/aws-cli/issues/1270
@DavidPineauScality 's solution is the best one so far.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants