Through this article you will learn to create a terraform module for a static website and publish it to the terraform registry. Before going ahead, you need to have some basic understanding of terraform.
Step-1:
Create an account on terraform registry.
Step-2:
Create a directory in your local machine following a proper naming convention like “terraform-azurerm-<name of the module>”. In this case I will use “terraform-azurerm-static-website”. Create the following files in your directory:
- main.tf
- variables.tf
- output.tf
- versions.tf
- readme.md
Your directory must look like this: