Skip to content

Commit

Permalink
Add example for provider config terraform for Azure
Browse files Browse the repository at this point in the history
  • Loading branch information
jankaacc committed Nov 2, 2023
1 parent a7880a0 commit af401f3
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions examples/providerconfig-azure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
apiVersion: v1
kind: Secret
metadata:
name: azure-creds
type: Opaque
stringData:
"credentials": |-
{
"clientId": "wwwww~wwwwwwwww",
"clientSecret": "xxxx-xxxx-xxxx-xxxx-xxxx",
"tenantId": "yyyy-yyyy-yyyy-yyyy-yyyy",
"subscriptionId": "zzzz-zzzz-zzzz-zzzz-zzzz"
}
---
apiVersion: tf.upbound.io/v1beta1
kind: ProviderConfig
metadata:
name: azure-westeurope
spec:
credentials:
# Filename has to comply with below naming convention:
# - Files named exactly terraform.tfvars or terraform.tfvars.json.
# - Any files with names ending in .auto.tfvars or .auto.tfvars.json.
- filename: terraform.tfvars.json
source: Secret
secretRef:
namespace: upbound-system
name: azure-creds
key: credentials
configuration: |
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.78.0"
}
}
backend "kubernetes" {
secret_suffix = "providerconfig-azure-westeurope"
namespace = "upbound-system"
in_cluster_config = true
}
}
variable "subscriptionId" {
type = string
}
variable "tenantId" {
type = string
}
variable "clientId" {
type = string
}
variable "clientSecret" {
type = string
}
provider "azurerm" {
subscription_id = var.subscriptionId
tenant_id = var.tenantId
client_id = var.clientId
client_secret = var.clientSecret
features {}
}

0 comments on commit af401f3

Please sign in to comment.