瀏覽代碼

update instance

Chris Mague 3 年之前
父節點
當前提交
fca91b8d6e
共有 2 個文件被更改,包括 21 次插入15 次删除
  1. 4 3
      instances.tf
  2. 17 12
      variables.tf

+ 4 - 3
instances.tf

@@ -7,7 +7,8 @@ resource "aws_instance" "re" {
   vpc_security_group_ids = [aws_security_group.re.id]
   vpc_security_group_ids = [aws_security_group.re.id]
   source_dest_check      = false
   source_dest_check      = false
   key_name               = local.ssh_key
   key_name               = local.ssh_key
-  tags                   = merge({ Name = "RedisEnterprise-${var.vpc-name}-${count.index}" }, var.common-tags)
+  root_block_device { volume_size = var.node-root-size }
+  tags = merge({ Name = "RedisEnterprise-${var.vpc-name}-${count.index}" }, var.common-tags)
 
 
 }
 }
 
 
@@ -57,7 +58,7 @@ resource "aws_volume_attachment" "re-persistant" {
 # Handle attaching volumes if enable-flash is set (false by default)
 # Handle attaching volumes if enable-flash is set (false by default)
 
 
 resource "aws_ebs_volume" "re-flash" {
 resource "aws_ebs_volume" "re-flash" {
-  count = local.count_flash
+  count             = local.count_flash
   availability_zone = element(var.vpc-azs, count.index)
   availability_zone = element(var.vpc-azs, count.index)
   size              = var.re-volume-size
   size              = var.re-volume-size
   type              = "gp2"
   type              = "gp2"
@@ -69,4 +70,4 @@ resource "aws_volume_attachment" "re-flash" {
   device_name = "/dev/sdi"
   device_name = "/dev/sdi"
   volume_id   = element(aws_ebs_volume.re-flash.*.id, count.index)
   volume_id   = element(aws_ebs_volume.re-flash.*.id, count.index)
   instance_id = element(aws_instance.re.*.id, count.index)
   instance_id = element(aws_instance.re.*.id, count.index)
-}
+}

+ 17 - 12
variables.tf

@@ -13,7 +13,7 @@ variable "common-tags" {
 }
 }
 
 
 variable "open-nets" {
 variable "open-nets" {
-  type        = list
+  type        = list(any)
   description = "CIDRs that will have access to everything"
   description = "CIDRs that will have access to everything"
   default     = []
   default     = []
 }
 }
@@ -37,12 +37,12 @@ variable "ssh-key" {
 
 
 
 
 variable "vpc-subnets" {
 variable "vpc-subnets" {
-  type        = list
+  type        = list(any)
   description = "The list of subnets available to the VPC"
   description = "The list of subnets available to the VPC"
 }
 }
 
 
 variable "vpc-azs" {
 variable "vpc-azs" {
-  type        = list
+  type        = list(any)
   description = "The ID of the VPC"
   description = "The ID of the VPC"
 }
 }
 
 
@@ -76,6 +76,11 @@ variable "re-volume-size" {
   default     = "150"
   default     = "150"
 }
 }
 
 
+variable "node-root-size" {
+  description = "The size of the root volume"
+  default     = "50"
+}
+
 variable "enable-flash" {
 variable "enable-flash" {
   description = "Enable Flash Devices"
   description = "Enable Flash Devices"
   default     = false
   default     = false
@@ -98,7 +103,7 @@ variable "allow-public-ssh" {
 
 
 variable "internal-rules" {
 variable "internal-rules" {
   description = "Security rules to allow for connectivity within the VPC"
   description = "Security rules to allow for connectivity within the VPC"
-  type        = list
+  type        = list(any)
   default = [
   default = [
     {
     {
       type      = "ingress"
       type      = "ingress"
@@ -261,19 +266,19 @@ variable "internal-rules" {
       protocol  = "udp"
       protocol  = "udp"
       comment   = "Let UDP out to the VPC"
       comment   = "Let UDP out to the VPC"
     },
     },
-    {
-      type      = "ingress"
-      from_port = "8080"
-      to_port   = "8080"
-      protocol  = "tcp"
-      comment   = "Allow for host check between nodes"
-    },
+    #    {
+    #      type      = "ingress"
+    #      from_port = "8080"
+    #      to_port   = "8080"
+    #      protocol  = "tcp"
+    #      comment   = "Allow for host check between nodes"
+    #    },
   ]
   ]
 }
 }
 
 
 variable "external-rules" {
 variable "external-rules" {
   description = "Security rules to allow for connectivity external to the VPC"
   description = "Security rules to allow for connectivity external to the VPC"
-  type        = list
+  type        = list(any)
   default = [
   default = [
     {
     {
       type      = "ingress"
       type      = "ingress"