Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.13: [Bug]: Terraform module with dependencies does not validate #4508

Closed
Walther opened this issue Jun 1, 2023 · 1 comment · Fixed by #4509
Closed

0.13: [Bug]: Terraform module with dependencies does not validate #4508

Walther opened this issue Jun 1, 2023 · 1 comment · Fixed by #4509
Assignees
Labels

Comments

@Walther
Copy link
Contributor

Walther commented Jun 1, 2023

This is essentially a copy of #4468 but for Terraform instead of Pulumi.

Reproducible with garden/plugins/terraform/test/test-project-module/ and running garden validate on 0.13.

kind: Project
name: terraform-provider
environments:
  - name: local
providers:
  - name: terraform
    variables:
      my-variable: base
variables:
  workspace: default
---
kind: Module
type: terraform
name: tf
include: ["*"]
autoApply: true
root: ./tf
workspace: ${var.workspace}
variables:
  my-variable: foo
---
kind: Module
type: exec
name: test
include: ["*"]
tasks:
  - name: test-task
    dependencies: [tf]
    command: ["echo", "${runtime.services.tf.outputs.my-output}"]
gdev validate
Validate ✔️

"apiVersion" is missing in the Project config. Assuming "garden.io/v0" for backwards compatibility with 0.12. The "apiVersion"-field is mandatory when using the new action Kind-configs. A detailed migration guide is available at https://docs.garden.io/tutorials/migrating-to-bonsai
ℹ garden               → Running in Garden environment local.default
ℹ providers            → Getting status...
✔ providers            → Cached (took 0.3 sec)
ℹ providers            → Run with --force-refresh to force a refresh of provider statuses.
ℹ graph                → Resolving actions and modules...
✔ graph                → Done (took 0 sec)
✖ deploy.tf            → Failed processing resolve Deploy type=terraform name=tf (from module tf) (took 0.01 sec). Here is the output:

────────────────────────────────────────────────────────────────────────────────
Error validating spec for Deploy type=terraform name=tf (from module tf): key "build" is not allowed at path [build], key "dependencies" is not allowed at path [dependencies]. Available keys: allowDestroy, autoApply, root, variables, version, workspace)
────────────────────────────────────────────────────────────────────────────────
Failed to resolve Deploy type=terraform name=tf (from module tf): Error: resolve Deploy type=terraform name=tf (from module tf) failed: Error: Error validating spec for Deploy type=terraform name=tf (from module tf): key "build" is not allowed at path [build], key "dependencies" is not allowed at path [dependencies]. Available keys: allowDestroy, autoApply, root, variables, version, workspace)
@Walther
Copy link
Contributor Author

Walther commented Jun 1, 2023

While at it, also add an integration test for the terraform module type. Followup from #4381 where the configuration was converted to action type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant