Skip to content

Instantly share code, notes, and snippets.

@rynop
Last active February 11, 2021 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rynop/11b498cfeda0be5a10b34e1d966d33f5 to your computer and use it in GitHub Desktop.
Save rynop/11b498cfeda0be5a10b34e1d966d33f5 to your computer and use it in GitHub Desktop.
Clone WAF IP Set
# This example exports a regional rule, targeted for importing into cloudfront
aws wafv2 get-ip-set --scope REGIONAL --output=json --name=my-ip-set --id foo | jq -c '.IPSet | del(.Id,.ARN) + {Scope: "CLOUDFRONT"}' > my-ip-set.json
# Cloudfront is always us-east-1
aws wafv2 create-ip-set --region=us-east-1 --cli-input-json file://my-ip-set.json
@rynop
Copy link
Author

rynop commented Feb 10, 2021

See WAF cli docs at https://docs.aws.amazon.com/cli/latest/reference/wafv2/get-ip-set.html and https://docs.aws.amazon.com/cli/latest/reference/wafv2/create-ip-set.html

Note: when calling create-ip-set the Description in the .json must be set, and can not be the empty string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment