Skip to content

feat(project): add service-agent community module for GCP service ide… - #6293

Merged
SwarnaBharathiMantena merged 3 commits into
GoogleCloudPlatform:developfrom
hamadfadi:feat-service-agent
Sep 22, 2026
Merged

SwarnaBharathiMantena merged 3 commits into
GoogleCloudPlatform:developfrom
hamadfadi:feat-service-agent

Conversation

@hamadfadi

Copy link
Copy Markdown
Contributor

Introduce a reusable community Terraform module to manage and explicitly provision Google Cloud service agent identities via google_project_service_identity.

Submission Checklist

NOTE: Community submissions can take up to 2 weeks to be reviewed.

Please take the following actions before submitting this pull request.

  • Fork your PR branch from the Toolkit "develop" branch (not main)
  • Test all changes with pre-commit in a local branch #
  • Confirm that "make tests" passes all tests
  • Add or modify unit tests to cover code changes
  • Ensure that unit test coverage remains above 80%
  • Update all applicable documentation
  • Follow Cluster Toolkit Contribution guidelines #

@hamadfadi

Copy link
Copy Markdown
Contributor Author

Why this is needed:
- On newly initialized GCP projects, Google Cloud creates service agent
identities lazily (often only after the first resource or job is submitted).
- Downstream modules attempting to bind IAM roles to a service agent fail
during single-pass deployments with "service account does not exist".
- This module ensures the API service is enabled and explicitly provisions
the service identity upfront.
Features:
- Ensures target GCP API service is enabled (google_project_service) with disable_on_destroy = false.
- Explicitly generates the service identity (google_project_service_identity) for any specified service.
- Outputs service_agent_email for immediate use in downstream IAM policies.

@hamadfadi hamadfadi added the release-new-modules Added to release notes under the "New Modules" heading. label Sep 9, 2026
@hamadfadi
hamadfadi changed the base branch from main to develop September 9, 2026 22:54
@aslam-quad aslam-quad added the external PR from external contributor label Sep 10, 2026
@github-actions

Copy link
Copy Markdown

this PR has been inactive for 3 days and has no unresolved comments. @SwarnaBharathiMantena, @ishitachail, @vikramvs-gg, please review.

…ntities

Introduce a reusable community Terraform module to manage and explicitly provision Google Cloud service agent identities via google_project_service_identity.
@github-actions

Copy link
Copy Markdown

this PR has been inactive for 3 days and has no unresolved comments. @SwarnaBharathiMantena, @ishitachail, @vikramvs-gg, please review.

@github-actions

Copy link
Copy Markdown

This is a second reminder that this PR has been inactive for 4 days and has no unresolved comments. @SwarnaBharathiMantena, @ishitachail, @vikramvs-gg, please review.

@SwarnaBharathiMantena SwarnaBharathiMantena left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the pre-existing-project module on PR #6295, let us move this module under project.

community/modules/internal/project/service-agent
  → community/modules/project/service-agent

Please update the README example source: path with the move, and match the
## Description opening the sibling modules use.

Please also update the modules/README.md.

Comment thread community/modules/project/service-agent/outputs.tf
Comment thread community/modules/project/service-agent/main.tf
Comment thread community/modules/internal/project/service-agent/variables.tf Outdated
@hamadfadi

Copy link
Copy Markdown
Contributor Author

Similar to the pre-existing-project module on PR #6295, let us move this module under project.

community/modules/internal/project/service-agent
  → community/modules/project/service-agent

Please update the README example source: path with the move, and match the ## Description opening the sibling modules use.

Please also update the modules/README.md.

@SwarnaBharathiMantena thank you for the suggestion.
Moved to community/modules/project/service-agent, README updated to the ## Description style the sibling modules use, with the source path fixed. Added to modules/README.md.

@SwarnaBharathiMantena SwarnaBharathiMantena left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

ishitachail
ishitachail previously approved these changes Sep 22, 2026
@SwarnaBharathiMantena
SwarnaBharathiMantena dismissed stale reviews from ishitachail and themself via c4f578b September 22, 2026 05:21
@SwarnaBharathiMantena
SwarnaBharathiMantena merged commit 86e0d5a into GoogleCloudPlatform:develop Sep 22, 2026
26 of 90 checks passed
ep-nag pushed a commit to nagconsulting/cluster-toolkit that referenced this pull request Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external PR from external contributor release-new-modules Added to release notes under the "New Modules" heading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants