Skip to content

Commit

Permalink
Fix PAM entitlement permadiff by enabling PRC (#2174)
Browse files Browse the repository at this point in the history
fixes #2167

Enabled PRC for PAM entitlement to fix a permadiff with an empty object
parameter.
  • Loading branch information
VenelinMartinov authored Jul 10, 2024
1 parent 257f728 commit 10249bf
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
9 changes: 9 additions & 0 deletions provider/provider_yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -957,3 +957,12 @@ func TestFirestoreBackupScheduleNoPermadiff(t *testing.T) {
pt.Up()
pt.Preview(optpreview.ExpectNoChanges())
}

func TestPAMEntitlementPermadiffRegress2167(t *testing.T) {
pt := pulumiTest(t, "test-programs/pam-entitlement", opttest.DownloadProviderVersion("random", "4.16.3"))

proj := getProject()
pt.SetConfig("gcpProj", proj)
pt.Up()
pt.Preview(optpreview.ExpectNoChanges())
}
3 changes: 2 additions & 1 deletion provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,8 @@ func Provider() tfbridge.ProviderInfo {
case "google_datastream_connection_profile",
"google_firestore_backup_schedule",
"google_cloud_run_service",
"google_cloud_run_domain_mapping":
"google_cloud_run_domain_mapping",
"google_privileged_access_manager_entitlement":
return true
default:
return false
Expand Down
2 changes: 2 additions & 0 deletions provider/test-programs/pam-entitlement/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/bin/
/node_modules/
31 changes: 31 additions & 0 deletions provider/test-programs/pam-entitlement/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: gcp_2167
runtime:
name: yaml
config:
gcpProj: string
resources:
entitlementId:
type: random:index/randomString:RandomString
properties:
length: 10
special: false
upper: false
number: true

entitlement:
type: gcp:privilegedaccessmanager:entitlement
properties:
parent: "projects/${gcpProj}"
entitlementId: "${entitlementId.result}"
location: "global"
eligibleUsers:
- principals: ["domain:pulumi.com"]
maxRequestDuration: "7200s"
requesterJustificationConfig:
unstructured: {}
privilegedAccess:
gcpIamAccess:
resource: "//cloudresourcemanager.googleapis.com/projects/${gcpProj}"
resourceType: "cloudresourcemanager.googleapis.com/Project"
roleBindings:
- role: "roles/storage.admin"

0 comments on commit 10249bf

Please sign in to comment.