-
Notifications
You must be signed in to change notification settings - Fork 111
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 namespace and meta in consul_config_entry #246
Comments
We are feeling this as a serious gap and hope it is easy as it looks to fix it as we would badly need to create config entry into namespaces. |
Hi @brucec5 and @fabio-grassi-gbs, sorry for the time it took me to take care of this issue, #256 should do what you are looking for. I will make a new release of the provider shortly. Here's how you should be able to set a namespace and use the resource "consul_namespace" "example_namespace" {
name = "example"
description = "Example namespace"
}
resource "consul_config_entry" "test_intentions" {
kind = "service-intentions"
name = "destination-service"
namespace = consul_namespace.example_namespace.name
config_json = jsonencode({
Sources = [
{
Action = "allow"
Name = "source-service"
}
]
Meta = {
foo = "bar"
}
})
} The |
Thanks a lot. Ciao ,FG
Da: Rémi Lapeyre ***@***.***>
Inviato: domenica 9 maggio 2021 17:03
A: hashicorp/terraform-provider-consul ***@***.***>
Cc: Grassi Fabio ***@***.***>; Mention ***@***.***>
Oggetto: Re: [hashicorp/terraform-provider-consul] Support namespace and meta in consul_config_entry (#246)
Hi @brucec5<https://github.com/brucec5> and @fabio-grassi-gbs<https://github.com/fabio-grassi-gbs>, sorry for the time it took me to take care of this issue, #256<#256> should do what you are looking for. I will make a new release of the provider shortly.
Here's how you should be able to set a namespace and use the meta parameter:
resource "consul_namespace" "example_namespace" {
name = "example"
description = "Example namespace"
}
resource "consul_config_entry" "test_intentions" {
kind = "service-intentions"
name = "destination-service"
namespace = consul_namespace.example_namespace.name
config_json = jsonencode({
Sources = [
{
Action = "allow"
Name = "source-service"
}
]
Meta = {
foo = "bar"
}
})
}
The consul_config_entry resource is a bit weird as the schema cannot be expressed nicely with the Terraform SDK v1. I will finally remove the support for Terraform 0.11 and should be able to improve it then.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#246 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOZISPB5XYS6OMDLC5VSS5TTM2P4DANCNFSM4ZLOAJ2A>.
|
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Per the docs, it appears that all config entry kinds should support a
namespace
param. In my use-case, it is especially important forservice-intentions
to support this, but other config entries should support it too.Relatedly, it looks like
meta
isn't supported either, despite being a parameter for all config entry kinds.I'm able to write the same service intention directly via
consul config write
:Actual Behavior
Steps to Reproduce
consul agent -dev
(consul version 1.9.4+ent)terraform apply
Important Factoids
As mentioned above, I'm using consul 1.9.4+ent
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
The text was updated successfully, but these errors were encountered: