mirror of
https://github.com/sidpalas/devops-directive-terraform-course.git
synced 2025-12-18 08:31:21 +00:00
run terraform fmt
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
resource "aws_route53_zone" "primary" {
|
||||
count = var.create_dns_zone ? 1 : 0
|
||||
name = var.domain
|
||||
name = var.domain
|
||||
}
|
||||
|
||||
data "aws_route53_zone" "primary" {
|
||||
count = var.create_dns_zone ? 0 : 1
|
||||
name = var.domain
|
||||
name = var.domain
|
||||
}
|
||||
|
||||
locals {
|
||||
dns_zone_id = var.create_dns_zone ? aws_route53_zone.primary[0].zone_id : data.aws_route53_zone.primary[0].zone_id
|
||||
subdomain = var.environment_name == "production" ? "" : "${var.environment_name}."
|
||||
subdomain = var.environment_name == "production" ? "" : "${var.environment_name}."
|
||||
}
|
||||
|
||||
resource "aws_route53_record" "root" {
|
||||
|
||||
@@ -8,14 +8,14 @@ variable "region" {
|
||||
|
||||
variable "app_name" {
|
||||
description = "Name of the web application"
|
||||
type = string
|
||||
default = "web-app"
|
||||
type = string
|
||||
default = "web-app"
|
||||
}
|
||||
|
||||
variable "environment_name" {
|
||||
description = "Deployment environment (dev/staging/production)"
|
||||
type = string
|
||||
default = "dev"
|
||||
type = string
|
||||
default = "dev"
|
||||
}
|
||||
|
||||
# EC2 Variables
|
||||
@@ -43,8 +43,8 @@ variable "bucket_name" {
|
||||
|
||||
variable "create_dns_zone" {
|
||||
description = "If true, create new route53 zone, if false read existing route53 zone"
|
||||
type = bool
|
||||
default = false
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
|
||||
variable "domain" {
|
||||
|
||||
Reference in New Issue
Block a user