addrs: Resource.InModule, similar to Resource.Absolute
The Resource.Absolute function is there to conveniently construct an AbsResource from a Resource by providing a module instance. Likewise, this new InModule method allows conveniently constructing a ConfigResource from a Resource by providing a module.
This commit is contained in:
parent
d26ee0ea37
commit
9c246e9a01
|
@ -50,6 +50,15 @@ func (r Resource) Absolute(module ModuleInstance) AbsResource {
|
|||
}
|
||||
}
|
||||
|
||||
// InModule returns a ConfigResource from the receiver and the given module
|
||||
// address.
|
||||
func (r Resource) InModule(module Module) ConfigResource {
|
||||
return ConfigResource{
|
||||
Module: module,
|
||||
Resource: r,
|
||||
}
|
||||
}
|
||||
|
||||
// ImpliedProvider returns the implied provider type name, for e.g. the "aws" in
|
||||
// "aws_instance"
|
||||
func (r Resource) ImpliedProvider() string {
|
||||
|
|
Loading…
Reference in New Issue