ovh / terraform-provider-ovh

Terraform OVH provider
https://registry.terraform.io/providers/ovh/ovh/latest/docs
Mozilla Public License 2.0
182 stars 133 forks source link

[FEATURE] [Logs Data Platform] Get the write token of a logs data stream #686

Closed pgillet closed 1 month ago

pgillet commented 1 month ago

Description

It is not possible to retrieve the write token of a logs data stream within Terraform, while the HTTP endpoint GET /dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/rule/{ruleId} exists in the OVHcloud HTTP API.

Affected Resource(s) and/or Data Source(s)

Potential Terraform Configuration

If would be convenient to return a write_token attribute in the resource (and data source) ovh_dbaas_logs_graylog_output_stream or to add a new resource/data source just to get the token associated to a data stream.

131 commented 1 month ago

For now, using the API to retrieve this is a pain, when everything else can be properly handled by the terraform provider

amstuta commented 1 month ago

Hello @pgillet, thanks for your issue. I guess the better solution would be to add a field in resource/datasource ovh_dbaas_logs_graylog_output_stream like you said, with the value being empty if you are not the owner of the stream (since in that case you don't have access to the write token). We will work on this shortly.

pgillet commented 1 month ago

That was fast!

For my understanding, does it mean that we have to provide our own token when creating the data stream?

amstuta commented 1 month ago

No, the write token is only computed, you cannot set it manually ;)