I just tried it out, and there was just one little detail that I was banging my head against for the last hour: the shell script needs to start with a shebang like: #!/bin/bash.
Until, I made this change to the script, it was not executing properly on each boot, and I was constantly running into this error in /var/log/cloud-init.log :
I got the hint that the shebang line was needed from this:
cloudinit.util.ProcessExecutionError: Exec format error. Missing #! in script?
that I found over here. Your script is working great now!
I'd also like to point out that you might want to change this line: "Resource": "arn:aws:route53:::hostedzone/Z3NAOAAAA11BB22"
to something like "Resource": "arn:aws:route53:::hostedzone/<YOUR_ROUTE53_ZONE_ID_here>". Just in case someone is not alert enough to modify the literal ZoneId in their IAM policy, when copy+pasting from the article :)
Great article.
I just tried it out, and there was just one little detail that I was banging my head against for the last hour: the shell script needs to start with a shebang like:
#!/bin/bash
.Until, I made this change to the script, it was not executing properly on each boot, and I was constantly running into this error in
/var/log/cloud-init.log
:I got the hint that the shebang line was needed from this:
that I found over here. Your script is working great now!
I'd also like to point out that you might want to change this line:
"Resource": "arn:aws:route53:::hostedzone/Z3NAOAAAA11BB22"
to something like
"Resource": "arn:aws:route53:::hostedzone/<YOUR_ROUTE53_ZONE_ID_here>"
. Just in case someone is not alert enough to modify the literal ZoneId in their IAM policy, when copy+pasting from the article :)Overall, super-useful post. Thank you!
Oops! Sorry for causing you that problem. I've now updated the post.