Skip to content

Commit

Permalink
Merge branch 'allow-ipv6-ipranges' of github.com:abhattacharyaNS1/ama…
Browse files Browse the repository at this point in the history
…zon.aws into allow-ipv6-ipranges
  • Loading branch information
abhattacharyaNS1 committed Aug 25, 2021
2 parents 588ed10 + 02cc532 commit 86ad7c9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugins/lookup/aws_service_ip_ranges.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
description: 'The service to filter ranges by. Options: EC2, S3, CLOUDFRONT, CODEbUILD, ROUTE53, ROUTE53_HEALTHCHECKS'
region:
description: 'The AWS region to narrow the ranges to. Examples: us-east-1, eu-west-2, ap-southeast-1'
ipv6_prefix:
description: 'Return only ipv6 addresses. Option: ipv6_prefix=True'
ipv6_prefixes:
description: 'Return only ipv6 addresses. Option: ipv6_prefixes=True'
'''

EXAMPLES = """
Expand Down Expand Up @@ -72,12 +72,12 @@ def valid_cidr(Ip):

class LookupModule(LookupBase):
def run(self, terms, variables, **kwargs):
if "ipv6_prefix" in kwargs["ipv6_prefix"] is False:
prefixes_label = "prefixes"
ip_prefix_label = "ip_prefix"
else:
if "ipv6_prefix" in kwargs and kwargs["ipv6_prefix"]:
prefixes_label = "ipv6_prefixes"
ip_prefix_label = "ipv6_prefix"
else:
prefixes_label = "prefixes"
ip_prefix_label = "ip_prefix"

try:
resp = open_url('https://ip-ranges.amazonaws.com/ip-ranges.json')
Expand Down

0 comments on commit 86ad7c9

Please sign in to comment.