Skip to content
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

Support resource_pattern_type_filter #39

Closed
wants to merge 4 commits into from
Closed

Conversation

Mongey
Copy link
Owner

@Mongey Mongey commented Dec 12, 2018

Should address #38

@Mongey Mongey added the WIP Work In Progress label Dec 12, 2018
@Mongey
Copy link
Owner Author

Mongey commented Dec 13, 2018

👋 @dmazhar-cogniance If you want to try this out, you can grab the binary (for linux) from CI @
https://256-103748731-gh.circle-artifacts.com/0/terraform-provider-kafka

Not exactly sure how to write kafka acl's, but a quick run of this config seemed to work

resource "kafka_acl" "test" {
   resource_name                = "syslog*"
   resource_type                = "Topic"
   resource_pattern_type_filter = "prefixed"
   acl_principal                = "User:Alice"
   acl_host                     = "*"
   acl_operation                = "Write"
   acl_permission_type          = "Allow"
 }

@dmazhar-cogniance
Copy link

Hi! Thanks for such a quick reaction :)
I tested the CI build, a little. The ACL is created as a charm, but looks like there is a problem with deleting the created ACLs. When I'm removing the ACL from terraform code it is not deleting from kafka. If I'm changing it terraform is marking ACL to recreate (-/+), creating new one, but not deleting the old ACL.

@dmazhar-cogniance
Copy link

It looks like the ACLs are not deleted still. Not sure regarding sarama, but kafka-acls.sh (from kafka distributions) requires the --resource-pattern-type prefixed parameter when deleting the ACLs. Could it be the cause of the issue?

@Mongey
Copy link
Owner Author

Mongey commented Dec 13, 2018

Thanks for the details.

🤔 There's some issues with how ACLFilters are constructed, I'll need to take a look at the kafka-acls.sh and see how it handles it

@Mongey
Copy link
Owner Author

Mongey commented Dec 13, 2018

😅 Whoops, looks like I was sending v0 requests for {Delete,Describe}ACLs.

The new build should fix deletion.

@dmazhar-cogniance
Copy link

Works like a charm now! Thanks again 👍

@Mongey
Copy link
Owner Author

Mongey commented Dec 13, 2018

🙌 Great, I'll merge once I figure out the whole Kafka v1 / v2 compatibility 😄

@Mongey
Copy link
Owner Author

Mongey commented Apr 14, 2019

Went with a slightly different approach over in #50

@Mongey Mongey closed this Apr 14, 2019
@Mongey Mongey deleted the cm-prefix-support branch August 22, 2019 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work In Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants