Initialize terraform plan with auth details

This commit is contained in:
Gal Szkolnik 2023-07-30 13:53:38 +00:00
parent 10ec319c03
commit e3f5954739
3 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,14 @@
# 3rd Assignment
## Main Challanges
My main challange is the lack of experience with Azure envrionments.
However, the requiremetns were pretty straight forward, and so, I
started with reviewing the tools available to work with terrafom and
Azure.
The tool that seems to be a good fit, is the [aztexport](https://github.com/Azure/aztfexport)
utility, which exports an existing azure state into a collecton of
terraform plan files.
This helped me with understanding the particulars of the environment.

24
src/ASSIGNMENT-03/init.tf Normal file
View File

@ -0,0 +1,24 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>2.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
provider "azurerm" {
features {}
subscription_id = "ced61991-09cf-4e19-a773-fa454609e1ed"
tenant_id = "6b4b1b0d-23f1-4063-bbbd-b65e2984b893"
# Client ID of SzTerraform service-prinicipal:
# Azure Active Directory -> App registration -> SzTerraform
client_id = "0de043f8-9006-4791-baa1-f48a60809c1c"
client_secret = local.secret
}

View File

@ -0,0 +1,8 @@
# Copy this file into local.init.tf (which is in .gitignore) as fill
# in the secret's value
locals {
# Secret for the SzTerraform service-prinicipal:
# Azure Active Directory -> App registration -> SzTerraform -> Certificates & secrets
secret = "<Secret>"
}