This is an automated email from the ASF dual-hosted git repository.
dmysakovets pushed a commit to branch terraform
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
The following commit(s) were added to refs/heads/terraform by this push:
new 2949cf5 [terraform] Refactoring variables
2949cf5 is described below
commit 2949cf51fd5f3314fce842cfe809768c057d0ab8
Author: Dyoma33 <[email protected]>
AuthorDate: Thu May 30 19:04:24 2019 +0300
[terraform] Refactoring variables
---
.../terraform/modules/ssn/instance.tf | 8 ++---
.../terraform/modules/ssn/network.tf | 18 ++++++------
.../terraform/modules/ssn/variables.tf | 34 ++++++++++++++++++++++
3 files changed, 47 insertions(+), 13 deletions(-)
diff --git a/infrastructure-provisioning/terraform/modules/ssn/instance.tf
b/infrastructure-provisioning/terraform/modules/ssn/instance.tf
index c42d139..4cc0527 100644
--- a/infrastructure-provisioning/terraform/modules/ssn/instance.tf
+++ b/infrastructure-provisioning/terraform/modules/ssn/instance.tf
@@ -4,14 +4,14 @@ provider "google" {
}
resource "google_compute_address" "ssn-ip" {
- name = "${var.project_name_var}-ssn-ip"
+ name = "${var.ssn-ip}"
address_type = "EXTERNAL"
}
resource "google_compute_instance" "ssn" {
- name = "${var.project_name_var}-ssn"
- machine_type = "n1-standard-1"
- tags = ["${var.project_name_var}-ssn"]
+ name = "${var.}"
+ machine_type = "${var.machine_type_var}"
+ tags = ["${var.tags_var}"]
zone = "${var.zone}"
boot_disk {
diff --git a/infrastructure-provisioning/terraform/modules/ssn/network.tf
b/infrastructure-provisioning/terraform/modules/ssn/network.tf
index 386e191..8cb9c0b 100644
--- a/infrastructure-provisioning/terraform/modules/ssn/network.tf
+++ b/infrastructure-provisioning/terraform/modules/ssn/network.tf
@@ -5,30 +5,30 @@ resource "google_compute_network" "vpc" {
}
resource "google_compute_subnetwork" "subnet" {
- name = "${var.project_name_var}-subnet"
- ip_cidr_range = "172.31.0.0/20"
- region = "us-east1"
+ name = "${var.subnet}"
+ ip_cidr_range = "${var.cidr}"
+ region = "${var.region}"
network = "${google_compute_network.vpc.self_link}"
}
resource "google_compute_firewall" "firewall-ingress" {
- name = "${var.project_name_var}-ssn-firewall-ingress"
+ name = "${var.firewall_ingress_name}"
network = "${google_compute_network.vpc.name}"
allow {
protocol = "tcp"
ports = ["22", "80", "443"]
}
- target_tags = ["${var.project_name_var}-ssn"]
- source_ranges = ["0.0.0.0/0"]
+ target_tags = ["${var.tags_var}"]
+ source_ranges = ["${var.firewall_cidr_ranges}"]
}
resource "google_compute_firewall" "firewall-egress" {
- name = "${var.project_name_var}-ssn-firewall-egress"
+ name = "${var.firewall_egress_name}"
network = "${google_compute_network.vpc.name}"
direction = "EGRESS"
allow {
protocol = "all"
}
- target_tags = ["${var.project_name_var}-ssn"]
- destination_ranges = ["0.0.0.0/0"]
+ target_tags = ["${var.tags_var}"]
+ destination_ranges = ["${var.firewall_cidr_ranges}"]
}
diff --git a/infrastructure-provisioning/terraform/modules/ssn/variables.tf
b/infrastructure-provisioning/terraform/modules/ssn/variables.tf
index c1f5a09..f181e2d 100644
--- a/infrastructure-provisioning/terraform/modules/ssn/variables.tf
+++ b/infrastructure-provisioning/terraform/modules/ssn/variables.tf
@@ -6,10 +6,44 @@ variable "project_name_var" {
default = "dem-test-terraform"
}
+variable "proje" {}
+
+variable "subnet_name" {
+ default = "dem-test-terraform-ssn-subnet"
+}
+
+variable "firewall_ingress_name" {
+ default = "dem-test-terraform-ssn-firewall-ingress"
+}
+
+variable "firewall_egress_name" {
+ default = "dem-test-terraform-ssn-firewal-egress"
+}
+
+variable "tags_var" {
+ default = "dem-test-terraform-ssn"
+}
+
+variable "firewall_cidr_ranges" {
+ default = "0.0.0.0/0"
+}
+
+variable "ssn-ip" {
+ default = "dem-test-terraform-ssn"
+}
+
+variable "machine_type_var" {
+ default = "n1-standard-1"
+}
+
variable "region" {
default = "us-east1"
}
+variable "cidr" {
+ default = "172.31.0.0/20"
+}
+
variable "zone" {
default = "us-east1-c"
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]