Module configures IAM permissions that allow cert-manager to be integrated with the Azure DNS service for DNS-01 ACME challenges.
Once you have a Corewide Solutions Portal account, this one-time action will use your browser session to retrieve credentials:
shellterraform login solutions.corewide.com
Initialize mandatory providers:
Copy and paste into your Terraform configuration and insert the variables:
hclmodule "tf_k8s_cert_manager_dns_azure" {
source = "solutions.corewide.com/azure/tf-k8s-cert-manager-dns-azure/azurerm"
version = "~> 2.0.0"
# specify module inputs here or try one of the examples below
...
}
Initialize the setup:
shellterraform init
Corewide DevOps team strictly follows Semantic Versioning
Specification
to
provide our clients with products that have predictable upgrades between versions. We
recommend
pinning
patch versions of our modules using pessimistic
constraint operator (~>) to prevent breaking changes during upgrades.
To get new features during the upgrades (without breaking compatibility), use
~> 2.0 and run
terraform init -upgrade
For the safest setup, use strict pinning with version = "2.0.0"
|
Module
85% off
|
€50
|
| TOTAL | €50 |
Module configures IAM permissions that allow cert-manager to be integrated with the Azure DNS service for DNS-01 ACME challenges.
All notable changes to this project are documented here.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
5.0(Last version compatible with the Azure Terraform provider version 4.0)
4.57First stable version
v1.x to v2.xModule from v2.0 has changed Azure Terraform provider version, which isn't compatible with older versions. After the module version is upgraded, re-init the module to upgrade the provider version. Upgrade the Azure provider version at the project level:
hclterraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 5.0"
}
}
}
Upgrade project dependencies:
bashterraform init --upgrade
Update the declaration of the module according to the requirements and examples to match the designed configuration, then the configuration can be applied.
Apply the changes to make sure the state of the resources is up-to-date with the new provider version:
bashterraform apply
Setup with custom cert-manager Kubernetes ServiceAccount name, namespace, tags, DNS zone ID fetched from tf-azure-dns module, OIDC provider URL fetched from the tf-azure-k8s-aks module and outputs passed to the tf-k8s-cert-manager module:
hclmodule "aks" {
source = "solutions.corewide.com/azure/tf-azure-k8s-aks/azurerm"
version = "~> 6.0"
# ...
}
resource "azurerm_resource_group" "main" {
name = "foo"
location = "westus2"
}
module "dns" {
source = "solutions.corewide.com/azure/tf-azure-dns/azurerm"
version = "~> 2.0"
resource_group_name = azurerm_resource_group.main.name
create_zone = true
zone_name = "example.com"
records = {
"@" = {
type = "A"
ttl = 300
value = ["192.0.2.1"]
}
}
}
module "azure_cert_manager" {
source = "solutions.corewide.com/azure/tf-k8s-cert-manager-dns-azure/azurerm"
version = "~> 2.0"
name_suffix = "foo"
resource_group_name = azurerm_resource_group.main.name
region = azurerm_resource_group.main.location
hosted_zone_name = "example.com"
hosted_zone_id = module.dns.zone.id
subscription_id = "bar"
oidc_provider_url = module.aks.cluster.oidc_issuer_url
cert_manager_namespace = "cert-manager-foo"
cert_manager_sa_name = "cert-manager-bar"
tags = {
env = "example"
}
}
module "cert_manager" {
source = "solutions.corewide.com/kubernetes/tf-k8s-cert-manager/helm"
version = "~> 2.1"
acme_email = "[email protected]"
ingress_classes = ["nginx"]
dns_solver_config = module.azure_cert_manager.issuer_spec
service_account_labels = module.azure_cert_manager.service_account_label
pod_labels = module.azure_cert_manager.pod_label
}
Minimal setup with mandatory parameters, DNS zone ID fetched from tf-azure-dns module, OIDC provider URL fetched from the tf-azure-k8s-aks module and outputs passed to the tf-k8s-cert-manager module:
hclmodule "aks" {
source = "solutions.corewide.com/azure/tf-azure-k8s-aks/azurerm"
version = "~> 6.0"
# ...
}
resource "azurerm_resource_group" "main" {
name = "foo"
location = "westus2"
}
module "dns" {
source = "solutions.corewide.com/azure/tf-azure-dns/azurerm"
version = "~> 2.0"
resource_group_name = azurerm_resource_group.main.name
create_zone = true
zone_name = "example.com"
records = {
"@" = {
type = "A"
ttl = 300
value = ["192.0.2.1"]
}
}
}
module "azure_cert_manager" {
source = "solutions.corewide.com/azure/tf-k8s-cert-manager-dns-azure/azurerm"
version = "~> 2.0"
resource_group_name = azurerm_resource_group.main.name
region = azurerm_resource_group.main.location
hosted_zone_name = "example.com"
hosted_zone_id = module.dns.zone.id
subscription_id = "bar"
oidc_provider_url = module.aks.cluster.oidc_issuer_url
}
module "cert_manager" {
source = "solutions.corewide.com/kubernetes/tf-k8s-cert-manager/helm"
version = "~> 2.1"
acme_email = "[email protected]"
ingress_classes = ["nginx"]
dns_solver_config = module.azure_cert_manager.issuer_spec
service_account_labels = module.azure_cert_manager.service_account_label
pod_labels = module.azure_cert_manager.pod_label
}
| Variable | Description | Type | Default | Required | Sensitive |
|---|---|---|---|---|---|
hosted_zone_id |
Azure DNS hosted zone ID | string |
yes | no | |
hosted_zone_name |
Azure DNS hosted zone name | string |
yes | no | |
oidc_provider_url |
OpenID Connect provider URL | string |
yes | no | |
region |
Region of a resource group to create resources in | string |
yes | no | |
resource_group_name |
Name of the resource group to create resources in | string |
yes | no | |
subscription_id |
Azure subscription ID to create resources in | string |
yes | no | |
cert_manager_namespace |
Kubernetes namespace to configure RBAC for cert-manager in | string |
cert-manager |
no | no |
cert_manager_sa_name |
Kubernetes cert-manager's ServiceAccount name to configure RBAC for |
string |
cert-manager |
no | no |
name_suffix |
Name suffix for RBAC resources to create | string |
cert-manager |
no | no |
tags |
Map of tags to assign to resources | map(string) |
{} |
no | no |
| Output | Description | Type | Sensitive |
|---|---|---|---|
issuer_spec |
cert-manager parameters for Azure DNS DNS-01 ACME challenge provider | map |
no |
pod_label |
Label to add to the cert-manager controller's Pod |
map |
no |
service_account_label |
Label to add to the cert-manager controller's ServiceAccount |
map |
no |
| Dependency | Version | Kind |
|---|---|---|
terraform |
>= 1.3 |
CLI |
hashicorp/azurerm |
~> 5.0 |
provider |