-
Notifications
You must be signed in to change notification settings - Fork 9
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
use private ip when the public is empty string #268
Conversation
@@ -55,7 +55,7 @@ module "agent_gw" { | |||
instance_profile_name = var.agent_gw_instance_profile_name | |||
|
|||
management_server_host_for_registration = module.mx[0].private_ip | |||
management_server_host_for_api_access = module.mx[0].public_ip | |||
management_server_host_for_api_access = module.mx[0].public_ip == null || module.mx[0].public_ip == "" ? module.mx[0].private_ip : module.mx[0].public_ip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'module.mx[0].public_ip == ""' - this can't happen since you have disabled this option. Right?
If so, this reduces the readability of this fie. Please remove.
I think it is best to use coalesce function. Please consider -
https://developer.hashicorp.com/terraform/language/functions/coalesce
No description provided.