mirror of
https://github.com/ghndrx/tf-variable-demo.git
synced 2026-02-10 06:54:57 +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
|
||||
}
|
||||
|
||||
resource "google_project_service" "compute_engine_api" {
|
||||
project = var.project_id
|
||||
service = "compute.googleapis.com"
|
||||
|
||||
disable_dependent_services = true
|
||||
disable_on_destroy = false
|
||||
module "firewall_rule" {
|
||||
source = "./modules/firewall_rule"
|
||||
project_id = var.project_id
|
||||
}
|
||||
|
||||
module "compute_engine_template" {
|
||||
|
||||
@@ -16,7 +16,7 @@ resource "google_compute_instance_template" "template" {
|
||||
// Ephemeral public IP address
|
||||
}
|
||||
}
|
||||
|
||||
tags = ["http-server"]
|
||||
metadata_startup_script = var.startup_script
|
||||
|
||||
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