generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 41
/
vault_data_source.go
156 lines (151 loc) · 4.54 KB
/
vault_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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
package connector
import (
"github.com/harness/terraform-provider-harness/helpers"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
func DataSourceConnectorVault() *schema.Resource {
resource := &schema.Resource{
Description: "DataSource for looking up a Vault connector in Harness.",
ReadContext: resourceConnectorVaultRead,
Schema: map[string]*schema.Schema{
"auth_token": {
Description: "The authentication token for Vault.",
Type: schema.TypeString,
Computed: true,
},
"base_path": {
Description: "The location of the Vault directory where Secret will be stored.",
Type: schema.TypeString,
Computed: true,
},
"vault_url": {
Description: "URL of the HashiCorp Vault.",
Type: schema.TypeString,
Computed: true,
},
"is_read_only": {
Description: "Read only or not.",
Type: schema.TypeBool,
Computed: true,
},
"renewal_interval_minutes": {
Description: "The time interval for token renewal.",
Type: schema.TypeInt,
Computed: true,
},
"secret_engine_manually_configured": {
Description: "Manually entered Secret Engine.",
Type: schema.TypeBool,
Computed: true,
},
"secret_engine_name": {
Description: "Name of the Secret Engine.",
Type: schema.TypeString,
Computed: true,
},
"app_role_id": {
Description: "ID of App Role.",
Type: schema.TypeString,
Computed: true,
},
"secret_id": {
Description: "ID of the Secret.",
Type: schema.TypeString,
Computed: true,
},
"is_default": {
Description: "Is default or not.",
Type: schema.TypeBool,
Computed: true,
},
"secret_engine_version": {
Description: "Version of Secret Engine.",
Type: schema.TypeInt,
Computed: true,
},
"delegate_selectors": {
Description: "List of Delegate Selectors that belong to the same Delegate and are used to connect to the Secret Manager.",
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"namespace": {
Description: "The Vault namespace where Secret will be created.",
Type: schema.TypeString,
Computed: true,
},
"use_k8s_auth": {
Description: "Boolean value to indicate if K8s Auth is used for authentication.",
Type: schema.TypeBool,
Computed: true,
},
"sink_path": {
Description: "The location at which auth token is to be read from.",
Type: schema.TypeString,
Computed: true,
},
"use_vault_agent": {
Description: "Boolean value to indicate if Vault Agent is used for authentication.",
Type: schema.TypeBool,
Computed: true,
},
"use_aws_iam": {
Description: "Boolean value to indicate if AWS IAM is used for authentication.",
Type: schema.TypeBool,
Computed: true,
},
"aws_region": {
Description: "The AWS region where AWS IAM auth will happen.",
Type: schema.TypeString,
Computed: true,
},
"vault_aws_iam_role": {
Description: "The Vault role defined to bind to AWS IAM account/role being accessed.",
Type: schema.TypeString,
Computed: true,
},
"xvault_aws_iam_server_id": {
Description: "The AWS IAM Header Server ID that has been configured for this AWS IAM instance.",
Type: schema.TypeString,
Computed: true,
},
"vault_k8s_auth_role": {
Description: "The role where K8s auth will happen.",
Type: schema.TypeString,
Computed: true,
},
"service_account_token_path": {
Description: "The SA token path where the token is mounted in the K8s Pod.",
Type: schema.TypeString,
Computed: true,
},
"k8s_auth_endpoint": {
Description: "The path where kubernetes auth is enabled in Vault.",
Type: schema.TypeString,
Computed: true,
},
"renew_app_role_token": {
Description: "Boolean value to indicate if appRole token renewal is enabled or not.",
Type: schema.TypeBool,
Computed: true,
},
"access_type": {
Description: "Access type.",
Type: schema.TypeString,
Computed: true,
},
"default": {
Description: "Is default or not.",
Type: schema.TypeBool,
Computed: true,
},
"read_only": {
Description: "Read only.",
Type: schema.TypeBool,
Computed: true,
},
},
}
helpers.SetMultiLevelDatasourceSchemaIdentifierRequired(resource.Schema)
return resource
}