ibm-cloud-architecture / terraform-icp-aws

This Terraform configurations uses the AWS provider to provision virtual machines on AWS to prepare VMs and deploy IBM Cloud Private on them. This Terraform template automates best practices learned from installing ICP on AWS at numerous client sites in production.
9 stars 30 forks source link

Elastic IP deployed into wrong scope #11

Open lindluni opened 6 years ago

lindluni commented 6 years ago

When running terraform apply the provider was reporting back that no Elastic IP was available with the associated tag. This was being caused by the fact that AWS now makes you choose the EIP Scope at provisioning, or wait 24 hours to update. I was able to get around this by adding the vpc = true property to the network.tf file under the aws_eip resource. The updated EIP Resource looks like this:

resource "aws_eip" "icp_ngw_eip" {
  vpc = true
  count = "${length(var.azs)}"
  tags = "${merge(
    var.default_tags,
    map("Name", "${format("${var.subnetname}-${random_id.clusterid.hex}-ngw-eip-%1d", count.index + 1)}"),
    map("kubernetes.io/cluster/${random_id.clusterid.hex}", "${random_id.clusterid.hex}")
  )}"
}