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 CreatedResource, UpdatedResources, DeletedResources and ReplacedResources #39

Merged
merged 4 commits into from
Jan 16, 2021

Conversation

suzuki-shunsuke
Copy link
Owner

@suzuki-shunsuke suzuki-shunsuke commented Jan 16, 2021

As a summary of the result of terraform plan, it is convenient to show a list of resource paths.

  • .CreatedResources: a list of created resource paths ([]string)
  • .UpdatedResources: a list of updated resource paths ([]string)
  • .DeletedResources: a list of deleted resource paths ([]string)
  • .ReplacedResources: a list of replaced resource paths ([]string)

Example

        {{if .CreatedResources}}
        * Create
        {{- range .CreatedResources}}
          * {{.}}
        {{- end}}{{end}}{{if .UpdatedResources}}
        * Update
        {{- range .UpdatedResources}}
          * {{.}}
        {{- end}}{{end}}{{if .DeletedResources}}
        * Delete
        {{- range .DeletedResources}}
          * {{.}}
        {{- end}}{{end}}{{if .ReplacedResources}}
        * Replace
        {{- range .ReplacedResources}}
          * {{.}}
        {{- end}}{{end}}
* Create
  * null_resource.foo
* Update
  * mysql_database.bar
* Delete
  * null_resource.bar
* Replace
  * mysql_database.foo

@suzuki-shunsuke suzuki-shunsuke added the enhancement New feature or request label Jan 16, 2021
@suzuki-shunsuke suzuki-shunsuke changed the title feat: add template variable "CreatedResources" feat: add template variables CreatedResource, UpdatedResources, and DeletedResources Jan 16, 2021
@suzuki-shunsuke suzuki-shunsuke changed the title feat: add template variables CreatedResource, UpdatedResources, and DeletedResources feat: add template variables CreatedResource, UpdatedResources, DeletedResources and ReplacedResources Jan 16, 2021
@suzuki-shunsuke suzuki-shunsuke added the documentation Improvements or additions to documentation label Jan 16, 2021
@suzuki-shunsuke suzuki-shunsuke added this to the v0.5.0 milestone Jan 16, 2021
@suzuki-shunsuke suzuki-shunsuke merged commit 9316485 into master Jan 16, 2021
@suzuki-shunsuke suzuki-shunsuke deleted the feat/add-template-variables branch January 16, 2021 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant