Skip to content

Instantly share code, notes, and snippets.

View espen's full-sized avatar

Espen Antonsen espen

View GitHub Profile
@espen
espen / ec2hostname.rb
Last active October 20, 2016 10:30 — forked from kixorz/ec2hostname.rb
EC2 Instance Route53 Hostname registration init.d script. Instance needs to have the attached IAM instance role policy applied.
#!/usr/bin/ruby
# chkconfig: 35 99 01
# description: EC2 DNS registration
# processname: ec2hostname
require 'aws-sdk'
require 'net/http'
require 'socket'
`touch /var/lock/subsys/ec2hostname`