0

I am trying to use google cloud vision api, I am trying to use the label detection in order to retrieve the tags of images.

First of all, I want to send http request to the api locally to see that all its ok. In the end I would like to deploy my application to AWS EC2.

My question is: if there is any problem to use vision api if I am using AWS EC2?

I am asking that because I am a little bit confuse what to do with the authentication of vision api, I mean that as I see in vision api documentation there are some ways to authenticate my application, I followed the instructions in the documentation and set the credentials in google cloud console and did like this:

" The environment variable GOOGLE_APPLICATION_CREDENTIALS is checked. If this variable is specified it should point to a file that defines the credentials. The simplest way to get a credential for this purpose is to create a Service account key in the Google API Console:

  1. Go to the API Console Credentials page.
  2. From the project drop-down, select your project.
  3. On the Credentials page, select the Create credentials drop-down, then select Service account key.
  4. From the Service account drop-down, select an existing service account or create a new one.
  5. For Key type, select the JSON key option, then select Create. The file automatically downloads to your computer.
  6. Put the *.json file you just downloaded in a directory of your choosing. This directory must be private (you can't let anyone get access to this), but accessible to your web server code.
  7. Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of the JSON file downloaded. "

This is the right thing to do in my case?

Thanks very much!

Brendan
  • 1,017
  • 5
  • 7
Arnon nir
  • 3
  • 1
  • 5
  • I forgot to mention that I would like to use the api in my server that in node.js. thanks :) – Arnon nir Aug 12 '16 at 09:25
  • I don't see any reason you wouldn't be able to copy the credentials file to your EC2 server and run the software there. EC2 servers are just virtual Linux and Windows machines. You can typically run any software on EC2 that you can run on other Linux and Windows servers. – Mark B Aug 13 '16 at 19:45

1 Answers1

0

Yes that works. You can call Vision API from anywhere if you have your service account or api key. In your case, put the service account file on your ec2 instance and you will be able to call Vision API from the ec2 instance.

Brendan
  • 1,017
  • 5
  • 7