You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then in the terra pkg we would have something like:
typeMetaArgsstruct {
DependsOnDependenciesLifecycle*Lifecycle
}
// Dependencies returns the list of dependencies for this block.func (r*MetaArgs) Dependencies() Dependencies {
returnr.DependsOn
}
// LifecycleManagement returns the lifecycle block for this block.func (r*MetaArgs) LifecycleManagement() *Lifecycle {
returnr.Lifecycle
}
Then the Dependencies() and LifecycleManagement() functions from the generated code could also be removed.
Note that data sources support nearly all the same meta arguments as resources, and so we could re-use the terra.MetaArgs and embed those in data sources. If a user would use some meta args not supported by data sources this would be reported by terraform, so there is little room for error.
The text was updated successfully, but these errors were encountered:
Currently the Terraform meta arguments, e.g. depends_on, are generated per resource.
Moving these to the
terra
pkg would make it easier to modify these in the future as it would not require the generated code to be updated.For example, below is generated code for a resource:
This could become:
Then in the
terra
pkg we would have something like:Then the
Dependencies()
andLifecycleManagement()
functions from the generated code could also be removed.Note that data sources support nearly all the same meta arguments as resources, and so we could re-use the
terra.MetaArgs
and embed those in data sources. If a user would use some meta args not supported by data sources this would be reported by terraform, so there is little room for error.The text was updated successfully, but these errors were encountered: