public
Last active

creates a custom origin for cloudfront. EASY CDN!

  • Download Gist
create_custom_origin.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
import boto
# requires cf_customorigin branch
# https://github.com/boto/boto/tree/cf_customorigin
 
origin_domain = 'www.example.org'
cdn_cname = ['media.example.org']
caller_reference = 'exmaple Distribution'
 
c = boto.connect_cloudfront()
d = c.create_custom_distribution(
dns_name=origin_domain,
enabled=True,
caller_reference=caller_reference,
cnames=cdn_cname
)
print 'cname '+ cdn_cname + ' to ' d.domain_name

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.