mirror of
https://github.com/sidpalas/devops-directive-terraform-course.git
synced 2025-12-10 04:41:14 +00:00
36 lines
714 B
HCL
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"
|
|
}
|