generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 40
/
text_data_source.go
59 lines (54 loc) · 1.55 KB
/
text_data_source.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package secret
import (
"github.com/harness/terraform-provider-harness/helpers"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
func DataSourceSecretText() *schema.Resource {
resource := &schema.Resource{
Description: "DataSource for looking up secret of type secret text.",
ReadContext: resourceSecretTextRead,
Schema: map[string]*schema.Schema{
"secret_manager_identifier": {
Description: "Identifier of the Secret Manager used to manage the secret.",
Type: schema.TypeString,
Computed: true,
},
"value_type": {
Description: "This has details to specify if the secret value is Inline or Reference.",
Type: schema.TypeString,
Computed: true,
},
"value": {
Description: "Value of the Secret",
Type: schema.TypeString,
Sensitive: true,
Computed: true,
},
"additional_metadata": {
Description: "Additional Metadata for the Secret",
Type: schema.TypeList,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"values": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"version": {
Type: schema.TypeString,
Optional: true,
},
// Add other fields for the inner map as needed
},
},
},
// Add other fields for the outer map as needed
},
},
},
},
}
helpers.SetMultiLevelDatasourceSchemaIdentifierRequired(resource.Schema)
return resource
}