I am creating a terrorm provider to access data from cloud and on Prem instances, I will be passing the resource type(cloud or onprem) as in the example below
terraform {
required_providers {
test = {
source = "test-example.com/testprovider/test"
version = "1.0.0"
}
}
}
provider "test" {
username = var.credentials.username
password = var.credentials.password
server = var.credentials.server
}
data "test_onprem" "demoVm" {
name = "appd-tomcat-srv"
}
data "test_cloud" "demoVm" {
name = "appd-tomcat-srv"
}
. Now I want to access the resource type is onprem or cloud within the configure function of my provider.
func (d *VmDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest,
resp *datasource.ConfigureResponse) {
}