hashicorp / terraform-provider-consul

Terraform Consul provider
https://www.terraform.io/docs/providers/consul/
Mozilla Public License 2.0
125 stars 113 forks source link

Support `service-intentions` Configuration Entry Kind #235

Closed lawliet89 closed 3 years ago

lawliet89 commented 4 years ago

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

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.

Terraform v0.13.5
+ provider registry.terraform.io/hashicorp/consul v2.10.1

Affected Resource(s)

Please list the resources as a list, for example:

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "consul_config_entry" "external_http_intention" {
  for_each = var.external_http_services

  kind = "service-intentions"
  name = each.key

  config_json = jsonencode({
    Sources = [
      {
        Name   = "*"
        Action = "Allow"
      }
    ]
  })
}

Expected Behavior

Creation is successful

Actual Behavior

Error: Failed to decode config entry: invalid config entry kind: service-intentions

  on main.tf line 57, in resource "consul_config_entry" "external_http_intention":
  57: resource "consul_config_entry" "external_http_intention" {

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

I understand that this is only supported in Consul 1.9 which is still beta at the time of writing. I think this can be "easily" fixed by bumping the API client dependency version.

remilapeyre commented 4 years ago

Hi @lawliet89, I opened https://github.com/hashicorp/terraform-provider-consul/pull/232 to add the support for the service-intentions configuration entry.

In theory it should work properly and I could not find issues during my tests. I would like to wait for the actual release of the 1.9 API client (or at least a release candidate) since as you said Consul 1.9 is in beta for now.

I think you should be safe in using a version of the provider with this change merged thought and if you test it I would grateful if you could report any bug or issues you find with it.

lawliet89 commented 3 years ago

@remilapeyre Consul 1.9 is out! Could we get #232 merged in for a new release? Thank you for your help.

remilapeyre commented 3 years ago

Hi I will try do it in the coming days :)

lawliet89 commented 3 years ago

It's merged! Thanks for your help. Now, to get a release 😝