Files
devops-directive-terraform-…/08-testing/examples/hello-world/main.tf
2021-05-27 14:35:03 -07:00

36 lines
714 B
HCL

terraform {
# Assumes s3 bucket and dynamo DB table already set up
# See /code/03-basics/aws-backend
backend "s3" {
bucket = "devops-directive-tf-state"
key = "08-testing/examples/hello-world/terraform.tfstate"
region = "us-east-1"
dynamodb_table = "terraform-state-locking"
encrypt = true
}
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
module "web_app" {
source = "../../modules/hello-world"
}
output "instance_ip_addr" {
value = module.web_app.instance_ip_addr
}
output "url" {
value = "http://${module.web_app.instance_ip_addr}:8080"
}