/
usagePlan.go
337 lines (277 loc) · 10.8 KB
/
usagePlan.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package apigateway
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Provides an API Gateway Usage Plan.
//
// ## Import
//
// AWS API Gateway Usage Plan can be imported using the `id`, e.g.
//
// ```sh
// $ pulumi import aws:apigateway/usagePlan:UsagePlan myusageplan <usage_plan_id>
// ```
type UsagePlan struct {
pulumi.CustomResourceState
// The associated API stages of the usage plan.
ApiStages UsagePlanApiStageArrayOutput `pulumi:"apiStages"`
// Amazon Resource Name (ARN)
Arn pulumi.StringOutput `pulumi:"arn"`
// The description of a usage plan.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The name of the usage plan.
Name pulumi.StringOutput `pulumi:"name"`
// The AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
ProductCode pulumi.StringPtrOutput `pulumi:"productCode"`
// The quota settings of the usage plan.
QuotaSettings UsagePlanQuotaSettingsPtrOutput `pulumi:"quotaSettings"`
// Key-value map of resource tags
Tags pulumi.StringMapOutput `pulumi:"tags"`
// The throttling limits of the usage plan.
ThrottleSettings UsagePlanThrottleSettingsPtrOutput `pulumi:"throttleSettings"`
}
// NewUsagePlan registers a new resource with the given unique name, arguments, and options.
func NewUsagePlan(ctx *pulumi.Context,
name string, args *UsagePlanArgs, opts ...pulumi.ResourceOption) (*UsagePlan, error) {
if args == nil {
args = &UsagePlanArgs{}
}
var resource UsagePlan
err := ctx.RegisterResource("aws:apigateway/usagePlan:UsagePlan", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetUsagePlan gets an existing UsagePlan resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetUsagePlan(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *UsagePlanState, opts ...pulumi.ResourceOption) (*UsagePlan, error) {
var resource UsagePlan
err := ctx.ReadResource("aws:apigateway/usagePlan:UsagePlan", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering UsagePlan resources.
type usagePlanState struct {
// The associated API stages of the usage plan.
ApiStages []UsagePlanApiStage `pulumi:"apiStages"`
// Amazon Resource Name (ARN)
Arn *string `pulumi:"arn"`
// The description of a usage plan.
Description *string `pulumi:"description"`
// The name of the usage plan.
Name *string `pulumi:"name"`
// The AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
ProductCode *string `pulumi:"productCode"`
// The quota settings of the usage plan.
QuotaSettings *UsagePlanQuotaSettings `pulumi:"quotaSettings"`
// Key-value map of resource tags
Tags map[string]string `pulumi:"tags"`
// The throttling limits of the usage plan.
ThrottleSettings *UsagePlanThrottleSettings `pulumi:"throttleSettings"`
}
type UsagePlanState struct {
// The associated API stages of the usage plan.
ApiStages UsagePlanApiStageArrayInput
// Amazon Resource Name (ARN)
Arn pulumi.StringPtrInput
// The description of a usage plan.
Description pulumi.StringPtrInput
// The name of the usage plan.
Name pulumi.StringPtrInput
// The AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
ProductCode pulumi.StringPtrInput
// The quota settings of the usage plan.
QuotaSettings UsagePlanQuotaSettingsPtrInput
// Key-value map of resource tags
Tags pulumi.StringMapInput
// The throttling limits of the usage plan.
ThrottleSettings UsagePlanThrottleSettingsPtrInput
}
func (UsagePlanState) ElementType() reflect.Type {
return reflect.TypeOf((*usagePlanState)(nil)).Elem()
}
type usagePlanArgs struct {
// The associated API stages of the usage plan.
ApiStages []UsagePlanApiStage `pulumi:"apiStages"`
// The description of a usage plan.
Description *string `pulumi:"description"`
// The name of the usage plan.
Name *string `pulumi:"name"`
// The AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
ProductCode *string `pulumi:"productCode"`
// The quota settings of the usage plan.
QuotaSettings *UsagePlanQuotaSettings `pulumi:"quotaSettings"`
// Key-value map of resource tags
Tags map[string]string `pulumi:"tags"`
// The throttling limits of the usage plan.
ThrottleSettings *UsagePlanThrottleSettings `pulumi:"throttleSettings"`
}
// The set of arguments for constructing a UsagePlan resource.
type UsagePlanArgs struct {
// The associated API stages of the usage plan.
ApiStages UsagePlanApiStageArrayInput
// The description of a usage plan.
Description pulumi.StringPtrInput
// The name of the usage plan.
Name pulumi.StringPtrInput
// The AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
ProductCode pulumi.StringPtrInput
// The quota settings of the usage plan.
QuotaSettings UsagePlanQuotaSettingsPtrInput
// Key-value map of resource tags
Tags pulumi.StringMapInput
// The throttling limits of the usage plan.
ThrottleSettings UsagePlanThrottleSettingsPtrInput
}
func (UsagePlanArgs) ElementType() reflect.Type {
return reflect.TypeOf((*usagePlanArgs)(nil)).Elem()
}
type UsagePlanInput interface {
pulumi.Input
ToUsagePlanOutput() UsagePlanOutput
ToUsagePlanOutputWithContext(ctx context.Context) UsagePlanOutput
}
func (*UsagePlan) ElementType() reflect.Type {
return reflect.TypeOf((*UsagePlan)(nil))
}
func (i *UsagePlan) ToUsagePlanOutput() UsagePlanOutput {
return i.ToUsagePlanOutputWithContext(context.Background())
}
func (i *UsagePlan) ToUsagePlanOutputWithContext(ctx context.Context) UsagePlanOutput {
return pulumi.ToOutputWithContext(ctx, i).(UsagePlanOutput)
}
func (i *UsagePlan) ToUsagePlanPtrOutput() UsagePlanPtrOutput {
return i.ToUsagePlanPtrOutputWithContext(context.Background())
}
func (i *UsagePlan) ToUsagePlanPtrOutputWithContext(ctx context.Context) UsagePlanPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(UsagePlanPtrOutput)
}
type UsagePlanPtrInput interface {
pulumi.Input
ToUsagePlanPtrOutput() UsagePlanPtrOutput
ToUsagePlanPtrOutputWithContext(ctx context.Context) UsagePlanPtrOutput
}
type usagePlanPtrType UsagePlanArgs
func (*usagePlanPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**UsagePlan)(nil))
}
func (i *usagePlanPtrType) ToUsagePlanPtrOutput() UsagePlanPtrOutput {
return i.ToUsagePlanPtrOutputWithContext(context.Background())
}
func (i *usagePlanPtrType) ToUsagePlanPtrOutputWithContext(ctx context.Context) UsagePlanPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(UsagePlanPtrOutput)
}
// UsagePlanArrayInput is an input type that accepts UsagePlanArray and UsagePlanArrayOutput values.
// You can construct a concrete instance of `UsagePlanArrayInput` via:
//
// UsagePlanArray{ UsagePlanArgs{...} }
type UsagePlanArrayInput interface {
pulumi.Input
ToUsagePlanArrayOutput() UsagePlanArrayOutput
ToUsagePlanArrayOutputWithContext(context.Context) UsagePlanArrayOutput
}
type UsagePlanArray []UsagePlanInput
func (UsagePlanArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*UsagePlan)(nil))
}
func (i UsagePlanArray) ToUsagePlanArrayOutput() UsagePlanArrayOutput {
return i.ToUsagePlanArrayOutputWithContext(context.Background())
}
func (i UsagePlanArray) ToUsagePlanArrayOutputWithContext(ctx context.Context) UsagePlanArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(UsagePlanArrayOutput)
}
// UsagePlanMapInput is an input type that accepts UsagePlanMap and UsagePlanMapOutput values.
// You can construct a concrete instance of `UsagePlanMapInput` via:
//
// UsagePlanMap{ "key": UsagePlanArgs{...} }
type UsagePlanMapInput interface {
pulumi.Input
ToUsagePlanMapOutput() UsagePlanMapOutput
ToUsagePlanMapOutputWithContext(context.Context) UsagePlanMapOutput
}
type UsagePlanMap map[string]UsagePlanInput
func (UsagePlanMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*UsagePlan)(nil))
}
func (i UsagePlanMap) ToUsagePlanMapOutput() UsagePlanMapOutput {
return i.ToUsagePlanMapOutputWithContext(context.Background())
}
func (i UsagePlanMap) ToUsagePlanMapOutputWithContext(ctx context.Context) UsagePlanMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(UsagePlanMapOutput)
}
type UsagePlanOutput struct {
*pulumi.OutputState
}
func (UsagePlanOutput) ElementType() reflect.Type {
return reflect.TypeOf((*UsagePlan)(nil))
}
func (o UsagePlanOutput) ToUsagePlanOutput() UsagePlanOutput {
return o
}
func (o UsagePlanOutput) ToUsagePlanOutputWithContext(ctx context.Context) UsagePlanOutput {
return o
}
func (o UsagePlanOutput) ToUsagePlanPtrOutput() UsagePlanPtrOutput {
return o.ToUsagePlanPtrOutputWithContext(context.Background())
}
func (o UsagePlanOutput) ToUsagePlanPtrOutputWithContext(ctx context.Context) UsagePlanPtrOutput {
return o.ApplyT(func(v UsagePlan) *UsagePlan {
return &v
}).(UsagePlanPtrOutput)
}
type UsagePlanPtrOutput struct {
*pulumi.OutputState
}
func (UsagePlanPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**UsagePlan)(nil))
}
func (o UsagePlanPtrOutput) ToUsagePlanPtrOutput() UsagePlanPtrOutput {
return o
}
func (o UsagePlanPtrOutput) ToUsagePlanPtrOutputWithContext(ctx context.Context) UsagePlanPtrOutput {
return o
}
type UsagePlanArrayOutput struct{ *pulumi.OutputState }
func (UsagePlanArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]UsagePlan)(nil))
}
func (o UsagePlanArrayOutput) ToUsagePlanArrayOutput() UsagePlanArrayOutput {
return o
}
func (o UsagePlanArrayOutput) ToUsagePlanArrayOutputWithContext(ctx context.Context) UsagePlanArrayOutput {
return o
}
func (o UsagePlanArrayOutput) Index(i pulumi.IntInput) UsagePlanOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) UsagePlan {
return vs[0].([]UsagePlan)[vs[1].(int)]
}).(UsagePlanOutput)
}
type UsagePlanMapOutput struct{ *pulumi.OutputState }
func (UsagePlanMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]UsagePlan)(nil))
}
func (o UsagePlanMapOutput) ToUsagePlanMapOutput() UsagePlanMapOutput {
return o
}
func (o UsagePlanMapOutput) ToUsagePlanMapOutputWithContext(ctx context.Context) UsagePlanMapOutput {
return o
}
func (o UsagePlanMapOutput) MapIndex(k pulumi.StringInput) UsagePlanOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) UsagePlan {
return vs[0].(map[string]UsagePlan)[vs[1].(string)]
}).(UsagePlanOutput)
}
func init() {
pulumi.RegisterOutputType(UsagePlanOutput{})
pulumi.RegisterOutputType(UsagePlanPtrOutput{})
pulumi.RegisterOutputType(UsagePlanArrayOutput{})
pulumi.RegisterOutputType(UsagePlanMapOutput{})
}