@@ -13,38 +13,27 @@ for use with [Google Compute Engine](https://cloud.google.com/products/compute-e
...
@@ -13,38 +13,27 @@ for use with [Google Compute Engine](https://cloud.google.com/products/compute-e
(GCE) based on existing images. Google Compute Engine doesn't allow the creation
(GCE) based on existing images. Google Compute Engine doesn't allow the creation
of images from scratch.
of images from scratch.
## Setting Up API Access
## Authentication
There is a small setup step required in order to obtain the credentials
Authenticating with Google Cloud services requires two separate JSON
that Packer needs to use Google Compute Engine. This needs to be done only
files: one which we call the _account file_ and the _client secrets file_.
once if you intend to share the credentials.
In order for Packer to talk to Google Compute Engine, it will need
Both of these files are downloaded directly from the
a _client secrets_ JSON file and a _client private key_. Both of these are
[Google Developers Console](https://console.developers.google.com). To make
obtained from the [Google Cloud Console](https://cloud.google.com/console).
the process more straightforwarded, it is documented here.
Follow the steps below:
1. Log into the [Google Developers Console](https://console.developers.google.com)
and select a project.
1. Log into the [Google Cloud Console](https://cloud.google.com/console)
2. Under the "APIs & Auth" section, click "Credentials."
2. Click on the project you want to use Packer with (or create one if you
don't have one yet).
3. Click "APIs & auth" in the left sidebar
4. Click "Credentials" in the left sidebar
5. Click "Create New Client ID" and choose "Service Account"
6. A private key will be downloaded for you. Note the password for the private key! This private key is your _client private key_.
7. After creating the account, click "Download JSON". This is your _client secrets JSON_ file. Make sure you didn't download the JSON from the "OAuth 2.0" section! This is a common mistake and will cause the builder to not work.
Finally, one last step, you'll have to convert the `p12` file you
3. Click the "Download JSON" button under the "Compute Engine and App Engine"
got from Google into the PEM format. You can do this with OpenSSL, which
account in the OAuth section. The file should start with "client\_secrets".
is installed standard on most Unixes:
This is your _client secrets file_.
```
4. Create a new OAuth client ID and select "Service Account" as the type