I am trying to write a module using third party provider and it’s keep giving me following error
╷
│ Error: Missing required argument
│
│ The argument "base_endpoint" is required, but was not set.
╵
╷
│ Error: Invalid provider configuration
│
│ Provider "registry.terraform.io/djlemkes/airflow" requires explicit configuration. Add a provider block to the root module and configure the provider's required arguments as described in the provider
│ documentation.
│
╵
following is my module code
modules/airflow/roles.tf
locals {
developer_role = jsondecode(file(var.role_json_file_path))
}
data "google_client_config" "airflow" {
provider = google
}
provider "airflow" {
base_endpoint = var.airflow_url
oauth2_token = data.google_client_config.airflow.access_token
}
resource "airflow_role" "role" {
name = var.role_name
dynamic "action" {
for_each = local.developer_role
content {
action = action.value.action
resource = action.value.resource
}
}
}
modules/airflow/provider.tf
terraform {
required_version = ">= 0.13"
required_providers {
google = {
source = "hashicorp/google"
version = "~> 4.53"
}
airflow = {
source = "DJLemkes/airflow"
version = "0.10.1"
}
}
}
modules/airflow/variables.tf
variable "role_name" {
type = string
description = "role name for airflow"
}
variable "role_json_file_path" {
type = string
description = "json file for airflow role"
}
variable "airflow_url" {
type = string
description = "airflow url"
}
And this is how I am calling it.
module "def-airflow-developer" {
source = "modules/airflow"
role_name = "airflow-developer"
role_json_file_path = "./developer_role.json"
airflow_url = var.test_composer_url
}