generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 41
/
aws_data_source.go
211 lines (206 loc) · 6.53 KB
/
aws_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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
package connector
import (
"github.com/harness/terraform-provider-harness/helpers"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
func DatasourceConnectorAws() *schema.Resource {
resource := &schema.Resource{
Description: "Datasource for looking up an AWS connector.",
ReadContext: resourceConnectorAwsRead,
Schema: map[string]*schema.Schema{
"manual": {
Description: "Use IAM role for service accounts.",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"access_key": {
Description: "AWS access key.",
Type: schema.TypeString,
Computed: true,
},
"access_key_ref": {
Description: "Reference to the Harness secret containing the aws access key." + secret_ref_text,
Type: schema.TypeString,
Computed: true,
},
"access_key_plain_text": {
Description: "The plain text AWS access key.",
Type: schema.TypeString,
Optional: true,
},
"secret_key_ref": {
Description: "Reference to the Harness secret containing the aws secret key." + secret_ref_text,
Type: schema.TypeString,
Computed: true,
},
"delegate_selectors": {
Description: "Connect only use delegates with these tags.",
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"region": {
Description: "Test Region to perform Connection test of AWS Connector" + secret_ref_text,
Type: schema.TypeString,
Optional: true,
},
},
},
},
"irsa": {
Description: "Use IAM role for service accounts.",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"delegate_selectors": {
Description: "The delegates to inherit the credentials from.",
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"region": {
Description: "Test Region to perform Connection test of AWS Connector" + secret_ref_text,
Type: schema.TypeString,
Optional: true,
},
},
},
},
"inherit_from_delegate": {
Description: "Inherit credentials from the delegate.",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"delegate_selectors": {
Description: "The delegates to inherit the credentials from.",
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"region": {
Description: "Test Region to perform Connection test of AWS Connector" + secret_ref_text,
Type: schema.TypeString,
Optional: true,
},
},
},
},
"oidc_authentication": {
Description: "Authentication using harness oidc.",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"iam_role_arn": {
Description: "The IAM Role to assume the credentials from.",
Type: schema.TypeString,
Required: true,
},
"delegate_selectors": {
Description: "The delegates to inherit the credentials from.",
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"region": {
Description: "Test Region to perform Connection test of AWS Connector" + secret_ref_text,
Type: schema.TypeString,
Optional: true,
},
},
},
},
"cross_account_access": {
Description: "Select this option if you want to use one AWS account for the connection, but you want to deploy or build in a different AWS account. In this scenario, the AWS account used for AWS access in Credentials will assume the IAM role you specify in Cross-account role ARN setting. This option uses the AWS Security Token Service (STS) feature.",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"role_arn": {
Description: "The Amazon Resource Name (ARN) of the role that you want to assume. This is an IAM role in the target AWS account.",
Type: schema.TypeString,
Computed: true,
},
"external_id": {
Description: "If the administrator of the account to which the role belongs provided you with an external ID, then enter that value.",
Type: schema.TypeString,
Computed: true,
},
},
},
},
"equal_jitter_backoff_strategy": {
Description: "Equal Jitter BackOff Strategy.",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"base_delay": {
Description: "Base delay.",
Type: schema.TypeInt,
Computed: true,
},
"max_backoff_time": {
Description: "Max BackOff Time.",
Type: schema.TypeInt,
Computed: true,
},
"retry_count": {
Description: "Retry Count.",
Type: schema.TypeInt,
Computed: true,
},
},
},
},
"full_jitter_backoff_strategy": {
Description: "Full Jitter BackOff Strategy.",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"base_delay": {
Description: "Base delay.",
Type: schema.TypeInt,
Computed: true,
},
"max_backoff_time": {
Description: "Max BackOff Time.",
Type: schema.TypeInt,
Computed: true,
},
"retry_count": {
Description: "Retry Count.",
Type: schema.TypeInt,
Computed: true,
},
},
},
},
"fixed_delay_backoff_strategy": {
Description: "Fixed Delay BackOff Strategy.",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"fixed_backoff": {
Description: "Fixed Backoff.",
Type: schema.TypeInt,
Computed: true,
},
"retry_count": {
Description: "Retry Count.",
Type: schema.TypeInt,
Computed: true,
},
},
},
},
},
}
helpers.SetMultiLevelDatasourceSchemaIdentifierRequired(resource.Schema)
return resource
}