generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 41
/
sshkey_data_source.go
161 lines (153 loc) · 4.4 KB
/
sshkey_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
157
158
159
160
161
package secret
import (
"github.com/harness/terraform-provider-harness/helpers"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
func DataSourceSecretSSHKey() *schema.Resource {
resource := &schema.Resource{
Description: "Resource for looking up an SSH Key type secret.",
ReadContext: resourceSecretSSHKeyRead,
Schema: map[string]*schema.Schema{
"port": {
Description: "SSH port",
Type: schema.TypeInt,
Computed: true,
},
"kerberos": {
Description: "Kerberos authentication scheme",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"principal": {
Description: "Username to use for authentication.",
Type: schema.TypeString,
Computed: true,
},
"realm": {
Description: "Reference to a secret containing the password to use for authentication.",
Type: schema.TypeString,
Computed: true,
},
"tgt_generation_method": {
Description: "Method to generate tgt",
Type: schema.TypeString,
Computed: true,
},
"tgt_key_tab_file_path_spec": {
Description: "Authenticate to App Dynamics using username and password.",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"key_path": {
Description: "key path",
Type: schema.TypeString,
Computed: true,
},
},
},
},
"tgt_password_spec": {
Description: "Authenticate to App Dynamics using username and password.",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"password": {
Description: "password",
Type: schema.TypeString,
Computed: true,
},
},
},
},
},
},
},
"ssh": {
Description: "Kerberos authentication scheme",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"credential_type": {
Description: "This specifies SSH credential type as Password, KeyPath or KeyReference",
Type: schema.TypeString,
Computed: true,
},
"sshkey_path_credential": {
Description: "SSH credential of type keyPath",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"user_name": {
Description: "SSH Username.",
Type: schema.TypeString,
Computed: true,
},
"key_path": {
Description: "Path of the key file.",
Type: schema.TypeString,
Computed: true,
},
"encrypted_passphrase": {
Description: "Encrypted Passphrase",
Type: schema.TypeString,
Computed: true,
},
},
},
},
"sshkey_reference_credential": {
Description: "SSH credential of type keyReference",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"user_name": {
Description: "SSH Username.",
Type: schema.TypeString,
Computed: true,
},
"key": {
Description: "SSH key.",
Type: schema.TypeString,
Computed: true,
},
"encrypted_assphrase": {
Description: "Encrypted Passphrase",
Type: schema.TypeString,
Computed: true,
},
},
},
},
"ssh_password_credential": {
Description: "SSH credential of type keyReference",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"user_name": {
Description: "SSH Username.",
Type: schema.TypeString,
Computed: true,
},
"password": {
Description: "SSH Password.",
Type: schema.TypeString,
Computed: true,
},
},
},
},
},
},
},
},
}
helpers.SetMultiLevelDatasourceSchema(resource.Schema)
return resource
}