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

feat: add template variables #107

Merged
merged 4 commits into from Jul 14, 2021
Merged

feat: add template variables #107

merged 4 commits into from Jul 14, 2021

Conversation

suzuki-shunsuke
Copy link
Owner

@suzuki-shunsuke suzuki-shunsuke commented Jul 12, 2021

Close #103

The following variables are added.

  • ChangedResult
  • ChangeOutsideTerraform
  • Warning

ChangedResult

ChangeOutsideTerraform

Warning

e.g.

Warning: "silenced": [DEPRECATED] Use the Downtime resource instead.

  with datadog_monitor.foo_success_rate,
  on foo.tf line 30, in resource "datadog_monitor" "foo_success_rate":
  30: resource "datadog_monitor" "foo_success_rate" {

(and one more similar warning elsewhere)

Warning: "thresholds": [DEPRECATED] Define `monitor_thresholds` list with one element instead.

  with datadog_monitor.foo_success_rate,
  on foo.tf line 30, in resource "datadog_monitor" "foo_success_rate":
  30: resource "datadog_monitor" "foo_success_rate" {

(and 7 more similar warnings elsewhere)

Example

    when_destroy:
      template: |
        {{template "plan_title" .}}

        {{if .Link}}[CI link]({{.Link}}){{end}}

        {{template "deletion_warning" .}}

        {{template "result" .}}

        {{template "updated_resources" .}}

        {{if .ChangedResult}}
        <details><summary>Change Result (Click me)</summary>
        {{wrapCode .ChangedResult}}
        </details>
        {{end}}

        {{if .ChangeOutsideTerraform}}
        <details><summary>:warning: Note: Objects have changed outside of Terraform</summary>
        {{wrapCode .ChangeOutsideTerraform}}
        </details>
        {{end}}

        {{if .Warnings}}
        ## :warning: Warnings :warning:
        {{wrapCode .Warnings}}
        {{end}}

@suzuki-shunsuke suzuki-shunsuke added this to the v1.1.0 milestone Jul 12, 2021
@suzuki-shunsuke suzuki-shunsuke added the enhancement New feature or request label Jul 12, 2021
@suzuki-shunsuke suzuki-shunsuke changed the title feat: add templates feat: add template variables Jul 12, 2021
@suzuki-shunsuke suzuki-shunsuke marked this pull request as ready for review July 14, 2021 01:31
@suzuki-shunsuke suzuki-shunsuke merged commit cdfe812 into main Jul 14, 2021
@suzuki-shunsuke suzuki-shunsuke deleted the feat/add-templates branch July 14, 2021 01:32
@suzuki-shunsuke suzuki-shunsuke modified the milestones: v1.1.0, v1.0.1 Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add builtin templates
1 participant