You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
• Add customizable attribute mapping variable for GCP Workload Identity
• Change default google.subject mapping to prevent long branch issues
• Include validation for required google.subject mapping
• Update documentation with new variable details
• Add gcp_workload_identity_pool_provider_attribute_mapping variable • Set new default google.subject mapping using user_email, project_id, job_id • Include validation for required google.subject field • Add assertion_sub attribute mapping
• Document new attribute mapping variable addition • Explain change from assertion.sub to composite google.subject • Note prevention of long branch name issues
The validation condition uses complex boolean logic that could be simplified and made more readable. Consider breaking down the condition or using more descriptive intermediate variables.
The default value for google.subject has changed significantly from a simple assertion.sub to a complex concatenated string. This is a breaking change that may affect existing deployments and should be carefully validated.
The validation condition should use contains() to safely check if the key exists before accessing it. Direct key access can cause errors if the key doesn't exist in the map.
Why: The suggestion correctly identifies a potential runtime error when accessing var.gcp_workload_identity_pool_provider_attribute_mapping["google.subject"] without first checking if the key exists. Using contains() prevents Terraform from failing if the key is missing from the map.
-- Change the default attribute mapping for the GCP Workload Identity Pool Provider from `google.subject = assertion.sub` to `google.subject = assertion.user_email+"::"+assertion.project_id+"::"assertion.job_id`.+- Change the default attribute mapping for the GCP Workload Identity Pool Provider from `google.subject = assertion.sub` to `google.subject = assertion.user_email+"::"+assertion.project_id+"::"+assertion.job_id`.
Suggestion importance[1-10]: 6
__
Why: The suggestion correctly identifies a missing + operator in the changelog description, which improves documentation accuracy and clarity for users reading about the breaking change.
Why: The suggestion correctly identifies a critical syntax error in the string concatenation where the + operator is missing before assertion.job_id. This would cause the Terraform configuration to fail during validation or apply.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Enhancement
Description
• Add customizable attribute mapping variable for GCP Workload Identity
• Change default google.subject mapping to prevent long branch issues
• Include validation for required google.subject mapping
• Update documentation with new variable details
Changes walkthrough 📝
main.tf
Replace hardcoded mapping with variable
main.tf
• Replace hardcoded attribute_mapping with variable reference
• Remove
inline attribute mapping configuration
variables.tf
Add attribute mapping variable with validation
variables.tf
• Add
gcp_workload_identity_pool_provider_attribute_mapping
variable•
Set new default google.subject mapping using user_email, project_id,
job_id
• Include validation for required google.subject field
• Add
assertion_sub attribute mapping
CHANGELOG.md
Document attribute mapping changes
CHANGELOG.md
• Document new attribute mapping variable addition
• Explain change
from assertion.sub to composite google.subject
• Note prevention of
long branch name issues
README.md
Update variable documentation
README.md
• Add documentation for new attribute mapping variable
• Show default
mapping values in table format