diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d85ea6..97a2ac6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@master + uses: google-github-actions/setup-gcloud@v0.6.0 with: service_account_key: ${{ secrets.GCP_KEY }} project_id: mentoria-iac-staging diff --git a/clients.tf b/clients.tf new file mode 100644 index 0000000..dce8dcc --- /dev/null +++ b/clients.tf @@ -0,0 +1,34 @@ +data "google_compute_zones" "us-central1" { + region = var.region +} + +module "nomad_clients" { + source = "github.com/mentoriaiac/iac-modulo-compute-gcp.git?ref=v0.2.1" + count = 2 + + project = var.project + zone = data.google_compute_zones.us-central1.names[count.index % length(data.google_compute_zones.us-central1.names)] + + instance_name = "client-${count.index + 1}" + instance_image = "nomad-v0-3-0" + machine_type = "e2-small" + + network = module.network_gcp.vpc_id + subnetwork = module.network_gcp.subnets[0].id + tags = ["nomad", "consul"] + + metadata_startup_script = <