generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 104
/
schema.tmpl
53 lines (42 loc) · 1.61 KB
/
schema.tmpl
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
// Code generated by generators/plural-data-source/main.go; DO NOT EDIT.
package {{ .PackageName }}
import (
"context"
"github.com/hashicorp/terraform-plugin-framework/provider"
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
"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.AddDataSourceTypeFactory("{{ .TerraformTypeName }}", {{ .FactoryFunctionName }})
}
// {{ .FactoryFunctionName }} returns the Terraform {{ .TerraformTypeName }} data source type.
// This Terraform data source type corresponds to the CloudFormation {{ .CloudFormationTypeName }} resource type.
func {{ .FactoryFunctionName }}(ctx context.Context) (provider.DataSourceType, error) {
attributes := map[string]tfsdk.Attribute {
"id": {
Description: "Uniquely identifies the data source.",
Type: types.StringType,
Computed: true,
},
"ids": {
Description: "Set of Resource Identifiers.",
Type: types.SetType{ElemType:types.StringType},
Computed: true,
},
}
schema := tfsdk.Schema{
Description: "{{ .SchemaDescription }}",
Version: {{ .SchemaVersion }},
Attributes: attributes,
}
var opts DataSourceTypeOptions
opts = opts.WithCloudFormationTypeName("{{ .CloudFormationTypeName }}").WithTerraformTypeName("{{ .TerraformTypeName }}")
opts = opts.WithTerraformSchema(schema)
pluralDataSourceType, err := NewPluralDataSourceType(ctx, opts...)
if err != nil {
return nil, err
}
return pluralDataSourceType, nil
}