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 complex configuration in consul_certificate_authority #341

Merged
merged 3 commits into from
Jul 24, 2023

Conversation

remilapeyre
Copy link
Contributor

When configuration Consul to use Vault as the certificate authority provider for Consul Connect the configuration can have more than strings so we need to use jsonencode for Terraform to accept the configuration.

Also remove the copyright notices in the examples.

Closes #324

When configuration Consul to use Vault as the certificate authority
provider for Consul Connect the configuration can have more than strings
so we need to use jsonencode for Terraform to accept the configuration.

Also remove the copyright notices in the examples.

Closes hashicorp#324
@sorenisanerd
Copy link

I haven't reviewed the code, but I'm running into the issue that this is aiming to address. Specifically, I want to use AppRole between Consul and Vault, and there's currently no way to trick Terraform into passing the Params struct that Consul expects.

Copy link
Contributor

@dhiaayachi dhiaayachi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@remilapeyre A comment about the general approach here, and please disregard if you think that's not achievable. Do you think it's possible instead of introducing config_json we can accept the new format in config and at the read time, check if it's json or not by attempting an unmarchall? As I see both fields have the same type schema and decode to map[string]interface{}

ForceNew: true,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
Description: "The raw configuration to use for the chosen provider. For more information on configuring the Connect CA providers, see [Provider Config](https://developer.hashicorp.com/consul/docs/connect/ca).",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should mention that this is expected to be a json configuration in the description?

@remilapeyre
Copy link
Contributor Author

@remilapeyre A comment about the general approach here, and please disregard if you think that's not achievable. Do you think it's possible instead of introducing config_json we can accept the new format in config and at the read time, check if it's json or not by attempting an unmarchall? As I see both fields have the same type schema and decode to map[string]interface{}

Hi @dhiaayachi this is not possible with the version of the Terraform plugin protocol that we are using now. I'm working a new major version of the Consul provider that uses Terraform protocol v6 and that should have a much better user experience for this kind of attributes.

@remilapeyre remilapeyre merged commit 5f1ede6 into hashicorp:master Jul 24, 2023
@remilapeyre remilapeyre deleted the issue-324 branch July 24, 2023 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

consul_certificate_authority resource doesn't support Vault auth method configuration
3 participants