Last active
July 27, 2017 09:35
-
-
Save Mikulas/f349882a3b5b562200ee74711834fc82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE "vpc" SET "crosszone" = CASE | |
-- Get those values from a list of AWS VPC Subnets: | |
WHEN dstaddr::inet << '172.31.16.0/20' AND srcaddr::inet << '172.31.16.0/20' | |
THEN 0 | |
WHEN dstaddr::inet << '172.31.0.0/20' AND srcaddr::inet << '172.31.0.0/20' | |
THEN 0 | |
ELSE 1 | |
END, "external" = CASE | |
-- This is a combined CIDR of all the subnets. If you can't simplify | |
-- into a single condition, add more cases. | |
WHEN dstaddr::inet << '172.31.0.0/16' AND srcaddr::inet << '172.31.0.0/16' | |
THEN 0 | |
ELSE 1 | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment