Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created September 23, 2021 22:58
Show Gist options
  • Select an option

  • Save KyMidd/928cfd64ac248d07830ea0d95781c531 to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/928cfd64ac248d07830ea0d95781c531 to your computer and use it in GitHub Desktop.
# And if you need to remove all /32, but keep other slashes, and use list as CSVs, as a string:
# ex: "1.2.3.0/24,2.3.4.0/24,1.2.3.4,5.6.7.8,..."
output "ips_no_slash_32_join_with_comma_string" {
value = join(",", [for ip in local.blocked_ips : replace(ip, "/32", "")])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment