generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 108
/
scheduling_policy_singular_data_source_gen.go
176 lines (164 loc) · 4.96 KB
/
scheduling_policy_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
// Code generated by generators/singular-data-source/main.go; DO NOT EDIT.
package batch
import (
"context"
"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("awscc_batch_scheduling_policy", schedulingPolicyDataSourceType)
}
// schedulingPolicyDataSourceType returns the Terraform awscc_batch_scheduling_policy data source type.
// This Terraform data source type corresponds to the CloudFormation AWS::Batch::SchedulingPolicy resource type.
func schedulingPolicyDataSourceType(ctx context.Context) (tfsdk.DataSourceType, error) {
attributes := map[string]tfsdk.Attribute{
"arn": {
// Property: Arn
// CloudFormation resource type schema:
// {
// "description": "ARN of the Scheduling Policy.",
// "type": "string"
// }
Description: "ARN of the Scheduling Policy.",
Type: types.StringType,
Computed: true,
},
"fairshare_policy": {
// Property: FairsharePolicy
// CloudFormation resource type schema:
// {
// "additionalProperties": false,
// "description": "Fair Share Policy for the Job Queue.",
// "properties": {
// "ComputeReservation": {
// "maximum": 99,
// "minimum": 0,
// "type": "number"
// },
// "ShareDecaySeconds": {
// "maximum": 604800,
// "minimum": 0,
// "type": "number"
// },
// "ShareDistribution": {
// "description": "List of Share Attributes",
// "insertionOrder": false,
// "items": {
// "additionalProperties": false,
// "properties": {
// "ShareIdentifier": {
// "type": "string"
// },
// "WeightFactor": {
// "maximum": 1000,
// "minimum": 0,
// "type": "number"
// }
// },
// "type": "object"
// },
// "type": "array"
// }
// },
// "type": "object"
// }
Description: "Fair Share Policy for the Job Queue.",
Attributes: tfsdk.SingleNestedAttributes(
map[string]tfsdk.Attribute{
"compute_reservation": {
// Property: ComputeReservation
Type: types.Float64Type,
Computed: true,
},
"share_decay_seconds": {
// Property: ShareDecaySeconds
Type: types.Float64Type,
Computed: true,
},
"share_distribution": {
// Property: ShareDistribution
Description: "List of Share Attributes",
Attributes: tfsdk.ListNestedAttributes(
map[string]tfsdk.Attribute{
"share_identifier": {
// Property: ShareIdentifier
Type: types.StringType,
Computed: true,
},
"weight_factor": {
// Property: WeightFactor
Type: types.Float64Type,
Computed: true,
},
},
tfsdk.ListNestedAttributesOptions{},
),
Computed: true,
},
},
),
Computed: true,
},
"name": {
// Property: Name
// CloudFormation resource type schema:
// {
// "description": "Name of Scheduling Policy.",
// "pattern": "",
// "type": "string"
// }
Description: "Name of Scheduling Policy.",
Type: types.StringType,
Computed: true,
},
"tags": {
// Property: Tags
// CloudFormation resource type schema:
// {
// "additionalProperties": false,
// "description": "A key-value pair to associate with a resource.",
// "patternProperties": {
// "": {
// "type": "string"
// }
// },
// "type": "object"
// }
Description: "A key-value pair to associate with a resource.",
// Pattern: ""
Type: types.MapType{ElemType: types.StringType},
Computed: true,
},
}
attributes["id"] = tfsdk.Attribute{
Description: "Uniquely identifies the resource.",
Type: types.StringType,
Required: true,
}
schema := tfsdk.Schema{
Description: "Data Source schema for AWS::Batch::SchedulingPolicy",
Version: 1,
Attributes: attributes,
}
var opts DataSourceTypeOptions
opts = opts.WithCloudFormationTypeName("AWS::Batch::SchedulingPolicy").WithTerraformTypeName("awscc_batch_scheduling_policy")
opts = opts.WithTerraformSchema(schema)
opts = opts.WithAttributeNameMap(map[string]string{
"arn": "Arn",
"compute_reservation": "ComputeReservation",
"fairshare_policy": "FairsharePolicy",
"name": "Name",
"share_decay_seconds": "ShareDecaySeconds",
"share_distribution": "ShareDistribution",
"share_identifier": "ShareIdentifier",
"tags": "Tags",
"weight_factor": "WeightFactor",
})
singularDataSourceType, err := NewSingularDataSourceType(ctx, opts...)
if err != nil {
return nil, err
}
return singularDataSourceType, nil
}