Skip to content

Add support for detailed change information in UpdatedResources (e.g., email addresses removed) #1833

@buty4649

Description

@buty4649

Feature Overview

We manage Google Groups using Terraform and the Google Workspace Provider in a pull request–driven workflow.
When a pull request is opened, GitHub Actions runs terraform plan and tfcmt is used to post the result to the PR.
We use a custom template to format the comment content.

Currently, the UpdatedResources variable lists which resources will be updated, but it lacks specific detail about what is being changed.
Adding a new template variable—e.g., UpdatedResourcesDetails—that includes key diff information (such as which members are removed or added) would allow us to present this context more clearly in our PR comments.

Why is the feature needed?

In our workflow, reviewers responsible for approving changes in pull requests are not always familiar with Terraform or HCL.
While ChangedResult contains detailed information about the changes, interpreting its raw format requires some understanding of how Terraform plan output is structured.

If structured information such as added or removed values could be exposed through a template variable, we could format it using a custom template to make the intent of the changes clearer even for reviewers who are not Terraform experts.
This would help ensure that changes are properly understood and appropriately approved.

Example Code

Current output with UpdatedResources:

Plan Result

CI link

Plan: 0 to add, 1 to change, 0 to destroy.
Change Result (Click me)
# googleworkspace_group_members.members["test@example.com"] will be updated in-place  
~ resource "googleworkspace_group_members" "members" {
    id = "groups/******"
    # (1 unchanged attribute hidden)

  - members {
      - delivery_settings = "ALL_MAIL" -> null
      - email             = "user1@example.com" -> null
      - id                = "*****" -> null
      - role              = "MEMBER" -> null
      - status            = "SUSPENDED" -> null
      - type              = "USER" -> null
    }
    + members {
        + delivery_settings = "ALL_MAIL"
        + email             = "user2@example.com"
        + id                = (known after apply)
        + role              = "MEMBER"
        + status            = (known after apply)
        + type              = "USER"
      }
}
-- snip --

Expected output using a custom template with the proposed UpdatedResourcesDetails variable:

Plan Result

CI link

Plan: 0 to add, 1 to change, 0 to destroy.
Change Result (Click me)

-- snip --


Configuration

Note

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions