diff --git a/modules/aws/main.tf b/modules/aws/main.tf index e8b8998..791acae 100644 --- a/modules/aws/main.tf +++ b/modules/aws/main.tf @@ -3,7 +3,7 @@ data "aws_vpc" "default" { } module "instance_sg" { - source = "scottwinkler/sg/aws" + source = "terraform-in-action/sg/aws" vpc_id = data.aws_vpc.default.id ingress_rules = [ { @@ -14,7 +14,7 @@ module "instance_sg" { } module "iam_instance_profile" { - source = "scottwinkler/iip/aws" + source = "terraform-in-action/iip/aws" actions = ["logs:*", "ec2:DescribeInstances"] } diff --git a/modules/aws/outputs.tf b/modules/aws/outputs.tf index 7b52475..f8bdeaa 100644 --- a/modules/aws/outputs.tf +++ b/modules/aws/outputs.tf @@ -1,7 +1,7 @@ output "public_ip" { - value = aws_instance.instance.public_ip + value = aws_instance.instance.public_ip } output "network_address" { - value = "${aws_instance.instance.public_ip}:8080" + value = "${aws_instance.instance.public_ip}:8080" } \ No newline at end of file diff --git a/modules/aws/variables.tf b/modules/aws/variables.tf index 3d4e37e..55c0caa 100644 --- a/modules/aws/variables.tf +++ b/modules/aws/variables.tf @@ -1,11 +1,11 @@ variable "environment" { - type = object({ - name = string - background_color=string - }) + type = object({ + name = string + background_color = string + }) } variable "ssh_keypair" { - default = null - type = string + default = null + type = string } diff --git a/modules/aws/versions.tf b/modules/aws/versions.tf new file mode 100644 index 0000000..f515d64 --- /dev/null +++ b/modules/aws/versions.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 3.26" + } + } +} \ No newline at end of file diff --git a/modules/azure/main.tf b/modules/azure/main.tf index 9cb9f90..abdc5dd 100644 --- a/modules/azure/main.tf +++ b/modules/azure/main.tf @@ -110,7 +110,7 @@ resource "azurerm_virtual_machine" "virtual_machine" { computer_name = "azure-vm" admin_username = "azure" admin_password = "Passwword1234" - custom_data = templatefile("${path.module}/templates/startup.sh",{ NAME = var.environment.name, BG_COLOR = var.environment.background_color }) + custom_data = templatefile("${path.module}/templates/startup.sh", { NAME = var.environment.name, BG_COLOR = var.environment.background_color }) } os_profile_linux_config { disable_password_authentication = false diff --git a/modules/azure/outputs.tf b/modules/azure/outputs.tf index 260205b..0bfacbb 100644 --- a/modules/azure/outputs.tf +++ b/modules/azure/outputs.tf @@ -1,7 +1,7 @@ output "public_ip" { - value = azurerm_public_ip.public_ip.ip_address + value = azurerm_public_ip.public_ip.ip_address } output "network_address" { - value = "${azurerm_public_ip.public_ip.ip_address}:8080" + value = "${azurerm_public_ip.public_ip.ip_address}:8080" } \ No newline at end of file diff --git a/modules/azure/variables.tf b/modules/azure/variables.tf index 7829b73..3ebe3c0 100644 --- a/modules/azure/variables.tf +++ b/modules/azure/variables.tf @@ -1,11 +1,11 @@ variable "location" { - default = "westus2" - type = string + default = "westus2" + type = string } variable "environment" { - type = object({ - name = string - background_color=string - }) + type = object({ + name = string + background_color = string + }) } \ No newline at end of file diff --git a/modules/azure/versions.tf b/modules/azure/versions.tf new file mode 100644 index 0000000..7940539 --- /dev/null +++ b/modules/azure/versions.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = "~> 2.45" + } + } +} \ No newline at end of file diff --git a/modules/gcp/main.tf b/modules/gcp/main.tf index b3a7d03..d556421 100644 --- a/modules/gcp/main.tf +++ b/modules/gcp/main.tf @@ -42,7 +42,7 @@ resource "google_compute_instance" "compute_instance" { } } - metadata_startup_script = templatefile("${path.module}/templates/startup.sh",{ NAME = var.environment.name, BG_COLOR = var.environment.background_color }) + metadata_startup_script = templatefile("${path.module}/templates/startup.sh", { NAME = var.environment.name, BG_COLOR = var.environment.background_color }) network_interface { network = "default" diff --git a/modules/gcp/outputs.tf b/modules/gcp/outputs.tf index 01c3ad9..95fea46 100644 --- a/modules/gcp/outputs.tf +++ b/modules/gcp/outputs.tf @@ -1,7 +1,7 @@ output "public_ip" { - value = google_compute_instance.compute_instance.network_interface.0.access_config.0.nat_ip + value = google_compute_instance.compute_instance.network_interface.0.access_config.0.nat_ip } output "network_address" { - value = "${google_compute_instance.compute_instance.network_interface.0.access_config.0.nat_ip}:8080" + value = "${google_compute_instance.compute_instance.network_interface.0.access_config.0.nat_ip}:8080" } \ No newline at end of file diff --git a/modules/gcp/variables.tf b/modules/gcp/variables.tf index 045f5ba..f41cd6a 100644 --- a/modules/gcp/variables.tf +++ b/modules/gcp/variables.tf @@ -1,17 +1,17 @@ variable "project_id" { - description = "The GCP project id" - type = string + description = "The GCP project id" + type = string } variable "region" { - default = "us-central1" - description = "GCP region" - type = string + default = "us-central1" + description = "GCP region" + type = string } variable "environment" { - type = object({ - name = string - background_color=string - }) + type = object({ + name = string + background_color = string + }) } \ No newline at end of file diff --git a/modules/gcp/versions.tf b/modules/gcp/versions.tf new file mode 100644 index 0000000..903d39c --- /dev/null +++ b/modules/gcp/versions.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = "~> 3.54" + } + } +} \ No newline at end of file diff --git a/modules/loadbalancer/main.tf b/modules/loadbalancer/main.tf index 8836ed7..bac1e90 100644 --- a/modules/loadbalancer/main.tf +++ b/modules/loadbalancer/main.tf @@ -5,11 +5,11 @@ resource "docker_container" "loadbalancer" { name = "tia-loadbalancer" image = "swinkler/tia-loadbalancer" env = [ - "ADDRESSES=${join(" ",var.addresses)}" + "ADDRESSES=${join(" ", var.addresses)}" ] ports { - internal = 80 - external = 5000 + internal = 80 + external = 5000 } } diff --git a/modules/loadbalancer/outputs.tf b/modules/loadbalancer/outputs.tf index e30c25b..3658660 100644 --- a/modules/loadbalancer/outputs.tf +++ b/modules/loadbalancer/outputs.tf @@ -1,3 +1,3 @@ output "network_address" { - value = "localhost:5000" + value = "localhost:5000" } \ No newline at end of file diff --git a/modules/loadbalancer/variables.tf b/modules/loadbalancer/variables.tf index 48f773d..fabd968 100644 --- a/modules/loadbalancer/variables.tf +++ b/modules/loadbalancer/variables.tf @@ -1,3 +1,3 @@ variable "addresses" { - type = list(string) + type = list(string) } \ No newline at end of file diff --git a/modules/loadbalancer/versions.tf b/modules/loadbalancer/versions.tf new file mode 100644 index 0000000..beb1e28 --- /dev/null +++ b/modules/loadbalancer/versions.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + docker = { + source = "kreuzwerker/docker" + version = "2.11.0" + } + } +} \ No newline at end of file