sematext / terraform-provider-sematext

Sematext Terraform Provider
https://sematext.com
Mozilla Public License 2.0
3 stars 1 forks source link

Add sematext_api_key to provider {} code block #55

Closed Invincibear closed 1 week ago

Invincibear commented 2 weeks ago

Only being able to pass the API key via an environment variable is restrictive, especially since we want to retrieve the Sematext API key stored in a key vault. There is no way to set an environment variable from within Terraform code before Terraform interprets the provider{} blocks, it must be already set or passed in using --TF_VAR_*, which means I can't pull the value of the API_KEY from anywhere for use within the Sematext Terraform provider.

I'll come up with a PR for this since it should be relatively trivial to add.

hollerloudly commented 1 week ago

Thanks for PR - applied, released in v0.6.2

Invincibear commented 1 week ago

It looks like I submitted an invalid PR.

 Error: InternalValidate
│ 
│   with provider["registry.terraform.io/sematext/sematext"],
│   on providers.tf line 56, in provider "sematext":
│   56: provider "sematext" {
│ 
│ Internal validation of the provider failed! This is always a bug
│ with the provider itself, and not a user issue. Please report
│ this bug:
│ 
│ 1 error occurred:
│   * sematext_api_key: One of optional, required, or computed must be set

instead of required: false in the provider definition I should've used optional: true. I'll fix this now, should probably replace the deployment, sorry for the trouble. It is difficult to build and test this locally, I have to replace several references to the sematext git account to my own which makes submitting the PR challenging too.

hollerloudly commented 1 week ago

Thanks - older Required : false vs newer Optional : true. Good catch, PR - applied and regenerated, released in v0.6.3

hollerloudly commented 1 week ago

Closing