Last active
October 30, 2019 18:39
-
-
Save jonathanhle/68a983dc9c9015d2c642c43b43f6c6e3 to your computer and use it in GitHub Desktop.
repeat pagerduty tf module for maintenance windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tf_mod_instance=42 | |
day=1 | |
month=02 | |
year=2019 | |
for i in {1..28} | |
do | |
if ((day >= 1 && day <= 9)) | |
then | |
format_day="0${day}" | |
else | |
format_day="${day}" | |
fi | |
echo " | |
resource \"pagerduty_maintenance_window\" \"pagerduty_maint_window_aws_cloudWatch${tf_mod_instance}\" { | |
start_time = \"${year}-${month}-${format_day}T08:30:00Z\" | |
end_time = \"${year}-${month}-${format_day}T09:30:00Z\" | |
services = [\"P44QO9U\"] | |
}" | |
day=$((day + 1)) | |
tf_mod_instance=$((tf_mod_instance + 1)) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment