-
Notifications
You must be signed in to change notification settings - Fork 113
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
Import service-intentions + Separate consul_config_entry
for each service-intentions
#316
Comments
The old |
Upgraded my HCS Cluster today to v1.11.6 (my clients are v1.12.3). I now see that the old With that in mind, what are we to do to ensure that we can add these separately and also import them? I COULD use a K8S CRD, but I don't love that. |
Hi @DaleyKD, the HTTP API changed regarding the Consul Intentions and the Terraform provider reflect this. I understand that it can be useful to be able to set one intention for a service in a Terraform configuration without changing the other ones. I will look for a solution to support this. |
@remilapeyre : Totally understood and greatly appreciated. For the time being, though it's not my preferred method, I will go be using the K8S CRD YAMLs. |
@remilapeyre : Went to try and get all the K8S CRDs setup today, and quickly found out that this, too, doesn't work. When I use Terraform to create a new microservice, I want it to be able to setup the intentions that it needs. This new microservice is the SOURCE, not the destination. However, Consul has it completely inverted: you key off the destination, and it has to know all of its sources. How can a destination know of its sources if I've never created it before? To me, this seems highly illogical. Instead of Even if Consul doesn't want to go that route, there should at least be a way to add to the source array after the fact. I'm having to totally change how I do Terraform to handle this. |
Hi @DaleyKD, I understand what you mean. The current implementation in the Consul API lets each service control who can access it, which is logical as if the caller and the callee are managed by different teams (they could even be on different Consul cluster) the callee's team should be able to control who can access the service, not the caller's. I understand that having to manage them from a centralised resource might not be ideal and that you would like to control the access for a specific source and a destination, rather than having to define all sources for a destination at once. The previous API for Connect intentions used to allow this (https://www.consul.io/api-docs/connect/intentions#create-intention-with-id) but has been deprecated now that intentions are part of config entries. I will reach out to the Consul team to know if there is any plan to add support for this. |
When you write it up like that, explaining the responsibilities of the team, of course it makes sense. 😃 DERP! But that doesn't fit our company's workflow now. Thanks for your consideration! |
Hello, I'm having this exact problem right now, thanks for looking into it ! Currently we're forced to keep using the consul_intention resource, because you cannot use the config_entry resource multiple times for the same service, it'll just override with the latest apply and everything else before that will be gone. example: |
As @remilapeyre explained, there is a reason why is the service owner the one allowing access so the expected workflow is for the owner of the calling service to ask permission to the called service's owner who then adds the allowed accesses to the intentions' array. Not tested, but I don't see why it wouldn't work, what you could do in your scenario is registering your calling services, either on consul itself under a known prefix, or in terraform state for the called service to lookup. That lookup, in turn, builds the origins array. For a complete solution, "editing" the lookup source should trigger a rebuild of the called service's intentions. |
This seems like something that could be easily handled using Consul's |
Hi there,
Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.
Terraform Version
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Expected Behavior
I have many modules that install their infrastructure separately. They need to be able to configure their own intentions individually.
Module "Account API" should be able to setup its own set of intentions.
Module "Admin Web" should be able to setup its own intentions, separately.
Also, I should be able to import intentions that were previously created.
Actual Behavior
It appears that this resource doesn't allow importing.
Also, the documentation implies that I have to set up all intentions at once and can't do them separately.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
The text was updated successfully, but these errors were encountered: