Skip to content

Commit

Permalink
Merge pull request #208 from jankaacc/azure-tf-example
Browse files Browse the repository at this point in the history
Add example for provider config terraform for Azure
  • Loading branch information
ytsarev committed Nov 14, 2023
2 parents 39d3807 + 6d6d766 commit e74e50b
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 e74e50b

Please sign in to comment.