From 314e86704f7096a484deb966a0f9e42fc89c8030 Mon Sep 17 00:00:00 2001 From: shockrah Date: Thu, 25 Nov 2021 00:09:40 -0800 Subject: [PATCH] + Names to our two main hosts --- infra/Makefile | 16 ++++++++++++---- infra/alpha.tf | 5 ++++- infra/beta.tf | 6 +++++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/infra/Makefile b/infra/Makefile index 31f0b90..8dbe0ff 100644 --- a/infra/Makefile +++ b/infra/Makefile @@ -1,10 +1,18 @@ +plan=out.plan + build: - terraform plan -out out.plan + terraform plan -out $(plan) test: terraform validate -clean: - rm -f out.plan +push: + terraform apply $(plan) -.PHONY: test build clean +rip: + terraform destroy + +clean: + rm -f $(plan) + +.PHONY: test build clean push rip diff --git a/infra/alpha.tf b/infra/alpha.tf index db759bd..5372db9 100644 --- a/infra/alpha.tf +++ b/infra/alpha.tf @@ -10,7 +10,7 @@ variable "alpha_ami_id" {} resource "aws_key_pair" "alpha_ssh" { key_name = var.alpha_ssh_key_name - public_key = var.alpha_public_key_path + public_key = file(var.alpha_public_key_path) } resource "aws_instance" "alpha" { @@ -24,4 +24,7 @@ resource "aws_instance" "alpha" { aws_security_group.internal_ssh_recv.id ] subnet_id = aws_subnet.crete_subnet.id + tags = { + Name = "Alpha Host" + } } diff --git a/infra/beta.tf b/infra/beta.tf index 36a091f..0cc147c 100644 --- a/infra/beta.tf +++ b/infra/beta.tf @@ -8,7 +8,7 @@ variable "beta_ami_id" {} resource "aws_key_pair" "beta_ssh" { key_name = var.beta_public_key_path - public_key = var.beta_public_key_path + public_key = file(var.beta_public_key_path) } resource "aws_instance" "beta" { @@ -23,4 +23,8 @@ resource "aws_instance" "beta" { ] subnet_id = aws_subnet.crete_subnet.id + + tags = { + Name = "Beta Host" + } }