Terraform Module Sources
Step-01: Introduction
Step-02: c3-static-website.tf
# Call our Custom Terraform Module which we built earlier
module "azure_static_website" {
# Terraform Local Module
#source = "./modules/azure-static-website"
# Terraform Public Registry
#source = "stacksimplify/staticwebsitepb/azurerm"
#version = "1.0.0"
# Terraform Local Module
#source = "./modules/azure-static-website"
# Terraform Public Registry
#source = "stacksimplify/staticwebsitepb/azurerm"
#version = "1.0.0"
# Github Clone over HTTPS
source = "github.com/stacksimplify/terraform-azurerm-staticwebsitepublic"
# Github Clone over SSH (if git SSH configured with your repo - https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh)
#source = "git@github.com:stacksimplify/terraform-azurerm-staticwebsitepublic.git"
# Github HTTPS with selecting a Specific Release Tag
#source = "git::https://github.com/stacksimplify/terraform-azurerm-staticwebsitepublic.git?ref=1.0.0"
# Resource Group
location = "eastus"
resource_group_name = "myrg1"
# Storage Account
storage_account_name = "staticwebsite"
storage_account_tier = "Standard"
storage_account_replication_type = "LRS"
storage_account_kind = "StorageV2"
static_website_index_document = "index.html"
static_website_error_404_document = "error.html"
}
# Terraform Initialize
terraform init
# Verify
cd .terraform
ls
cd modules
ls
cd azure_static_website
ls
cd ../../../
# Clean-Up
rm -rf .terraform*
- Github clone over ssh
module "azure_static_website" {
source = "git@github.com:stacksimplify/terraform-azurerm-staticwebsitepb.git"
...
... other code
}
- Bitbucket
module "azure_static_website" {
source = "bitbucket.org/stacksimplify/terraform-azurerm-staticwebsitepb"
...
... other code
}
- Like this many more options we have. Refer Terraform Modules Sources for detailed documentation
Step-05: Exam Question
- One question will come from this section for sure.
- Asking us to select the right Terraform Module Source syntax.