func (r *Resource) ProviderConfigAddr() addrs.ProviderConfig {
	if r.ProviderConfigRef == nil {
		return r.Addr().DefaultProviderConfig()
	}
	return addrs.ProviderConfig{
		Type:  r.ProviderConfigRef.Name,
		Alias: r.ProviderConfigRef.Alias,
	}
}
ProviderConfigAddr returns the address for the provider configuration
that should be used for this resource. This function implements the
default behavior of extracting the type from the resource type name if
an explicit "provider" argument was not provided.
package configs
import (
	"fmt"
	"github.com/hashicorp/hcl2/gohcl"
	"github.com/hashicorp/hcl2/hcl"
	"github.com/hashicorp/hcl2/hcl/hclsyntax"
	"github.com/hashicorp/terraform/addrs"
)
type Resource struct {
	Mode    addrs.ResourceMode
	Name    string
	Type    string
	Config  hcl.Body
	Count   hcl.Expression
	ForEach hcl.Expression
	ProviderConfigRef *ProviderConfigRef
	DependsOn []hcl.Traversal
	Managed *ManagedResource
	DeclRange hcl.Range
	TypeRange hcl.Range
}
type ManagedResource struct {
	Connection   *Connection
	Provisioners []*Provisioner
	CreateBeforeDestroy bool
	PreventDestroy      bool
	IgnoreChanges       []hcl.Traversal
	IgnoreAllChanges    bool
	CreateBeforeDestroySet bool
	PreventDestroySet      bool
}
func (r *Resource) moduleUniqueKey() string {
	return r.Addr().String()
}
func (r *Resource) Addr() addrs.Resource {
	return addrs.Resource{
		Mode: r.Mode,
		Type: r.Type,
		Name: r.Name,
	}
}