Dagger
Search

terratest

No long description provided.

Installation

dagger install github.com/Excoriate/daggerverse/terratest@v1.7.0

Entrypoint

Return Type
Terratest !
Arguments
NameTypeDescription
versionString the Version of the Terraform to use, e.g., "0.12.24". by default, it uses the latest Version.
tfVersionString the Version of the Terraform to use, e.g., "0.12.24". by default, it uses the latest Version.
imageString Image of the container to use. by default, it uses the official HashiCorp Terraform Image hashicorp/terraform.
srcDirectory !Src is the directory that contains all the source code, including the module directory.
ctrContainer ctr is the container to use as a base container. It's an optional parameter. If it's not set, it's going to create a new container.
envVarsString envVars is a string of environment variables in the form of "key1=value1,key2=value2"
Example
func (m *myModule) example(src *Directory) *Terratest  {
	return dag.
			Terratest(src)
}
@function
def example(src: dagger.Directory, ) -> dag.Terratest:
	return (
		dag.terratest(src)
	)
@func()
example(src: Directory, ): Terratest {
	return dag
		.terratest(src)
}

Types

Terratest

version()

The Version of the Golang image that’ll host the ‘terartest’ test

Return Type
String !
Example
dagger -m github.com/Excoriate/daggerverse/terratest@aac14886243868ff0cbf25077f5893586b55fefd call \
 --src DIR_PATH version
func (m *myModule) example(ctx context.Context, src *Directory) string  {
	return dag.
			Terratest(src).
			Version(ctx)
}
@function
async def example(src: dagger.Directory, ) -> str:
	return await (
		dag.terratest(src)
		.version()
	)
@func()
async example(src: Directory, ): Promise<string> {
	return dag
		.terratest(src)
		.version()
}

tfVersion()

TfVersion is the Version of the Terraform to use, e.g., “0.12.24”. by default, it uses the latest Version.

Return Type
String !
Example
dagger -m github.com/Excoriate/daggerverse/terratest@aac14886243868ff0cbf25077f5893586b55fefd call \
 --src DIR_PATH tf-version
func (m *myModule) example(ctx context.Context, src *Directory) string  {
	return dag.
			Terratest(src).
			TfVersion(ctx)
}
@function
async def example(src: dagger.Directory, ) -> str:
	return await (
		dag.terratest(src)
		.tf_version()
	)
@func()
async example(src: Directory, ): Promise<string> {
	return dag
		.terratest(src)
		.tfVersion()
}

image()

Image of the container to use.

Return Type
String !
Example
dagger -m github.com/Excoriate/daggerverse/terratest@aac14886243868ff0cbf25077f5893586b55fefd call \
 --src DIR_PATH image
func (m *myModule) example(ctx context.Context, src *Directory) string  {
	return dag.
			Terratest(src).
			Image(ctx)
}
@function
async def example(src: dagger.Directory, ) -> str:
	return await (
		dag.terratest(src)
		.image()
	)
@func()
async example(src: Directory, ): Promise<string> {
	return dag
		.terratest(src)
		.image()
}

src()

Src is the directory that contains all the source code, including the module directory.

Return Type
Directory !
Example
dagger -m github.com/Excoriate/daggerverse/terratest@aac14886243868ff0cbf25077f5893586b55fefd call \
 --src DIR_PATH src
func (m *myModule) example(src *Directory) *Directory  {
	return dag.
			Terratest(src).
			Src()
}
@function
def example(src: dagger.Directory, ) -> dagger.Directory:
	return (
		dag.terratest(src)
		.src()
	)
@func()
example(src: Directory, ): Directory {
	return dag
		.terratest(src)
		.src()
}

ctr()

Ctr is the container to use as a base container.

Return Type
Container !
Example
dagger -m github.com/Excoriate/daggerverse/terratest@aac14886243868ff0cbf25077f5893586b55fefd call \
 --src DIR_PATH ctr
func (m *myModule) example(src *Directory) *Container  {
	return dag.
			Terratest(src).
			Ctr()
}
@function
def example(src: dagger.Directory, ) -> dagger.Container:
	return (
		dag.terratest(src)
		.ctr()
	)
@func()
example(src: Directory, ): Container {
	return dag
		.terratest(src)
		.ctr()
}

base()

Base sets up the Container with a golang image and cache volumes version string

Return Type
Terratest !
Arguments
NameTypeDefault ValueDescription
goVersionString !-No description provided
tfVersionString !-No description provided
Example
dagger -m github.com/Excoriate/daggerverse/terratest@aac14886243868ff0cbf25077f5893586b55fefd call \
 --src DIR_PATH base --go-version string --tf-version string \
 run --test-dir string
func (m *myModule) example(src *Directory, goVersion string, tfVersion string) *Terratest  {
	return dag.
			Terratest(src).
			Base(goVersion, tfVersion)
}
@function
def example(src: dagger.Directory, go_version: str, tf_version: str) -> dag.Terratest:
	return (
		dag.terratest(src)
		.base(go_version, tf_version)
	)
@func()
example(src: Directory, goVersion: string, tfVersion: string): Terratest {
	return dag
		.terratest(src)
		.base(goVersion, tfVersion)
}

withModule()

WithModule specifies the module to use in the Terraform module by the ‘Src’ directory.

Return Type
Terratest !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-No description provided
Example
dagger -m github.com/Excoriate/daggerverse/terratest@aac14886243868ff0cbf25077f5893586b55fefd call \
 --src DIR_PATH with-module --src DIR_PATH \
 run --test-dir string
func (m *myModule) example(src *Directory, src1 *Directory) *Terratest  {
	return dag.
			Terratest(src).
			WithModule(src1)
}
@function
def example(src: dagger.Directory, src1: dagger.Directory) -> dag.Terratest:
	return (
		dag.terratest(src)
		.with_module(src1)
	)
@func()
example(src: Directory, src1: Directory): Terratest {
	return dag
		.terratest(src)
		.withModule(src1)
}

withContainer()

WithContainer specifies the container to use in the Terraform module.

Return Type
Terratest !
Arguments
NameTypeDefault ValueDescription
ctrContainer !-No description provided
Example
dagger -m github.com/Excoriate/daggerverse/terratest@aac14886243868ff0cbf25077f5893586b55fefd call \
 --src DIR_PATH with-container --ctr IMAGE:TAG \
 run --test-dir string
func (m *myModule) example(src *Directory, ctr *Container) *Terratest  {
	return dag.
			Terratest(src).
			WithContainer(ctr)
}
@function
def example(src: dagger.Directory, ctr: dagger.Container) -> dag.Terratest:
	return (
		dag.terratest(src)
		.with_container(ctr)
	)
@func()
example(src: Directory, ctr: Container): Terratest {
	return dag
		.terratest(src)
		.withContainer(ctr)
}

run()

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
testDirString !-testDir is the directory that contains all the test code.
argsString -args is the arguments to pass to the 'go test' command.
Example
dagger -m github.com/Excoriate/daggerverse/terratest@aac14886243868ff0cbf25077f5893586b55fefd call \
 --src DIR_PATH run --test-dir string
func (m *myModule) example(src *Directory, testDir string) *Container  {
	return dag.
			Terratest(src).
			Run(testDir)
}
@function
def example(src: dagger.Directory, test_dir: str) -> dagger.Container:
	return (
		dag.terratest(src)
		.run(test_dir)
	)
@func()
example(src: Directory, testDir: string): Container {
	return dag
		.terratest(src)
		.run(testDir)
}