Fixes DNS Name Per Environment and Protocols Per Port Rules in Sec Grp

This commit is contained in:
2023-10-07 08:53:41 -03:00
parent 48eb00ceba
commit 05fa3fb0e5
5 changed files with 36 additions and 20 deletions

View File

@@ -12,6 +12,10 @@ variable "public_ip" {
type = string
}
variable "environment_name" {
type = string
}
resource "godaddy_domain_record" "default" {
domain = "hideyoshi.com.br"
@@ -19,7 +23,7 @@ resource "godaddy_domain_record" "default" {
overwrite = false
record {
name = "staging "
name = var.environment_name == "prod" ? "@" : "staging"
type = "A"
data = "${var.public_ip}"
ttl = 600
@@ -27,7 +31,7 @@ resource "godaddy_domain_record" "default" {
}
record {
name = "api.staging "
name = var.environment_name == "prod" ? "api" : "api.staging"
type = "A"
data = "${var.public_ip}"
ttl = 600