Skip to content

Commit

Permalink
Fix helper utilities broken in 08095d1 (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdfrench committed Jul 15, 2019
1 parent 08095d1 commit 730066d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ rotate: remote.txt ##: Rotate your instance's API tokens
.PHONY: remote.txt
remote.txt: $(jq)
$(MAKE) -C infrastructure install
$(jq) -r '"root@" + .zoolander.value + ":zoolander"' infrastructure/host.json > $@
$(jq) -r '"root@" + .domain_name + ":zoolander"' infrastructure/host.json > $@
10 changes: 7 additions & 3 deletions infrastructure/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ include lib.mk
terraform=$(call which, terraform)
jq=$(call which, jq)

install: $(terraform) .terraform/plugins/init ##: Deploy latest infrastructure
install: host.json ##: Deploy latest infrastructure

.PHONY: host.json
host.json: $(terraform) .terraform/plugins/init
$(call assertEnv, AWS_DEFAULT_REGION)
$(call assertEnv, DOMAIN_NAME)
$(terraform) apply -auto-approve -var 'parent_zone=$(DOMAIN_NAME)'
$(terraform) output -json > host.json
$(terraform) output -json host > $@

uninstall: $(terraform) .terraform/plugins/init ##: Remove any deployed infrastructure
$(call assertEnv, AWS_DEFAULT_REGION)
$(terraform) destroy -auto-approve
$(call assertEnv, DOMAIN_NAME)
$(terraform) destroy -auto-approve -var 'parent_zone=$(DOMAIN_NAME)'

# Download plugins for each resource provider
.terraform/plugins/init: $(terraform) providers.tf
Expand Down
7 changes: 7 additions & 0 deletions infrastructure/host.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
output "host" {
value = {
domain_name = local.network.dns
ip_address = aws_instance.zoolander.public_ip
}
}

resource "aws_instance" "zoolander" {
ami = data.aws_ami.zoolander_latest.id
instance_type = "t2.small"
Expand Down

0 comments on commit 730066d

Please sign in to comment.