- 申请API Key
12345#AWS打开 https://console.aws.amazon.com/iam/home?region=ap-northeast-1#/security_credentials 申请即可#Cloudflare打开 https://www.cloudflare.com/ 登陆后选择右上角My Profile 复制最下方的Global API Key - 安装AWS CLI
1234567#Debian/Ubuntuapt install python-pip -ypip install awscli#CentOSyum install python-pip -ypip install awscli - 下载脚本并修改
1wget https://share.moeking.me/Shell/AWS/aws.sh && chmod +x aws.sh - 运行脚本
12#default为变量 具体查看脚本内容bash ./aws.sh default - 实例区域参数
123456789101112131415161718亚太ap-northeast-1 #东京ap-northeast-2 #首尔ap-southeast-1 #新加坡ap-southeast-2 #悉尼ap-south-1 #孟买欧洲eu-central-1 #法兰克福eu-west-1 #爱尔兰eu-west-2 #伦敦eu-west-3 #巴黎北美us-east-1 #弗吉尼亚州us-east-2 #俄亥俄州us-west-2 #俄勒冈州ca-central-1 #蒙特利尔 - 备注
- 已知BUG: 同一区域实例数量≥2时 会筛选出多个IP
- 在/tmp下手动创建一个名为aws的文件夹 否则无法正常运行
- crontab定时任务无法运行 在#!/usr/bin/env bash下添加
12PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/binexport PATH
来源详情: AWS Lightsail 更换IP脚本