Skip to content

Instantly share code, notes, and snippets.

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

  • Save KyMidd/4e15b3176034ebc2553967c4e78c4a57 to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/4e15b3176034ebc2553967c4e78c4a57 to your computer and use it in GitHub Desktop.
# If you need to format the IPs to remove the /32s, but keep the other slashes, like /24, as a list:
# ex: ["1.2.3.0/24", "2.3.4.0/24", "1.2.3.4", "5.6.7.8", ...]
output "ips_no_slash_32_list" {
value = [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