Dagger
Search

terraform

No long description provided.

Installation

dagger install github.com/hampusctl/daggerverse/terraform@839733a290ba4562efb58f9c3dc880aa23f76136

Entrypoint

Return Type
Terraform !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -source is the directory containing Terraform configuration files
containerContainer -container is an existing container to use instead of creating a new one
apkoFileFile -apkoFile is a custom Apko image file to import instead of using repository:tag
repositoryString -repository is the Docker repository for the Terraform image (default: hashicorp/terraform)
tagString -tag is the Docker tag for the Terraform image (default: latest)
extraCaCerts[File ! ] -extraCaCerts are additional CA certificate files to add to the container
Example
dagger -m github.com/hampusctl/daggerverse/terraform@839733a290ba4562efb58f9c3dc880aa23f76136 call \
func (m *MyModule) Example() *dagger.Terraform  {
	return dag.
			Terraform()
}
@function
def example() -> dagger.Terraform:
	return (
		dag.terraform()
	)
@func()
example(): Terraform {
	return dag
		.terraform()
}

Types

Terraform 🔗

container() 🔗

Return Type
Container !
Example
dagger -m github.com/hampusctl/daggerverse/terraform@839733a290ba4562efb58f9c3dc880aa23f76136 call \
 container
func (m *MyModule) Example() *dagger.Container  {
	return dag.
			Terraform().
			Container()
}
@function
def example() -> dagger.Container:
	return (
		dag.terraform()
		.container()
	)
@func()
example(): Container {
	return dag
		.terraform()
		.container()
}

apply() 🔗

Apply executes a specific Terraform plan file (automatically runs Init first)

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
planFileFile !-planFile is the Terraform plan file to apply (usually output.tfplan)
extraArgs[String ! ] -extraArgs are additional arguments to pass to terraform apply command
Example
dagger -m github.com/hampusctl/daggerverse/terraform@839733a290ba4562efb58f9c3dc880aa23f76136 call \
 apply --plan-file file:path
func (m *MyModule) Example(planFile *dagger.File) *dagger.Container  {
	return dag.
			Terraform().
			Apply(planFile)
}
@function
def example(plan_file: dagger.File) -> dagger.Container:
	return (
		dag.terraform()
		.apply(plan_file)
	)
@func()
example(planFile: File): Container {
	return dag
		.terraform()
		.apply(planFile)
}

init() 🔗

Init initializes a Terraform working directory

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
extraArgs[String ! ] -extraArgs are additional arguments to pass to terraform init command
Example
dagger -m github.com/hampusctl/daggerverse/terraform@839733a290ba4562efb58f9c3dc880aa23f76136 call \
 init
func (m *MyModule) Example() *dagger.Container  {
	return dag.
			Terraform().
			Init()
}
@function
def example() -> dagger.Container:
	return (
		dag.terraform()
		.init()
	)
@func()
example(): Container {
	return dag
		.terraform()
		.init()
}

plan() 🔗

Plan creates an execution plan and saves it to output.tfplan with markdown report (automatically runs Init first)

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
extraArgs[String ! ] -extraArgs are additional arguments to pass to terraform plan command
Example
dagger -m github.com/hampusctl/daggerverse/terraform@839733a290ba4562efb58f9c3dc880aa23f76136 call \
 plan
func (m *MyModule) Example() *dagger.Directory  {
	return dag.
			Terraform().
			Plan()
}
@function
def example() -> dagger.Directory:
	return (
		dag.terraform()
		.plan()
	)
@func()
example(): Directory {
	return dag
		.terraform()
		.plan()
}

validate() 🔗

Validate checks whether the configuration is valid (automatically runs Init first)

Return Type
String !
Example
dagger -m github.com/hampusctl/daggerverse/terraform@839733a290ba4562efb58f9c3dc880aa23f76136 call \
 validate
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Terraform().
			Validate(ctx)
}
@function
async def example() -> str:
	return await (
		dag.terraform()
		.validate()
	)
@func()
async example(): Promise<string> {
	return dag
		.terraform()
		.validate()
}

withAwsCredentials() 🔗

WithAwsCredentials adds AWS credentials for Terraform (for example S3 backend auth).

Return Type
Terraform !
Arguments
NameTypeDefault ValueDescription
accessKeyIdSecret !-accessKeyID is the AWS access key ID
secretAccessKeySecret !-secretAccessKey is the AWS secret access key
sessionTokenSecret -sessionToken is the AWS session token (for temporary credentials)
regionString -region sets both AWS_REGION and AWS_DEFAULT_REGION if provided
Example
dagger -m github.com/hampusctl/daggerverse/terraform@839733a290ba4562efb58f9c3dc880aa23f76136 call \
 with-aws-credentials --access-key-id env:MYSECRET --secret-access-key env:MYSECRET
func (m *MyModule) Example(accessKeyId *dagger.Secret, secretAccessKey *dagger.Secret) *dagger.Terraform  {
	return dag.
			Terraform().
			WithAwsCredentials(accessKeyId, secretAccessKey)
}
@function
def example(access_key_id: dagger.Secret, secret_access_key: dagger.Secret) -> dagger.Terraform:
	return (
		dag.terraform()
		.with_aws_credentials(access_key_id, secret_access_key)
	)
@func()
example(accessKeyId: Secret, secretAccessKey: Secret): Terraform {
	return dag
		.terraform()
		.withAwsCredentials(accessKeyId, secretAccessKey)
}

withCloudsYaml() 🔗

WithCloudsYaml adds OpenStack clouds.yaml configuration to the container

Return Type
Terraform !
Arguments
NameTypeDefault ValueDescription
cloudsYamlFile -cloudsYaml is the OpenStack clouds.yaml configuration file
Example
dagger -m github.com/hampusctl/daggerverse/terraform@839733a290ba4562efb58f9c3dc880aa23f76136 call \
 with-clouds-yaml
func (m *MyModule) Example() *dagger.Terraform  {
	return dag.
			Terraform().
			WithCloudsYaml()
}
@function
def example() -> dagger.Terraform:
	return (
		dag.terraform()
		.with_clouds_yaml()
	)
@func()
example(): Terraform {
	return dag
		.terraform()
		.withCloudsYaml()
}

withOpenstackApplicationCredentials() 🔗

WithOpenstackApplicationCredentials sets the minimum OpenStack app-credential variables for Terraform/OpenStack SDKs.

Return Type
Terraform !
Arguments
NameTypeDefault ValueDescription
authUrlString !-authURL sets OS_AUTH_URL
applicationCredentialIdString !-applicationCredentialID sets OS_APPLICATION_CREDENTIAL_ID
applicationCredentialSecretSecret !-applicationCredentialSecret sets OS_APPLICATION_CREDENTIAL_SECRET
regionString !-region sets OS_REGION_NAME
Example
dagger -m github.com/hampusctl/daggerverse/terraform@839733a290ba4562efb58f9c3dc880aa23f76136 call \
 with-openstack-application-credentials --auth-url string --application-credential-id string --application-credential-secret env:MYSECRET --region string
func (m *MyModule) Example(authUrl string, applicationCredentialId string, applicationCredentialSecret *dagger.Secret, region string) *dagger.Terraform  {
	return dag.
			Terraform().
			WithOpenstackApplicationCredentials(authUrl, applicationCredentialId, applicationCredentialSecret, region)
}
@function
def example(auth_url: str, application_credential_id: str, application_credential_secret: dagger.Secret, region: str) -> dagger.Terraform:
	return (
		dag.terraform()
		.with_openstack_application_credentials(auth_url, application_credential_id, application_credential_secret, region)
	)
@func()
example(authUrl: string, applicationCredentialId: string, applicationCredentialSecret: Secret, region: string): Terraform {
	return dag
		.terraform()
		.withOpenstackApplicationCredentials(authUrl, applicationCredentialId, applicationCredentialSecret, region)
}