Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for provider config terraform for Azure #208

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is pretty cool trick, worth highlighting it with the comment :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had it at the beginning :) will add this

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 {}
}