Skip to content

Instantly share code, notes, and snippets.

@jhanley-com
Last active January 6, 2021 02:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhanley-com/335a9b949e67d9027590219216279811 to your computer and use it in GitHub Desktop.
Save jhanley-com/335a9b949e67d9027590219216279811 to your computer and use it in GitHub Desktop.
Terraform Azure Service Principal - Part 2
# Test code for the question: https://stackoverflow.com/q/65525116/8016720
# Provides configuration details for Terraform
terraform {
required_version = ">= 0.14.3, < 0.15.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>2.41"
}
}
}
# Provides configuration details for the Azure Terraform provider
provider "azurerm" {
# !!! Must include features even if empty
features {}
subscription_id = ""
client_id = ""
client_secret = "long-random-string"
tenant_id = ""
}
# Provides the Resource Group to logically contain resources
resource "azurerm_resource_group" "rg" {
name = "terraform-test-rg-4"
location = "westus2"
tags = {
environment = "dev"
source = "Terraform"
owner = "John Hanley"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment