rh-mobb / terraform-provider-azureopenshift

[Deprecated] Terraform provider for Azure Red Hat OpenShift. Please use Microsoft Official Provider https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/redhat_openshift_cluster
10 stars 10 forks source link

DEPRECATED

WARN: Please note that this provider is now considered deprecated in favor of https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/redhat_openshift_cluster.

Terraform Provider Azure Redhat Openshift

This is a provider to create Azure Redhat Openshift

Prerequistes

Authencation

Create Azure network with two empty subnets

Create a service principal

Give Red Hat Openshift Resource Provider network contributor role of Azure network

OPENSHIFT_RP_OBJECT_ID=$(az ad sp list --filter "displayname eq 'Azure Red Hat OpenShift RP'" --query "[?appDisplayName=='Azure Red Hat OpenShift RP'].objectId" --only-show-errors --output tsv)
az role assignment create --role "Network Contributor" --assignee-object-id ${OPENSHIFT_RP_OBJECT_ID} --scope [NETWORK_ID]

Example Usage

terraform {
  required_providers {
    azureopenshift = {
      source  = "rh-mobb/azureopenshift"
      version = "~> 0.0.10"
    }
  }
}

provider azureopenshift {
}

resource "azureopenshift_redhatopenshift_cluster" "test" {
  name                = "tf-openshift"
  location            = var.location
  resource_group_name = var.resource_group_name

  master_profile {
    subnet_id = var.master_subnet_id
  }

  worker_profile {
    subnet_id = var.worker_subnet_id
  }

  service_principal {
    client_id     = var.client_id
    client_secret = var.client_secret
  }
}