Skip to content

fastly_service_vcl Overly verbose Snippets diff  #802

@marceloboeira

Description

@marceloboeira

Terraform Version

Terraform v1.6.3
on darwin_arm64

Affected Fastly Terraform Resource(s)

Please list the affected resources, for example:

  • fastly_service_vcl

Terraform Configuration Files

resource "fastly_service_vcl" "this" {
  name     = "some-service"
  activate = true

  snippet {
    name     = "my_snippet"
    type     = "init"
    content  =  <<EOF
      table my_table {
        "foo" = "bar"
        "bar" = "foo"
      }
      # Old line
    EOF
  }
}

Expected Behavior

...
        snippet {
          name     = "my_snippet"
          content  = <-EOF
            ... lots of suff ...
-           # Old Line
+           # Changed Line
          EOF
        }

Actual Behavior

...
-       snippet {
-         name     = "my_snippet"
-         type     = "init"
-         content  = <-EOF
-           ... lots of suff ...
-         EOF
-       }

+       snippet {
+         name     = "my_snippet"
+         type     = "init"
+         content  = <-EOF
+           ... lots of suff ...
+           # Changed Line
+         EOF
+       }

Steps to Reproduce

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

  1. terraform plan/apply
  2. make a change to snippet content
  3. terraform plan — see the "wrong" diff (more verbose than necessary)

Important Factoids (optional)

  • I'm guessing other types of snippets (dynamic) and also raw VCL should have the same issue
  • Is that because of the use of Type.Set in the resource schema? Would it be possible to use something like Type.Map and eventually use the name of the snippet as a map (I'm guessing if the name changes it is okay to show it as a new snippet)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions