https://github.com/happydemics/aws-ip-ranges
Ruby Gem - Fetching AWS ip ranges with ease
https://github.com/happydemics/aws-ip-ranges
aws gem library managed-by-terraform ruby semver
Last synced: 2 months ago
JSON representation
Ruby Gem - Fetching AWS ip ranges with ease
- Host: GitHub
- URL: https://github.com/happydemics/aws-ip-ranges
- Owner: happydemics
- License: mit
- Created: 2022-10-07T15:39:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-13T13:41:26.000Z (over 2 years ago)
- Last Synced: 2025-04-03T11:40:28.007Z (about 1 year ago)
- Topics: aws, gem, library, managed-by-terraform, ruby, semver
- Language: Ruby
- Homepage: https://rubygems.org/gems/aws-ip-ranges
- Size: 106 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# `aws-ip-ranges`
[](https://badge.fury.io/rb/aws-ip-ranges)

Retrieve AWS IP ranges with ease.
## Installation
Run:
```sh
gem install aws-ip-ranges
```
## Usage
### Code
```ruby
AwsIpRanges.fetch(service: ['cloudfront', 's3']) # => [#, #]
AwsIpRanges.fetch(region: 'eu-west-3')
AwsIpRanges.fetch(only_ipv4: true)
AwsIpRanges.fetch(only_ipv6: true)
```
### CLI
Execute:
```sh
$ aws-ip-ranges list
35.172.155.192/27
35.172.155.96/27
44.192.134.240/28
...
2600:1f70:c000:400::/56
```
See the help for more usage:
```sh
Command:
aws-ip-ranges list
Usage:
aws-ip-ranges list
Description:
List all AWS IP ranges
Options:
--[no-]only-ipv6 # Whether to include only IPv6 ranges., default: false
--[no-]only-ipv4 # Whether to include only IPv4 ranges., default: false
--service=VALUE1,VALUE2,.. # Which services to include. By default, includes all.
--region=VALUE1,VALUE2,.. # Which regions to include. By default, includes all.
--help, -h # Print this help
Examples:
aws-ip-ranges list # Prints all AWS IP ranges
aws-ip-ranges list --only-ipv4 # Prints all AWS IPv4 ranges
aws-ip-ranges list --only-ipv6 --service=cloudfront,global # Prints AWS Cloudfront and Global IPv6 ranges
aws-ip-ranges list --only-ipv6 --service=s3 --region=eu-west-1 # Prints AWS S3 IPv6 ranges in the eu-west-1 region
```
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
We are not accepting outside contribution on this library at the moment.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).