1

On my Ubuntu 18.04.02 LTS I have docker, docker-machine and docker-compose:

Docker version 18.06.1-ce, build e68fc7a
docker-machine version 0.15.0, build b48dc28
docker-compose version 1.22.0, build unknown

I am following the testdriven.io microservices tutorials but I am stuck at part one - deployment. Unfortunately, it does not offer any help setting up the AWS part.

I have created an .aws/credentials file in the home folder of the user I am using by using the aws configure command and this worked.

But when running the command docker-machine create --driver amazonec2 testdriven-prod I get the following error:

Error setting machine configuration from flags provided: amazonec2 driver requires AWS credentials configured with the --amazonec2-access-key and --amazonec2-secret-key options, environment variables, ~/.aws/credentials, or an instance role

Everything seems to work when using the command line parameters but I think I should be able to use the credentials file as well.

I have regenerated the credentials a couple of times and the credentials file as well but to no avail.

Sdev@udev01:~$ ls .aws
config  credentials
dev@dev01:~$ docker-machine create --driver amazonec2 testdriven-prod
Error setting machine configuration from flags provided: amazonec2 driver requires AWS credentials configured with the --amazonec2-access-key and --amazonec2-secret-key options, environment variables, ~/.aws/credentials, or an instance role
Iurii Tkachenko
  • 3,106
  • 29
  • 34
RKW
  • 11
  • 2
  • What is the name of your profile inside of your ~/.aws/credentials file? You might need to define the profile name as an environment variable, e.g. your profile is [default] so set AWS_PROFILE=default – tedsmitt Jun 14 '19 at 11:56
  • [default] aws_access_key_id = AKxxxxxxxxxxxxxxxxxx aws_secret_access_key = xxxxxxxxxxxxxxxxxxxxx After adding the AWS_PROFILE environmental variable it still does not work env AWS_PROFILE=default – RKW Jun 14 '19 at 12:11
  • Ok, found out what was the issue, I was using the snap docker-machine installation and it seems that it was not able to find the credentials file, the certificate to connect to ssh to the server (when I added the path manually this seemed to work) when creating a docker-machine instance on amazonec2 with the credentials provided in the command. I removed all snap / docker related things and installed manually, after that, everything worked as it should! – RKW Aug 22 '19 at 09:03

0 Answers0