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@8a1415cd1b1a8b34ecc94190b21154ac6acb7d6bEntrypoint
Return Type
Opentofu !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| imageRegistry | String | "ghcr.io" | OpenTofu image registry |
| imageRepository | String | "opentofu/opentofu" | OpenTofu image repository |
| imageTag | String | "latest" | OpenTofu image tag |
| userId | String | "65532" | OpenTofu image user |
| executor | String ! | "tofu" | Choice of IaC executor |
Example
dagger -m github.com/riftonix/daggerverse/modules/opentofu@8a1415cd1b1a8b34ecc94190b21154ac6acb7d6b 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@8a1415cd1b1a8b34ecc94190b21154ac6acb7d6b 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@8a1415cd1b1a8b34ecc94190b21154ac6acb7d6b 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)
}