-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix(iam_workload_identity_pool_provider): fix jwks_json permadiff #16065
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
base: main
Are you sure you want to change the base?
Conversation
|
Hello! I am a robot. Tests will require approval from a repository maintainer to run. Googlers: For automatic test runs see go/terraform-auto-test-runs. @NickElliot, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
This reverts commit 5eb85b2.
|
@NickElliot This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
|
@GoogleCloudPlatform/terraform-team @NickElliot This PR has been waiting for review for 1 week. Please take a look! Use the label |
NickElliot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, could you clarify the nature of what this is doing to fix the permadiff scenario?
|
Hi, this fix addresses the permadiff issue by implementing a custom The following example, which passes json to jwks_json field, causes a permadiff since the provider directly uses the string that Google Cloud returns. resource "google_iam_workload_identity_pool" "this" {
project = var.project_id
workload_identity_pool_id = "example-pool"
}
resource "google_iam_workload_identity_pool_provider" "this" {
project = var.project_id
workload_identity_pool_id = google_iam_workload_identity_pool.this.workload_identity_pool_id
workload_identity_pool_provider_id = "example-prvdr"
attribute_mapping = {
"google.subject" = "assertion.sub"
}
oidc {
allowed_audiences = ["https://example.com/gcp-oidc-federation", "example.com/gcp-oidc-federation"]
issuer_uri = "https://sts.windows.net/azure-tenant-id"
jwks_json = jsonencode({
keys = [{
kty = "RSA"
alg = "RS256"
kid = "sif0AR-F6MuvksAyAOv-Pds08Bcf2eUMlxE30NofddA"
use = "sig"
e = "AQAB"
n = "ylH1Chl1tpfti3lh51E1g5dPogzXDaQseqjsefGLknaNl5W6Wd4frBhHyE2t41Q5zgz_Ll0-NvWm0FlaG6brhrN9QZu6sJP1bM8WPfJVPgXOanxi7d7TXCkeNubGeiLTf5R3UXtS9Lm_guemU7MxDjDTelxnlgGCihOVTcL526suNJUdfXtpwUsvdU6_ZnAp9IpsuYjCtwPm9hPumlcZGMbxstdh07O4y4O90cVQClJOKSGQjAUCKJWXIQ0cqffGS_HuS_725CPzQ85SzYZzaNpgfhAER7kx_9P16ARM3BJz0PI5fe2hECE61J4GYU_BY43sxDfs7HyJpEXKLU9eWw"
}]
})
}
}terraform plan shows the following diff because of the behavior. |
Fixes hashicorp/terraform-provider-google#23259
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.