소스 검색

Updates Resolver Instance Names

Instance names now include a number.

To be tagged v1.10.9
Fred Damstra 4 년 전
부모
커밋
ab4296a869
2개의 변경된 파일8개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      base/dns/resolver_instance/main.tf
  2. 5 0
      base/dns/resolver_instance/vars.tf

+ 3 - 3
base/dns/resolver_instance/main.tf

@@ -1,5 +1,5 @@
 locals {
-  instance_name = "resolver-${var.aws_partition_alias}"
+  instance_name = "resolver-${var.aws_partition_alias}-${var.instance_number}"
 }
 
 # Rather than pass in the aws security group, we just look it up. This will
@@ -87,7 +87,7 @@ data "template_file" "cloud-init" {
 
   vars = {
     hostname = local.instance_name
-    fqdn = "resolver-${var.aws_partition_alias}.${var.dns_info["private"]["zone"]}"
+    fqdn = "resolver-${var.aws_partition_alias}-${var.instance_number}.${var.dns_info["private"]["zone"]}"
     environment = var.environment
     # can't use the DNS name like we would most places, because this is the DNS server
     saltmaster  = var.salt_master_ip
@@ -119,7 +119,7 @@ data "template_cloudinit_config" "cloud-init" {
 }
 
 resource "aws_security_group" "dns_security_group" {
-  name = "dns_security_group"
+  name = "dns_security_group_${var.instance_number}"
   description = "DNS Security Group"
   vpc_id = var.vpc_id
   tags = merge(var.standard_tags, var.tags)

+ 5 - 0
base/dns/resolver_instance/vars.tf

@@ -1,3 +1,8 @@
+variable "instance_number" {
+  type = number
+  default = 1
+}
+
 variable "subnet_id" {
   type = string
 }