There are two parts to this:
- Managing access to non-public S3 resources.
- Building RPM repositories in an automated, deterministic way that Yum can use.
In general, a CentOS 7 x86_64 box in AWS EC2; in specific, this Packer profile.
| import requests | |
| import time | |
| import os | |
| import json | |
| import boto3 | |
| import ipaddress | |
| import socket | |
| import base64 | |
| import zlib | |
| import datetime |
| # first we download the list of IP ranges from CloudFlare | |
| wget https://www.cloudflare.com/ips-v4 | |
| # iterate over the lines in the downloaded file | |
| # make sure to set `--group-id` and `--port`; more details at http://docs.aws.amazon.com/cli/latest/reference/ec2/authorize-security-group-ingress.html | |
| while read p; do aws ec2 authorize-security-group-ingress --group-id sg-e0000000 --protocol tcp --port 80 --cidr $p; done< ips-v4 |
There are two parts to this:
In general, a CentOS 7 x86_64 box in AWS EC2; in specific, this Packer profile.