opentofu
This module has been generated via dagger init and serves as a reference tobasic module structure as you get started with Dagger.
Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.
The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.
Installation
dagger install github.com/riftonix/daggerverse/modules/opentofu@841fcf22984dd6c1979bad7910af525a322711adEntrypoint
Return Type
Opentofu !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| containerImage | String | "ghcr.io/opentofu/opentofu:latest" | TF container image |
| executor | String ! | "tofu" | Choice of IaC executor |
Example
dagger -m github.com/riftonix/daggerverse/modules/opentofu@841fcf22984dd6c1979bad7910af525a322711ad call \
--executor stringfunc (m *MyModule) Example(executor string) *dagger.Opentofu {
return dag.
Opentofu(executor)
}@function
def example(executor: str) -> dagger.Opentofu:
return (
dag.opentofu(executor)
)@func()
example(executor: string): Opentofu {
return dag
.opentofu(executor)
}Types
Opentofu 🔗
container() 🔗
Returns container
Return Type
Container ! Example
dagger -m github.com/riftonix/daggerverse/modules/opentofu@841fcf22984dd6c1979bad7910af525a322711ad call \
--executor string containerfunc (m *MyModule) Example(executor string) *dagger.Container {
return dag.
Opentofu(executor).
Container()
}@function
def example(executor: str) -> dagger.Container:
return (
dag.opentofu(executor)
.container()
)@func()
example(executor: string): Container {
return dag
.opentofu(executor)
.container()
}lint() 🔗
Verify that the manifests is well-formed
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | IaC project path |
Example
dagger -m github.com/riftonix/daggerverse/modules/opentofu@841fcf22984dd6c1979bad7910af525a322711ad call \
--executor string lint --source DIR_PATHfunc (m *MyModule) Example(ctx context.Context, executor string, source *dagger.Directory) string {
return dag.
Opentofu(executor).
Lint(ctx, source)
}@function
async def example(executor: str, source: dagger.Directory) -> str:
return await (
dag.opentofu(executor)
.lint(source)
)@func()
async example(executor: string, source: Directory): Promise<string> {
return dag
.opentofu(executor)
.lint(source)
}