terraform
No long description provided.
Installation
dagger install github.com/hampusctl/daggerverse/terraform@35d2284d58dce54fa980a56af42f6a924e6cfee2Entrypoint
Return Type
Terraform !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | source is the directory containing Terraform configuration files |
| container | Container | - | container is an existing container to use instead of creating a new one |
| apkoFile | File | - | apkoFile is a custom Apko image file to import instead of using repository:tag |
| repository | String | - | repository is the Docker repository for the Terraform image (default: hashicorp/terraform) |
| tag | String | - | 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@35d2284d58dce54fa980a56af42f6a924e6cfee2 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@35d2284d58dce54fa980a56af42f6a924e6cfee2 call \
containerfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| planFile | File ! | - | 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@35d2284d58dce54fa980a56af42f6a924e6cfee2 call \
apply --plan-file file:pathfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| extraArgs | [String ! ] | - | extraArgs are additional arguments to pass to terraform init command |
Example
dagger -m github.com/hampusctl/daggerverse/terraform@35d2284d58dce54fa980a56af42f6a924e6cfee2 call \
initfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| extraArgs | [String ! ] | - | extraArgs are additional arguments to pass to terraform plan command |
Example
dagger -m github.com/hampusctl/daggerverse/terraform@35d2284d58dce54fa980a56af42f6a924e6cfee2 call \
planfunc (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@35d2284d58dce54fa980a56af42f6a924e6cfee2 call \
validatefunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| accessKeyId | Secret ! | - | accessKeyID is the AWS access key ID |
| secretAccessKey | Secret ! | - | secretAccessKey is the AWS secret access key |
| sessionToken | Secret | - | sessionToken is the AWS session token (for temporary credentials) |
| region | String | - | region sets both AWS_REGION and AWS_DEFAULT_REGION if provided |
Example
dagger -m github.com/hampusctl/daggerverse/terraform@35d2284d58dce54fa980a56af42f6a924e6cfee2 call \
with-aws-credentials --access-key-id env:MYSECRET --secret-access-key env:MYSECRETfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| cloudsYaml | File | - | cloudsYaml is the OpenStack clouds.yaml configuration file |
Example
dagger -m github.com/hampusctl/daggerverse/terraform@35d2284d58dce54fa980a56af42f6a924e6cfee2 call \
with-clouds-yamlfunc (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()
}