scaleway / terraform-provider-scaleway

Terraform Scaleway provider
https://www.terraform.io/docs/providers/scaleway/
Mozilla Public License 2.0
198 stars 123 forks source link

scaleway_secret_version datasource - Filters additions #2655

Closed jgalais closed 3 weeks ago

jgalais commented 1 month ago

Community Note

Description

Hello,

I use "scaleway_secret_version" data_source but some filters can be add to enhanced this datasource.

Filter addition proposal:

It's an important thing because currently you must target the specific version. If you want to split the secret version cycle and your Infrastructure as Code you can't do.

Can you add that on this resource too to have complete integration ? i'am available if you have questions.

New or Affected Resource(s)

Potential Terraform Configuration

data "scaleway_secret_version" "application_admin_password" {
  project_id = "XXXXXXXX"
  revision   = "latest"
}

Thank you for your work.

Regards,

jgalais commented 1 month ago

Hello,

I edited my message to drop the path filter. It was a poor understanding on my part because the path can be use on "scaleway_secret" data source.

Regards,

Codelax commented 3 weeks ago

Hi, as it is supported by the API, you should already be able to use latest in your revision filter. I added its usage to our tests and it seems to work fine:

data "scaleway_secret_version" "data_by_name_latest" {
  secret_name = scaleway_secret.main.name
  revision    = "latest"
}

Thanks for reporting this, I also added a bit more info to the documentation

jgalais commented 3 weeks ago

Hello,

Thank you for your work.