Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Specify VPC scope for EIP in single-node-asg
Browse files Browse the repository at this point in the history
  • Loading branch information
Magicloud committed Apr 16, 2020
1 parent 4b27c5e commit fa52cd5
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions modules/single-node-asg/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -130,5 +131,3 @@ module "init-attach-ebs" {
module "init-install-awscli" {
source = "../init-snippet-install-awscli"
}


0 comments on commit fa52cd5

Please sign in to comment.