Skip to content

Instantly share code, notes, and snippets.

@pkazmierczak
Created January 28, 2016 13:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkazmierczak/68601e272d12a4745331 to your computer and use it in GitHub Desktop.
Save pkazmierczak/68601e272d12a4745331 to your computer and use it in GitHub Desktop.
WAF IPSet with troposphere
from troposphere import Template
from troposphere.waf import IPSet
t = Template()
t.add_description("CF Template for setting IP ranges for whitelisting on the WAF.")
Whitelist1 = t.add_resource(IPSet(
"internaladdresses",
Name="Internal_addresses",
IPSetDescriptors=[
{
"Type": "IPV4",
"Value": "192.0.2.44/32"
},
{
"Type": "IPV4",
"Value": "192.0.7.0/24"
}
]
))
print(t.to_json())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment