Publishing my first terraform module to terraform registry

taragrg6 profile image taragurung ・1 min read

Today, I thought of publishing my own module to terraform registry. The module is in simplest form now. The module is for setting up S3 with web hosting enabled and distributed to different edge locations using AWS Cloudfront.

Here is the link to my module:

Please feel free to give me valuable suggestions.

Why we use terraform modules?

We create modules in terraform so that we don't write the same terraform script again and again. It is similar to functions in any programming language. We create it once and just call it every time we need it.

These are few key takeaways:

  1. Anyone can publish modules in terraform registry.
  2. The terraform official documentation is well documented, anyone can easily follow and publish the module.
  3. It takes a few seconds to publish your module and make it ready to use.
  4. Make sure you provide enough information on variables and output and good to create one readme file.

What does my module do?

I would not say it's a full fledged module to use but over time I will make it better adding more features. For now it is meant to create a S3 bucket with the input name supplied by the users and enable it for web hosting. It also distributes the content to different AWS edge locations using cloudfront.


Editor guide