From 15bf57bee5c0dde5b78a1e53809642f8a010f873 Mon Sep 17 00:00:00 2001 From: sam Date: Thu, 12 Dec 2024 12:10:02 +0000 Subject: [PATCH] Add schema for secret data source This will enable the option of referencing secrets by name which may be more convenient than always using id. This commit was auto-generated. --- .../secret/secret_data_source_gen.go | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 internal/datasources/secret/secret_data_source_gen.go diff --git a/internal/datasources/secret/secret_data_source_gen.go b/internal/datasources/secret/secret_data_source_gen.go new file mode 100644 index 0000000..9c16d9c --- /dev/null +++ b/internal/datasources/secret/secret_data_source_gen.go @@ -0,0 +1,32 @@ +// Code generated by terraform-plugin-framework-generator DO NOT EDIT. + +package secret + +import ( + "context" + "github.com/hashicorp/terraform-plugin-framework/types" + + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" +) + +func SecretDataSourceSchema(ctx context.Context) schema.Schema { + return schema.Schema{ + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + Description: "The UUID of the secret", + MarkdownDescription: "The UUID of the secret", + }, + "name": schema.StringAttribute{ + Required: true, + Description: "The name of the secret", + MarkdownDescription: "The name of the secret", + }, + }, + } +} + +type SecretModel struct { + Id types.String `tfsdk:"id"` + Name types.String `tfsdk:"name"` +}