Example usage of Certbot's CloudFlare plugin:
$ sudo certbot certonly \
--non-interactive \
--agree-tos \
| #!/usr/bin/env python3 | |
| import pkg_resources | |
| dists = [str(d).replace(" ","==") for d in pkg_resources.working_set] | |
| for i in dists: | |
| print(i) |
| #!/usr/bin/env bash | |
| TOKEN_TTL=900 # 15 minutes | |
| ROLE="$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/)" | |
| TOKEN="$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: ${TOKEN_TTL}")" | |
| CREDS="$(curl -s -H "X-aws-ec2-metadata-token: ${TOKEN}" "http://169.254.169.254/latest/meta-data/iam/security-credentials/${ROLE}")" | |
| REGION=$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r .region) | |
| AWS_ACCESS_KEY_ID="$(echo "${CREDS}" | jq -r .AccessKeyId)" | |
| AWS_SECRET_ACCESS_KEY="$(echo "${CREDS}" | jq -r .SecretAccessKey)" |
| #!/usr/bin/env python | |
| # prints all the records in all the zones in colums separated by ','. | |
| # It uses raw mode to handle pagination to iterate over zones and records | |
| import CloudFlare | |
| separator="," | |
| cf = CloudFlare.CloudFlare(token='REPLACE_WITH_YOUR_OWN_CF_TOKEN', raw=True) | |
| per_page = 10 |