diff --git a/modules/single-node-asg/main.tf b/modules/single-node-asg/main.tf index f147eeca..b7d7f6f4 100644 --- a/modules/single-node-asg/main.tf +++ b/modules/single-node-asg/main.tf @@ -54,6 +54,7 @@ module "service-data" { resource "aws_eip" "eip" { count = var.assign_eip ? 1 : 0 + vpc = true } resource "aws_iam_role_policy_attachment" "associate_eip" { @@ -81,17 +82,17 @@ data "aws_iam_policy_document" "associate_eip_policy_doc" { module "server" { source = "../asg" - ami = var.ami - elb_names = var.load_balancers - key_name = var.key_name + ami = var.ami + elb_names = var.load_balancers + key_name = var.key_name # The IAM Instance Profile w/ attach_ebs role - iam_profile = module.instance_profile.iam_profile_id - instance_type = var.instance_type + iam_profile = module.instance_profile.iam_profile_id + instance_type = var.instance_type # 1 EC2 instance <> 1 EBS volume - max_nodes = 1 - min_nodes = 1 - placement_group = var.placement_group - public_ip = var.public_ip + max_nodes = 1 + min_nodes = 1 + placement_group = var.placement_group + public_ip = var.assign_eip ? false : var.public_ip # the prefix and suffix names are combined in # the `asg` module to create the full name name_prefix = var.name_prefix @@ -130,5 +131,3 @@ module "init-attach-ebs" { module "init-install-awscli" { source = "../init-snippet-install-awscli" } - -