**Note**: this repo uses a pre-created Vault Token to Authenticate GitLab Runners to HashiCorp Vault. For GitLab Runners to Authenticate themselves to Vault using an Authentication method, please see the following repository: [hashitalk-terraform-cloud-and-gitlab-demo](https://gitlab.com/gitlab-com/alliances/hashicorp/sandbox-projects/hashitalk-terraform-cloud-and-gitlab-demo).

This repo uses GitLab CI/CD and Terraform Cloud API driven Run to deploy a compute instance in Google Cloud Platform. A Run is created in Terraform Cloud (TFC) from GitLab CI/CD.

- For the CLI Driven Run example please see the [gl-terraform-gcp-compute-test](https://gitlab.com/kawsark/gl-terraform-gcp-compute-test) repo.

...

...

@@ -22,15 +24,15 @@ This repo has two Walk through guides:

Please clone this repo to your GitLab account

### Create a GitLab Runner Docker image (Optional)

The Docker image used for the GitLab Runner in this demo has already made public in Dockerhub as [gitlab-ruby-curl](https://cloud.docker.com/repository/docker/kawsark/gitlab-ruby-curl). This container image is capable of performing an API driven run using `curl` and `jq`.

The Docker image used for the GitLab Runner in this demo has already made public in Dockerhub as [kawsark/gitlab-terraforml](https://cloud.docker.com/repository/docker/kawsark/gitlab-terraform). This container image is capable of performing an API driven run using `curl` and `jq`. It also contains an `amd64` Vault binary which is used as a CLI to interact with Vault. Note: this image does **not** contain the terraform binary.

You can optionally customize a GitLab Runner image using included example [Dockerfile](scripts/Dockerfile). Below are the steps to create a custom image and upload to a container registry.

```

cd scripts

# Customize Dockerfile as needed

docker build -t <your_docker_username>/gitlab-ruby-curl:0.0.1 .

docker build -t <your_docker_username>/gitlab-terraform:0.0.2 .

docker login

docker push <your_docker_username>/gitlab-ruby-curl:0.0.1

docker push <your_docker_username>/gitlab-terraform:0.0.2

```

### Register the GitLab Runner

...

...

@@ -168,4 +170,4 @@ cd scripts

Please visit the Run URL provided by the script to ensure the destroy was completed.

## Testing terraform configuration locally

Please see [local.md](local.md) to test this terraform configuration locally without using TFC or GitLab.

\ No newline at end of file

Please see [local.md](local.md) to test this terraform configuration locally without using TFC or GitLab.