diff options
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/config/config.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/config/config.go | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/vendor/github.com/hashicorp/terraform/config/config.go b/vendor/github.com/hashicorp/terraform/config/config.go index 1772fd7..f13a046 100644 --- a/vendor/github.com/hashicorp/terraform/config/config.go +++ b/vendor/github.com/hashicorp/terraform/config/config.go | |||
@@ -252,35 +252,6 @@ func (r *Resource) Id() string { | |||
252 | } | 252 | } |
253 | } | 253 | } |
254 | 254 | ||
255 | // ProviderFullName returns the full name of the provider for this resource, | ||
256 | // which may either be specified explicitly using the "provider" meta-argument | ||
257 | // or implied by the prefix on the resource type name. | ||
258 | func (r *Resource) ProviderFullName() string { | ||
259 | return ResourceProviderFullName(r.Type, r.Provider) | ||
260 | } | ||
261 | |||
262 | // ResourceProviderFullName returns the full (dependable) name of the | ||
263 | // provider for a hypothetical resource with the given resource type and | ||
264 | // explicit provider string. If the explicit provider string is empty then | ||
265 | // the provider name is inferred from the resource type name. | ||
266 | func ResourceProviderFullName(resourceType, explicitProvider string) string { | ||
267 | if explicitProvider != "" { | ||
268 | // check for an explicit provider name, or return the original | ||
269 | parts := strings.SplitAfter(explicitProvider, "provider.") | ||
270 | return parts[len(parts)-1] | ||
271 | } | ||
272 | |||
273 | idx := strings.IndexRune(resourceType, '_') | ||
274 | if idx == -1 { | ||
275 | // If no underscores, the resource name is assumed to be | ||
276 | // also the provider name, e.g. if the provider exposes | ||
277 | // only a single resource of each type. | ||
278 | return resourceType | ||
279 | } | ||
280 | |||
281 | return resourceType[:idx] | ||
282 | } | ||
283 | |||
284 | // Validate does some basic semantic checking of the configuration. | 255 | // Validate does some basic semantic checking of the configuration. |
285 | func (c *Config) Validate() tfdiags.Diagnostics { | 256 | func (c *Config) Validate() tfdiags.Diagnostics { |
286 | if c == nil { | 257 | if c == nil { |