Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Winkler authored and Scott Winkler committed Feb 1, 2021
1 parent 84e4dfa commit 20a8e22
Show file tree
Hide file tree
Showing 16 changed files with 68 additions and 36 deletions.
4 changes: 2 additions & 2 deletions modules/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
{
Expand All @@ -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"]
}

Expand Down
4 changes: 2 additions & 2 deletions modules/aws/outputs.tf
Original file line number Diff line number Diff line change
@@ -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"
}
12 changes: 6 additions & 6 deletions modules/aws/variables.tf
Original file line number Diff line number Diff line change
@@ -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
}
8 changes: 8 additions & 0 deletions modules/aws/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.26"
}
}
}
2 changes: 1 addition & 1 deletion modules/azure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions modules/azure/outputs.tf
Original file line number Diff line number Diff line change
@@ -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"
}
12 changes: 6 additions & 6 deletions modules/azure/variables.tf
Original file line number Diff line number Diff line change
@@ -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
})
}
8 changes: 8 additions & 0 deletions modules/azure/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 2.45"
}
}
}
2 changes: 1 addition & 1 deletion modules/gcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions modules/gcp/outputs.tf
Original file line number Diff line number Diff line change
@@ -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"
}
18 changes: 9 additions & 9 deletions modules/gcp/variables.tf
Original file line number Diff line number Diff line change
@@ -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
})
}
8 changes: 8 additions & 0 deletions modules/gcp/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 3.54"
}
}
}
6 changes: 3 additions & 3 deletions modules/loadbalancer/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

2 changes: 1 addition & 1 deletion modules/loadbalancer/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
output "network_address" {
value = "localhost:5000"
value = "localhost:5000"
}
2 changes: 1 addition & 1 deletion modules/loadbalancer/variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
variable "addresses" {
type = list(string)
type = list(string)
}
8 changes: 8 additions & 0 deletions modules/loadbalancer/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_providers {
docker = {
source = "kreuzwerker/docker"
version = "2.11.0"
}
}
}

0 comments on commit 20a8e22

Please sign in to comment.