Skip to content

Commit

Permalink
feat: add more to part 3 draft
Browse files Browse the repository at this point in the history
  • Loading branch information
WayneGoosen committed Jul 3, 2024
1 parent 9dbad03 commit 34ac101
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/content/blog/streamlit-deployment-guide-part-3-azure-infra.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ The code is split into the following files:

### main.tf

This Terrafom configuration assumes the resource group has already been created and permissions assigned only to this reasource group for the service principle. This data source uses the `resource_group_name` variable to retrieve the azurerm_resource_group information.

```hcl
data "azurerm_resource_group" "rg" {
name = var.resource_group_name
Expand All @@ -50,6 +52,10 @@ data "azurerm_resource_group" "rg" {

### providers.tf

This is the basic providers configuration. As we are using Azure, the azurerm provider is specified along with the backend configuration to store the tfstate within a storage account within Azure. random provide is also added as it is used to generate some random characters as you will see later.

See [providers configuration](https://developer.hashicorp.com/terraform/language/providers/configuration)

```hcl
terraform {
required_providers {
Expand Down Expand Up @@ -80,6 +86,8 @@ provider "azurerm" {

### variables.tf

This file holds all the variable definitions. Allowing us to provide any custom values to our Terraform resources. See the description of the variable to understand each.

```hcl
variable "resource_group_name" {
type = string
Expand Down Expand Up @@ -143,6 +151,8 @@ variable "environment" {

### locals.tf

See [locals](https://developer.hashicorp.com/terraform/language/values/locals)

```hcl
locals {
app_service_plan_name = "asp-${var.app_name}"
Expand Down

0 comments on commit 34ac101

Please sign in to comment.