Skip to content

feat: add IdentityPool resource - #47

Open
mac-110 wants to merge 3 commits into
crossplane-contrib:mainfrom
mac-110:feat/add-identity-pool-resource
Open

mac-110 wants to merge 3 commits into
crossplane-contrib:mainfrom
mac-110:feat/add-identity-pool-resource

Conversation

@mac-110

@mac-110 mac-110 commented Mar 6, 2026 •

Copy link
Copy Markdown

Summary

  • Add support for the confluent_identity_pool Terraform resource
  • The resource was already present in the embedded Terraform schema and provider metadata but was not included in the provider's resource configuration

Context

Identity Pools are used in Confluent Cloud to map external identities (e.g. mTLS client certificates) to Confluent principals via Identity Providers. This enables certificate-based authentication for external consumers without API keys.

Terraform resource reference: https://registry.terraform.io/providers/confluentinc/confluent/latest/docs/resources/confluent_identity_pool

Changes

File Change
config/confluent_identity_pool/config.go New resource configurator (Kind: IdentityPool, ShortGroup: confluent)
config/external_name.go Added confluent_identity_pool entry with IdentifierFromProvider
config/provider.go Registered the configurator in the provider pipeline

Note

This PR only adds the resource configuration. The generated types and controller code need to be produced by running make generate as part of the CI/release pipeline. The pattern follows existing resources (e.g. confluent_service_account, confluent_role_binding).

@mac-110
mac-110 force-pushed the feat/add-identity-pool-resource branch from bc4bd1b to 7f9bb20 Compare March 6, 2026 12:11
Add support for the confluent_identity_pool Terraform resource.
The resource was already present in the embedded Terraform schema
and provider metadata but was not included in the provider's
resource configuration.

This adds:
- config/confluent_identity_pool/config.go — resource configurator
- External name configuration entry
- Provider registration

Identity Pools are used in Confluent Cloud to map external identities
(e.g. mTLS client certificates) to Confluent principals via
Identity Providers.

Signed-off-by: mac-110 <alexander.schaefer2@swisscom.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mac-110
mac-110 force-pushed the feat/add-identity-pool-resource branch from 7f9bb20 to abf0e2c Compare March 12, 2026 13:58
@mac-110

mac-110 commented Apr 26, 2026

Copy link
Copy Markdown
Author

is there a reason why it is still not merged?

Run make generate for the confluent_identity_pool configuration and add
an example with the datasource placeholder convention used by the other
examples. Follow-up to the previous commit by mac-110.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Björn Bärtschi <linuxsatellite@gmail.com>
@bisbeb

bisbeb commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Thanks @mac-110, this is a good start. CI never ran on this PR, and the generated files were missing, so I pushed a follow-up commit: make generate output plus an example under examples/identitypool. Not tested against Confluent Cloud yet (no test account, and identityProvider.id needs an Identity Provider, which the provider does not have yet, see #56). If it looks fine to you, I would approve and merge it.

Add the confluent_identity_provider resource and a reference from
IdentityPool.spec.forProvider.identityProvider[].id, so the provider ID
no longer has to be copied by hand. Also keep the imports in
config/provider.go sorted.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Björn Bärtschi <linuxsatellite@gmail.com>
@bisbeb

bisbeb commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Pushed a second follow-up commit (7d489f6): this adds the IdentityProvider resource (confluent_identity_provider, which an Identity Pool always belongs to) and a reference from IdentityPool.spec.forProvider.identityProvider[].id, so the ID no longer has to be copied by hand (idRef / idSelector, same pattern as #58 for ClusterConfig). It also has examples/identityprovider and an updated pool example using idRef, and the imports in config/provider.go are sorted. make reviewable passes; still not tested against Confluent Cloud. @mac-110, please have a look at the two commits on top of yours.

@mac-110

mac-110 commented Nov 13, 2026

Copy link
Copy Markdown
Author

Thanks @bisbeb, both commits look good to me. Adding IdentityProvider in this PR makes sense, since a pool always belongs to one, and the idRef saves copying the ID by hand. Fine to merge from my side.

#58 also touches zz_generated.resolvers.go and zz_generated.deepcopy.go, so whichever of the two lands second needs a rebase and make generate.

@bisbeb bisbeb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving. I went through the hand-written parts (the two config/ files, external_name.go, provider.go, generated.lst, both examples) and the generated reference resolver for identityProvider[].id; CI is green including check-diff. Details in the comment below. Thanks @mac-110 for starting this.

@bisbeb

bisbeb commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Review notes (I approved above). Thanks again @mac-110, this PR started the IdentityPool work.

What I checked

  • config/confluent_identity_pool/config.go and config/confluent_identity_provider/config.go follow the existing resource configs (ShortGroup = "confluent", UseAsync = true, Kind); the reference uses the short form Type: "IdentityProvider" like api_key, kafka_acl, kafka_topic and role_binding do.
  • IdentifierFromProvider for both is right since Confluent assigns the IDs.
  • The generated resolver for IdentityPool resolves spec.forProvider.identityProvider[].id through idRef / idSelector against IdentityProvider. I did not read the generated types and CRDs line by line; check-diff is green, so they match what make generate produces from the config.
  • generated.lst, external_name.go and provider.go list both resources.

Tested locally against a mock of the Confluent API (provider run out of cluster, responses based on the fixtures of the Terraform provider; nothing of this is in the PR): both resources reach Ready and Synced, the pool waits for the provider and then resolves identityProvider[].idRef to its ID (the POST goes to /iam/v2/identity-providers/<id>/identity-pools), updates reach the API, and deletion runs pool first, then provider.

Not tested: anything against real Confluent Cloud. That includes whether Confluent accepts real issuers and JWKS URIs and what the API returns for invalid values. The examples use ${data.…} placeholders like the other examples and need real values when applied by hand.

I'll tick confluent_identity_pool and confluent_identity_provider in #56 after the merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants