Skip to content

Commit

Permalink
Remove working directory as it can't be found
Browse files Browse the repository at this point in the history
  • Loading branch information
MennaTullahTaha committed Mar 11, 2024
1 parent 28e5b35 commit 8775b47
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 29 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,18 @@ jobs:
# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc.
- name: Terraform Init
run: terraform init
working-directory: Terraform

# formats the file
- name: Terraform Format
run: terraform fmt
working-directory: Terraform

# Generates an execution plan for Terraform
- name: Terraform Plan
run: terraform plan -var 'gcp_credentials=${{ secrets.GCP_SA_KEY }}' -var 'gke_cluster_name=${{ github.event.inputs.clusterName }}" -var 'gcp_region=${{ github.event.inputs.gkeRegion }}'
working-directory: Terraform
run: terraform plan -var 'gcp_credentials=${{ secrets.GCP_SA_KEY }}' -var 'gke_cluster_name=${{ github.event.inputs.clusterName }}' -var 'gcp_region=${{ github.event.inputs.gkeRegion }}'

# Apply terraform
- name: Terraform Apply
run: terraform apply -auto-approve
working-directory: Terraform
run: terraform apply -var 'gcp_credentials=${{ secrets.GCP_SA_KEY }}' -var 'gke_cluster_name=${{ github.event.inputs.clusterName }}' -var 'gcp_region=${{ github.event.inputs.gkeRegion }}' -auto-approve

destroy_cluster:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -90,14 +86,11 @@ jobs:
# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc.
- name: Terraform Init
run: terraform init
working-directory: Terraform

# formats the file
- name: Terraform Format
run: terraform fmt
working-directory: Terraform

# Destroy cluster
- name: Terraform Destroy
run: terraform destroy -var 'gcp_credentials=${{ secrets.GCP_SA_KEY }}' -var 'gke_cluster_name=${{ github.event.inputs.clusterName }}" -var 'gcp_region=${{ github.event.inputs.gkeRegion }}' -auto-approve
working-directory: Terraform
run: terraform destroy -var 'gcp_credentials=${{ secrets.GCP_SA_KEY }}' -var 'gke_cluster_name=${{ github.event.inputs.clusterName }}' -var 'gcp_region=${{ github.event.inputs.gkeRegion }}' -auto-approve
12 changes: 6 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ module "gke" {
region = var.gcp_region
regional = var.gke_regional
zones = var.gke_zones
network = var.gke_network
subnetwork = var.gke_subnetwork
network = google_compute_network.network-trial.id
subnetwork = google_compute_network.network-trial.subnetwork-trial.id
ip_range_pods = google_compute_network.subnetwork-trial.range-1.id
ip_range_services = "services_default_name"
http_load_balancing = false
network_policy = false
horizontal_pod_autoscaling = true
filestore_csi_driver = false
ip_range_services = "europe-west1-01-gke-01-services"
ip_range_pods = "europe-west1-01-gke-01-pods"
node_pools = [
{
name = var.gke_default_nodepools_name
machine_type = "e2-medium"
machine_type = "e2-micro"
min_count = 1
max_count = 3
local_ssd_count = 0
spot = false
disk_size_gb = 100
disk_size_gb = 30
disk_type = "pd-standard"
image_type = "COS_CONTAINERD"
enable_gcfs = false
Expand Down
4 changes: 1 addition & 3 deletions variables.auto.tfvars
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
gcp_project_id = "deploying-with-terraform"
gke_zones = ["europe-west3-b"]
gke_regional = false
gke_network = "default"
gke_subnetwork = "default"
gke_default_nodepools_name = "nodes_pool"
gke_service_account_name = "serviceAccount:[email protected]"
gke_service_account_name = "[email protected]"
10 changes: 0 additions & 10 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ variable "gke_regional" {
description = "regional choice"
}

variable "gke_network" {
type = string
description = "VPC network name"
}

variable "gke_subnetwork" {
type = string
description = "VPC subnetwork name"
}

variable "gke_default_nodepools_name" {
type = string
description = "default name for node pool"
Expand Down

0 comments on commit 8775b47

Please sign in to comment.