-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alina Buzachis <[email protected]>
- Loading branch information
1 parent
e104e40
commit 90acb01
Showing
8 changed files
with
117 additions
and
115 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,17 +10,21 @@ | |
- James Turner (!UNKNOWN) <[email protected]> | ||
requirements: | ||
- must have public internet connectivity | ||
short_description: Look up the IP ranges for services provided in AWS such as EC2 and S3. | ||
short_description: Look up the IP ranges for services provided in AWS such as EC2 and S3 | ||
description: | ||
- AWS publishes IP ranges used on the public internet by EC2, S3, CloudFront, CodeBuild, Route53, and Route53 Health Checking. | ||
- This module produces a list of all the ranges (by default) or can narrow down the list to the specified region or service. | ||
options: | ||
service: | ||
description: 'The service to filter ranges by. Options: EC2, S3, CLOUDFRONT, CODEbUILD, ROUTE53, ROUTE53_HEALTHCHECKS' | ||
description: | ||
- The service to filter ranges by. | ||
- Options include V(EC2), V(S3), V(CLOUDFRONT), V(CODEBUILD), V(ROUTE53), V(ROUTE53_HEALTHCHECKS). | ||
region: | ||
description: 'The AWS region to narrow the ranges to. Examples: us-east-1, eu-west-2, ap-southeast-1' | ||
description: | ||
- The AWS region to narrow the ranges to. Examples include V(us-east-1), V(eu-west-2), V(ap-southeast-1). | ||
ipv6_prefixes: | ||
description: 'When I(ipv6_prefixes=True) the lookup will return ipv6 addresses instead of ipv4 addresses' | ||
description: | ||
- When O(ipv6_prefixes=true) the lookup will return ipv6 addresses instead of ipv4 addresses. | ||
version_added: 2.1.0 | ||
""" | ||
|
||
|
@@ -29,17 +33,17 @@ | |
ec2_ranges: "{{ lookup('aws_service_ip_ranges', region='ap-southeast-2', service='EC2', wantlist=True) }}" | ||
tasks: | ||
- name: "use list return option and iterate as a loop" | ||
debug: msg="{% for cidr in ec2_ranges %}{{ cidr }} {% endfor %}" | ||
ansible.builtin.debug: msg="{% for cidr in ec2_ranges %}{{ cidr }} {% endfor %}" | ||
# "52.62.0.0/15 52.64.0.0/17 52.64.128.0/17 52.65.0.0/16 52.95.241.0/24 52.95.255.16/28 54.66.0.0/16 " | ||
- name: "Pull S3 IP ranges, and print the default return style" | ||
debug: msg="{{ lookup('aws_service_ip_ranges', region='us-east-1', service='S3') }}" | ||
ansible.builtin.debug: msg="{{ lookup('aws_service_ip_ranges', region='us-east-1', service='S3') }}" | ||
# "52.92.16.0/20,52.216.0.0/15,54.231.0.0/17" | ||
""" | ||
|
||
RETURN = r""" | ||
_raw: | ||
description: comma-separated list of CIDR ranges | ||
description: Comma-separated list of CIDR ranges. | ||
""" | ||
|
||
import json | ||
|
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
Oops, something went wrong.