From 2d82c0ad5400dd16d63b7219aa8294ee622ddcaf Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Mon, 4 Oct 2021 13:36:37 -0400 Subject: [PATCH] Add terraform outputs and spin up nginx droplet --- prod/nginx/packer/terraform/terraform.tf | 2 +- prod/nginx/terraform/.terraform.lock.hcl | 41 ++++++++++++++++++++++++ prod/nginx/terraform/outputs.tf | 7 ++++ prod/nginx/terraform/terraform.tf | 2 +- 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 prod/nginx/terraform/.terraform.lock.hcl create mode 100644 prod/nginx/terraform/outputs.tf diff --git a/prod/nginx/packer/terraform/terraform.tf b/prod/nginx/packer/terraform/terraform.tf index cc237b2..480cadb 100644 --- a/prod/nginx/packer/terraform/terraform.tf +++ b/prod/nginx/packer/terraform/terraform.tf @@ -13,6 +13,6 @@ terraform { region = "us-east-1" endpoint = "nyc3.digitaloceanspaces.com" bucket = "jdormit-tf-state" - key = "prod/nginx.tfstate" + key = "prod/nginx-config.tfstate" } } diff --git a/prod/nginx/terraform/.terraform.lock.hcl b/prod/nginx/terraform/.terraform.lock.hcl new file mode 100644 index 0000000..fc94c5b --- /dev/null +++ b/prod/nginx/terraform/.terraform.lock.hcl @@ -0,0 +1,41 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/digitalocean/digitalocean" { + version = "2.3.0" + constraints = "~> 2.3.0" + hashes = [ + "h1:Kmcj3ajzt/lSQkbQwcjzUNK2RXXcHNDCs44LfDhZnaM=", + "zh:1c0f68715cf0b84ab40ab08aa59232037325cffc2896ba109cae73c81ab021e9", + "zh:306599aec6637c92349abb069d8fea3ebac58f52f61707956320a405f57e4a84", + "zh:31db532f05e55cb52d61c12c10197dca48dc8809a4f9cc4a935d3161546968ca", + "zh:3dba438c0167e5dcf09115f8d2c33c0a821e6b27e83ec6ccaac5fcb557a50bbb", + "zh:770c906ab3eeb5c24c5b8bbcca3b18f137d5ac817bd73fa5c9146eb4a9d891d6", + "zh:9221f2d275c776382234882d534a1147db04a8be490c023eb08c9a1e579db021", + "zh:a4e25e5dd2ad06de6c7148a270b1178b6298846405ce66b9b4ca51ea35b66907", + "zh:b3c5555e0c55efaa91de245e6d69e7140665554d2365db2f664802a36b59e0a8", + "zh:c510655b6c5de0227babba5a8bb66a8c3d92af94e080ec1c39bde9509a2aa1a6", + "zh:d04a135d9bf32c1a55abaaeb719903f4f67797434dd6d9f3219245f62a9a66be", + "zh:dd5b99bec9425eb670be5d19b17336d0fa9b894649dac77eac532e4c626616f5", + "zh:e57614fb9f3fbf774a9258a197840f40d0f343e8183eef7a842286a87cfc48d7", + "zh:fee52e736edc5ef4088cedae6507790f35e4ee8a078bff1ef894a51dd65d058d", + ] +} + +provider "registry.terraform.io/hashicorp/local" { + version = "2.1.0" + hashes = [ + "h1:KfieWtVyGWwplSoLIB5usKAUnrIkDQBkWaR5TI+4WYg=", + "zh:0f1ec65101fa35050978d483d6e8916664b7556800348456ff3d09454ac1eae2", + "zh:36e42ac19f5d68467aacf07e6adcf83c7486f2e5b5f4339e9671f68525fc87ab", + "zh:6db9db2a1819e77b1642ec3b5e95042b202aee8151a0256d289f2e141bf3ceb3", + "zh:719dfd97bb9ddce99f7d741260b8ece2682b363735c764cac83303f02386075a", + "zh:7598bb86e0378fd97eaa04638c1a4c75f960f62f69d3662e6d80ffa5a89847fe", + "zh:ad0a188b52517fec9eca393f1e2c9daea362b33ae2eb38a857b6b09949a727c1", + "zh:c46846c8df66a13fee6eff7dc5d528a7f868ae0dcf92d79deaac73cc297ed20c", + "zh:dc1a20a2eec12095d04bf6da5321f535351a594a636912361db20eb2a707ccc4", + "zh:e57ab4771a9d999401f6badd8b018558357d3cbdf3d33cc0c4f83e818ca8e94b", + "zh:ebdcde208072b4b0f8d305ebf2bfdc62c926e0717599dcf8ec2fd8c5845031c3", + "zh:ef34c52b68933bedd0868a13ccfd59ff1c820f299760b3c02e008dc95e2ece91", + ] +} diff --git a/prod/nginx/terraform/outputs.tf b/prod/nginx/terraform/outputs.tf new file mode 100644 index 0000000..30d0079 --- /dev/null +++ b/prod/nginx/terraform/outputs.tf @@ -0,0 +1,7 @@ +output "nginx_ip_address" { + value = module.packer_droplet.droplet_ip_address +} + +output "nginx_urn" { + value = module.packer_droplet.droplet_urn +} diff --git a/prod/nginx/terraform/terraform.tf b/prod/nginx/terraform/terraform.tf index 480cadb..cc237b2 100644 --- a/prod/nginx/terraform/terraform.tf +++ b/prod/nginx/terraform/terraform.tf @@ -13,6 +13,6 @@ terraform { region = "us-east-1" endpoint = "nyc3.digitaloceanspaces.com" bucket = "jdormit-tf-state" - key = "prod/nginx-config.tfstate" + key = "prod/nginx.tfstate" } }