This repository manage my azure resources with terraform and terragrunt. For user not using terragrunt, check our archived version terraform-azure
terraform 0.13.5 terragrunt 0.26.0
NEW_PROJECT_NAME=my-awesome-azure
cp -r chechia ${NEW_PROJECT_NAME}
# cd to base/dev/staging/prod environment
cd ${NEW_PROJECT_NAME}/base/foundation
Edit environments
- resource group name
- storage account name
- storage container name
vim env.tfvars
az login
az account list
az account set --subscription="SUBSCRIPTION_ID"
export SUBSCRIPTION_ID="SUBSCRIPTION_ID"
terragrunt init && terragrunt plan
- Azure-cli Azure doc: Install azure-cli
- Terraform Azure doc: configure terraform using azure cloud shell
- Terragrunt Github: terragrunt
Azure doc: get started with azure cli
This project use credential from azure-cli.
az login
Azure doc: create storage account
Azure doc: Configure storage account
RESOURCE_GROUP_NAME=base
LOCATION=southeastasia
az group create \
--name ${RESOURCE_GROUP_NAME} \
--location ${LOCATION}
STORAGE_ACCOUNT_NAME=""
az storage account create \
--name ${STORAGE_ACCOUNT_NAME} \
--resource-group ${RESOURCE_GROUP_NAME} \
--location ${LOCATION} \
--sku Standard_LRS \
--kind StorageV2
CONTAINER_NAME=base
az storage container create \
--account-name ${STORAGE_ACCOUNT_NAME} \
--name ${CONTAINER_NAME} \
--auth-mode login