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

Terraform apply does not report error if snippet VCL is invalid #737

Open
jimr6007 opened this issue Aug 21, 2023 · 0 comments
Open

Terraform apply does not report error if snippet VCL is invalid #737

jimr6007 opened this issue Aug 21, 2023 · 0 comments

Comments

@jimr6007
Copy link

Terraform Version

Terraform v1.3.9
on linux_amd64
+ provider registry.terraform.io/fastly/fastly v5.3.1
+ provider registry.terraform.io/hashicorp/aws v4.46.0

Your version of Terraform is out of date! The latest version
is 1.5.5. You can update by downloading from https://www.terraform.io/downloads.html

Affected Fastly Terraform Resource(s)

Please list the affected resources, for example:

  • fastly_service_vcl

Terraform Configuration Files

vcl {
    name    = "main"
    content = "${file("${path.module}/main.vcl")}"
    main    = true
  }

compared to 

snippet {
    name    = "log4j-detect"
    content = "${file("${path.module}/snippet-log4j-detect.vcl")}"
    type    = "recv"
  }

Expected Behavior

When I "terraform apply" with activate=false I'm expecting to see errors from the Fastly API if my VCL has errors.
This is exactly what happens when I include the "vcl" parameter with "content"

however, with a "snippet" if the there is invalid VCL, the terraform apply reports "success"
even though in the Fastly webui console we see that for the Service in question we now have a new draft that is reporting invalid VCL

What should have happened?

a "snippet" with invalid VCL should result in a "terraform apply"with "activate=false being a failure, non-zero return status

Actual Behavior

a "snippet" with invalid VCL and "terraform apply"with "activate=false returns 0, terraform apply "okay"
but the webui console does show a new draft, with VCL errors

Debug Output (optional)

Please provide a link to a GitHub Gist containing the complete debug output (see Terraform docs). Ensure any sensitive data is <REDACTED>.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids (optional)

Is there anything atypical about your account or set up that we should know?

@jimr6007 jimr6007 changed the title Terraform apply does not report error is snippet VCL is invalid Terraform apply does not report error if snippet VCL is invalid Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant