This terraform is intended to quickly prepare VM instance on GCP along with necessary configuration to run eve-ng.
It creates image based on ubuntu
with enabled virtualization, vpc, private subnet, firewall rules and VM instance.
- Install
terraform
-> follow official guide. - Install
gcloud
-> follow official guide. - Create GCP project, enable Compute Engine API.
- Initialize
gcloud
-> executegcloud init
and follow wizzard, choose created project. - Create and download service account key -> follow guide and export downloaded key's path to
GOOGLE_CLOUD_KEYFILE_JSON
. - Find project id -> execute
gcloud projects list
, copy id of a created project. - Initialize
terraform
-> executeterraform init
.
-
Plan
terraform
changes:terraform plan -var "project=<copied-project-id>"
-
Apply
terraform
changes:terraform apply -var "project=<copied-project-id>"
-
Destroy
terraform
changes:terraform apply -destroy -var "project=<copied-project-id>"
Due to imperative nature of eve-ng
installation proces, this terraform only prepares a VM for eve-ng
installation.
Later instalation steps can be found in a cookbook, section 3.4.4
.
Section 3.4.6
might be ommited as firewall rules have been already configured by this terraform.
GCP bills for running VM instances and persistent storage. It is highly recommended to stop eve-ng
instance when it's not in use.
It can be quickly done by executing gcloud compute instances stop <instance-name>
.
By default, machine type configured in this terraform is set to n2-standard-2
.
This is rather minimal setup, yet it can be overriden by machine_type
variable.
See variables.tf
.