generated from hashicorp/terraform-provider-scaffolding
/
resolver_singular_data_source_gen.go
409 lines (396 loc) · 18.3 KB
/
resolver_singular_data_source_gen.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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Code generated by generators/singular-data-source/main.go; DO NOT EDIT.
package appsync
import (
"context"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-provider-awscc/internal/generic"
"github.com/hashicorp/terraform-provider-awscc/internal/registry"
)
func init() {
registry.AddDataSourceFactory("awscc_appsync_resolver", resolverDataSource)
}
// resolverDataSource returns the Terraform awscc_appsync_resolver data source.
// This Terraform data source corresponds to the CloudFormation AWS::AppSync::Resolver resource.
func resolverDataSource(ctx context.Context) (datasource.DataSource, error) {
attributes := map[string]schema.Attribute{ /*START SCHEMA*/
// Property: ApiId
// CloudFormation resource type schema:
//
// {
// "description": "The APSYlong GraphQL API to which you want to attach this resolver.",
// "type": "string"
// }
"api_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The APSYlong GraphQL API to which you want to attach this resolver.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: CachingConfig
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The caching configuration for the resolver.",
// "properties": {
// "CachingKeys": {
// "description": "The caching keys for a resolver that has caching activated.\n Valid values are entries from the ``$context.arguments``, ``$context.source``, and ``$context.identity`` maps.",
// "insertionOrder": false,
// "items": {
// "type": "string"
// },
// "type": "array",
// "uniqueItems": false
// },
// "Ttl": {
// "description": "The TTL in seconds for a resolver that has caching activated.\n Valid values are 1?3,600 seconds.",
// "type": "number"
// }
// },
// "required": [
// "Ttl"
// ],
// "type": "object"
// }
"caching_config": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: CachingKeys
"caching_keys": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "The caching keys for a resolver that has caching activated.\n Valid values are entries from the ``$context.arguments``, ``$context.source``, and ``$context.identity`` maps.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Ttl
"ttl": schema.Float64Attribute{ /*START ATTRIBUTE*/
Description: "The TTL in seconds for a resolver that has caching activated.\n Valid values are 1?3,600 seconds.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The caching configuration for the resolver.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Code
// CloudFormation resource type schema:
//
// {
// "description": "The ``resolver`` code that contains the request and response functions. When code is used, the ``runtime`` is required. The runtime value must be ``APPSYNC_JS``.",
// "type": "string"
// }
"code": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The ``resolver`` code that contains the request and response functions. When code is used, the ``runtime`` is required. The runtime value must be ``APPSYNC_JS``.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: CodeS3Location
// CloudFormation resource type schema:
//
// {
// "description": "The Amazon S3 endpoint.",
// "type": "string"
// }
"code_s3_location": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Amazon S3 endpoint.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: DataSourceName
// CloudFormation resource type schema:
//
// {
// "description": "The resolver data source name.",
// "type": "string"
// }
"data_source_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The resolver data source name.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: FieldName
// CloudFormation resource type schema:
//
// {
// "description": "The GraphQL field on a type that invokes the resolver.",
// "type": "string"
// }
"field_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The GraphQL field on a type that invokes the resolver.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Kind
// CloudFormation resource type schema:
//
// {
// "description": "The resolver type.\n + *UNIT*: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.\n + *PIPELINE*: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of ``Function`` objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.",
// "type": "string"
// }
"kind": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The resolver type.\n + *UNIT*: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.\n + *PIPELINE*: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of ``Function`` objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: MaxBatchSize
// CloudFormation resource type schema:
//
// {
// "description": "The maximum number of resolver request inputs that will be sent to a single LAMlong function in a ``BatchInvoke`` operation.",
// "type": "integer"
// }
"max_batch_size": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "The maximum number of resolver request inputs that will be sent to a single LAMlong function in a ``BatchInvoke`` operation.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: MetricsConfig
// CloudFormation resource type schema:
//
// {
// "description": "Enables or disables enhanced resolver metrics for specified resolvers. Note that ``MetricsConfig`` won't be used unless the ``resolverLevelMetricsBehavior`` value is set to ``PER_RESOLVER_METRICS``. If the ``resolverLevelMetricsBehavior`` is set to ``FULL_REQUEST_RESOLVER_METRICS`` instead, ``MetricsConfig`` will be ignored. However, you can still set its value.",
// "enum": [
// "ENABLED",
// "DISABLED"
// ],
// "type": "string"
// }
"metrics_config": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Enables or disables enhanced resolver metrics for specified resolvers. Note that ``MetricsConfig`` won't be used unless the ``resolverLevelMetricsBehavior`` value is set to ``PER_RESOLVER_METRICS``. If the ``resolverLevelMetricsBehavior`` is set to ``FULL_REQUEST_RESOLVER_METRICS`` instead, ``MetricsConfig`` will be ignored. However, you can still set its value.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: PipelineConfig
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "Functions linked with the pipeline resolver.",
// "properties": {
// "Functions": {
// "description": "A list of ``Function`` objects.",
// "insertionOrder": false,
// "items": {
// "type": "string"
// },
// "type": "array",
// "uniqueItems": false
// }
// },
// "type": "object"
// }
"pipeline_config": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Functions
"functions": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "A list of ``Function`` objects.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "Functions linked with the pipeline resolver.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: RequestMappingTemplate
// CloudFormation resource type schema:
//
// {
// "description": "The request mapping template.\n Request mapping templates are optional when using a Lambda data source. For all other data sources, a request mapping template is required.",
// "type": "string"
// }
"request_mapping_template": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The request mapping template.\n Request mapping templates are optional when using a Lambda data source. For all other data sources, a request mapping template is required.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: RequestMappingTemplateS3Location
// CloudFormation resource type schema:
//
// {
// "description": "The location of a request mapping template in an S3 bucket. Use this if you want to provision with a template file in S3 rather than embedding it in your CFNshort template.",
// "type": "string"
// }
"request_mapping_template_s3_location": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The location of a request mapping template in an S3 bucket. Use this if you want to provision with a template file in S3 rather than embedding it in your CFNshort template.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ResolverArn
// CloudFormation resource type schema:
//
// {
// "description": "",
// "type": "string"
// }
"resolver_arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ResponseMappingTemplate
// CloudFormation resource type schema:
//
// {
// "description": "The response mapping template.",
// "type": "string"
// }
"response_mapping_template": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The response mapping template.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ResponseMappingTemplateS3Location
// CloudFormation resource type schema:
//
// {
// "description": "The location of a response mapping template in an S3 bucket. Use this if you want to provision with a template file in S3 rather than embedding it in your CFNshort template.",
// "type": "string"
// }
"response_mapping_template_s3_location": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The location of a response mapping template in an S3 bucket. Use this if you want to provision with a template file in S3 rather than embedding it in your CFNshort template.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Runtime
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "Describes a runtime used by an APSYlong resolver or APSYlong function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.",
// "properties": {
// "Name": {
// "description": "The ``name`` of the runtime to use. Currently, the only allowed value is ``APPSYNC_JS``.",
// "type": "string"
// },
// "RuntimeVersion": {
// "description": "The ``version`` of the runtime to use. Currently, the only allowed version is ``1.0.0``.",
// "type": "string"
// }
// },
// "required": [
// "RuntimeVersion",
// "Name"
// ],
// "type": "object"
// }
"runtime": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Name
"name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The ``name`` of the runtime to use. Currently, the only allowed value is ``APPSYNC_JS``.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: RuntimeVersion
"runtime_version": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The ``version`` of the runtime to use. Currently, the only allowed version is ``1.0.0``.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "Describes a runtime used by an APSYlong resolver or APSYlong function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SyncConfig
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The ``SyncConfig`` for a resolver attached to a versioned data source.",
// "properties": {
// "ConflictDetection": {
// "description": "The Conflict Detection strategy to use.\n + *VERSION*: Detect conflicts based on object versions for this resolver.\n + *NONE*: Do not detect conflicts when invoking this resolver.",
// "type": "string"
// },
// "ConflictHandler": {
// "description": "The Conflict Resolution strategy to perform in the event of a conflict.\n + *OPTIMISTIC_CONCURRENCY*: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.\n + *AUTOMERGE*: Resolve conflicts with the Automerge conflict resolution strategy.\n + *LAMBDA*: Resolve conflicts with an LAMlong function supplied in the ``LambdaConflictHandlerConfig``.",
// "type": "string"
// },
// "LambdaConflictHandlerConfig": {
// "additionalProperties": false,
// "description": "The ``LambdaConflictHandlerConfig`` when configuring ``LAMBDA`` as the Conflict Handler.",
// "properties": {
// "LambdaConflictHandlerArn": {
// "description": "The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.",
// "type": "string"
// }
// },
// "type": "object"
// }
// },
// "required": [
// "ConflictDetection"
// ],
// "type": "object"
// }
"sync_config": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: ConflictDetection
"conflict_detection": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Conflict Detection strategy to use.\n + *VERSION*: Detect conflicts based on object versions for this resolver.\n + *NONE*: Do not detect conflicts when invoking this resolver.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ConflictHandler
"conflict_handler": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Conflict Resolution strategy to perform in the event of a conflict.\n + *OPTIMISTIC_CONCURRENCY*: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.\n + *AUTOMERGE*: Resolve conflicts with the Automerge conflict resolution strategy.\n + *LAMBDA*: Resolve conflicts with an LAMlong function supplied in the ``LambdaConflictHandlerConfig``.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: LambdaConflictHandlerConfig
"lambda_conflict_handler_config": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: LambdaConflictHandlerArn
"lambda_conflict_handler_arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The ``LambdaConflictHandlerConfig`` when configuring ``LAMBDA`` as the Conflict Handler.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The ``SyncConfig`` for a resolver attached to a versioned data source.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: TypeName
// CloudFormation resource type schema:
//
// {
// "description": "The GraphQL type that invokes this resolver.",
// "type": "string"
// }
"type_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The GraphQL type that invokes this resolver.",
Computed: true,
}, /*END ATTRIBUTE*/
} /*END SCHEMA*/
attributes["id"] = schema.StringAttribute{
Description: "Uniquely identifies the resource.",
Required: true,
}
schema := schema.Schema{
Description: "Data Source schema for AWS::AppSync::Resolver",
Attributes: attributes,
}
var opts generic.DataSourceOptions
opts = opts.WithCloudFormationTypeName("AWS::AppSync::Resolver").WithTerraformTypeName("awscc_appsync_resolver")
opts = opts.WithTerraformSchema(schema)
opts = opts.WithAttributeNameMap(map[string]string{
"api_id": "ApiId",
"caching_config": "CachingConfig",
"caching_keys": "CachingKeys",
"code": "Code",
"code_s3_location": "CodeS3Location",
"conflict_detection": "ConflictDetection",
"conflict_handler": "ConflictHandler",
"data_source_name": "DataSourceName",
"field_name": "FieldName",
"functions": "Functions",
"kind": "Kind",
"lambda_conflict_handler_arn": "LambdaConflictHandlerArn",
"lambda_conflict_handler_config": "LambdaConflictHandlerConfig",
"max_batch_size": "MaxBatchSize",
"metrics_config": "MetricsConfig",
"name": "Name",
"pipeline_config": "PipelineConfig",
"request_mapping_template": "RequestMappingTemplate",
"request_mapping_template_s3_location": "RequestMappingTemplateS3Location",
"resolver_arn": "ResolverArn",
"response_mapping_template": "ResponseMappingTemplate",
"response_mapping_template_s3_location": "ResponseMappingTemplateS3Location",
"runtime": "Runtime",
"runtime_version": "RuntimeVersion",
"sync_config": "SyncConfig",
"ttl": "Ttl",
"type_name": "TypeName",
})
v, err := generic.NewSingularDataSource(ctx, opts...)
if err != nil {
return nil, err
}
return v, nil
}