func resourceProviderConfig()

in internal/terraform/json.go [163:175]


func resourceProviderConfig(kind string, name string, plan *plan) (pc ProviderConfig, ok bool) {
	// Find the provider_config_key for this resource, if it exists.
	for _, r := range plan.Configuration.RootModule.Resources {
		if r.Kind == kind && r.Name == name {
			// Find the right provider config based on the provider_config_key
			if pc, ok := plan.Configuration.ProviderConfig[r.ProviderConfigKey]; ok {
				return pc, true
			}
		}
	}

	return ProviderConfig{}, false
}