Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 1.05 KB

File metadata and controls

25 lines (17 loc) · 1.05 KB

PAYPAL DONTAION
paypal

awscli-secgroup-dns-to-ip-autoupdate

This bash script create/update automatically a rule in AWS EC2 security group starting from a FQDN (dynamic dns)

With this bash script you can simply add or update a security group aws ec2 rule with a dynamic ip using a Dynamic DNS name.

USAGE ISTRUCTIONS:

PREREQUISITES:

  • aws cli installed and configured

Please set the variable in top of script:

GROUPID= --> SECURITY GROUP ID
PROTOCOL=tcp --> PROTOCOL TO OPEN
PORT=22 --> PORT TO OPEN
PROFILE= --> PROFILE OF your aws cli (if you have more than one) else you can keep default
DDNSNAME= --> put your dynamic dns name like no-ip or ddns etc...

Copy this script to a machine with aws cli installed

Create a crontab to execute script every 5/10 minutes like:

*/5 * * * * /myscript/awscli-secgroup-dns-to-ip-autoupdate.sh