mirror of
https://github.com/ghndrx/tf-variable-demo.git
synced 2026-02-10 15:04:56 +00:00
add firewall rules and add tags to template
This commit is contained in:
9
main.tf
9
main.tf
@@ -5,12 +5,9 @@ provider "google" {
|
|||||||
zone = var.zone
|
zone = var.zone
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "google_project_service" "compute_engine_api" {
|
module "firewall_rule" {
|
||||||
project = var.project_id
|
source = "./modules/firewall_rule"
|
||||||
service = "compute.googleapis.com"
|
project_id = var.project_id
|
||||||
|
|
||||||
disable_dependent_services = true
|
|
||||||
disable_on_destroy = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module "compute_engine_template" {
|
module "compute_engine_template" {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ resource "google_compute_instance_template" "template" {
|
|||||||
// Ephemeral public IP address
|
// Ephemeral public IP address
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tags = ["http-server"]
|
||||||
metadata_startup_script = var.startup_script
|
metadata_startup_script = var.startup_script
|
||||||
|
|
||||||
lifecycle {
|
lifecycle {
|
||||||
|
|||||||
0
modules/firewall_rules/main.tf
Normal file
0
modules/firewall_rules/main.tf
Normal file
1
modules/firewall_rules/variables.tf
Normal file
1
modules/firewall_rules/variables.tf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
variable "project_id" {}
|
||||||
Reference in New Issue
Block a user