Sends an email when Amazon CloudFront IP addresses are updated
- Lightweight Library
- Checks Amazon CloudFront IP and alert user.
- Can easily integrate with email notification or 3rd party notification.
The easiest way to install is via Composer.
{
"require": {
"Achievers/cloudfront-ip-alert": "0.*"
}
}
Take a look at index.php for an example. Here is a quick start:
require_once('CloudFront/IPWhiteList.class.php');
use Achievers\CloudFront\IPWhiteList;
$cloudFrontIP = new IPWhiteList(); // Initialize a class
$listOfIPs = $cloudFrontIP->getLastCloudFrontFile(); //Get the latest CloudFront file
$data = $cloudFrontIP->checkIP($listOfIPs); //Return a list of changes
You can pass in configuration for customization cloudFrontFolder : This is the directory where you want to store the downloaded CloudFront IP file. We will keep a copy of the most recent file.
cloudFrontType : The CloudFront file from Amazon contains IP of different services. Default is "CLOUDFRONT".
cloudFrontLastFile : The is the file name where we will store the most recent file as. Default 'ip-ranges-old.json'.
cloudFrontUrl : The URL to Amazon CloudFront file. Default 'https://ip-ranges.amazonaws.com/ip-ranges.json'
MIT License