hashicorp / terraform-provider-consul

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

feat: Add data lookup for consul_config resources #317

Closed dekimsey closed 1 year ago

dekimsey commented 2 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

Terraform v1.2.6
on darwin_arm64
+ provider registry.terraform.io/hashicorp/consul v2.15.1

Your version of Terraform is out of date! The latest version
is 1.2.8. You can update by downloading from https://www.terraform.io/downloads.html

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

data "consul_config" {
  name = "foobar"
  kind = "service-defaults"
}

output "foobar-protocol" {
  value = data.consul_config.foobar.data.protocol
}

Debug Output

n/a

Panic Output

n/a

Expected Behavior

I can perform data lookups.

Actual Behavior

Not implemented

Steps to Reproduce

  1. terraform apply

Important Factoids

For instance incorrectly setting a consul config service router or ingress gateway configuration with services that do not have the corresponding protocols is a hard error. But there exists no mechanism from TF to be able to query details about consul_config.

Since config resources are optional, I'm not sure how that'd be handled here. TF data conventions don't always play well with empty return results.

References

None