Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform crash when resource does not have a public network #16

Closed
yussufsh opened this issue Jul 23, 2020 · 1 comment · Fixed by #17
Closed

Terraform crash when resource does not have a public network #16

yussufsh opened this issue Jul 23, 2020 · 1 comment · Fixed by #17

Comments

@yussufsh
Copy link
Contributor

The terraform module will crash with index out of bound error as mentioned in IBM-Cloud/terraform-provider-ibm#1701

TF provider assume there will always be 1 and only 1 public network within a resource instance.

As observed on UI the public network is created automatically when a VM with public network is created. Also once the allocation pool is completely utilized it will create a new public network with different subnet. Still, TF provider will return the first indexed network.

@yussufsh
Copy link
Contributor Author

The workaround here is to always create a new public network and use that for the bastion node.

In such scenario, a new public subnet will be created for every cluster on the resource. This can add to the cost but needed to have stable deployments.

We also get the public network gateway address if we follow above approach. Which is currently not possible using ibm_pi_public_network data source.

Potential Issue: TF will fail to delete the public network when a cluster is destroyed. This will happen when other machines (manually created from UI) use this public network. This can be mentioned in the known issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant