A command line tool to help you easily and quickly update CNAMES in your cloudfront distribution!
This can be very helpful for automation purposes and CI/CD (Continuous Integration / Continuous Deployment/Delivery) pipelines that involve the creation of ‘review apps’ or the creation of on-demand environments for each branch that have there own unique URLs..
The package is written in node
and thus may be installed easily via npm
. npm
ships with node
so if you
don’t have it just install node
and you’ll have a working npm
command soon after. On Mac OS you can just use
homebrew like so brew install node
.
npm install cf-cname-ctl -g
Just define the environment variables AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
with your AWS credentials
and you’re ready to go. The simple command this package provides is as follows:
cf-cname-ctl DISTRIBUTION_ID OPERATION CNAME
Where DISTRIBUTION_ID
is the cloudfront distribution id to update,
OPERATION
is one of add
or remove
and CNAME
is the CNAME to act with.
Example:
To remove the CNAME
app.example.com
from the CloudFront distribution with ID S9H3LE11AJ4QAG
:
cf-cname-ctl S9H3LE11AJ4QAG remove app.example.com
To add the CNAME app.example.com from the CloudFront distribution with ID S9H3LE11AJ4QAG
:
cf-cname-ctl S9H3LE11AJ4QAG add app.example.com
Bug reports and pull requests are welcome on GitHub at https://github.com/sufyanadam/cf-cname-ctl. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant.
This npm package is available as open source under the terms of the ISC License.