/
autoScalingConfigurationVersion.go
319 lines (273 loc) · 16.3 KB
/
autoScalingConfigurationVersion.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
// *** 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 apprunner
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an App Runner AutoScaling Configuration Version.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/apprunner"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := apprunner.NewAutoScalingConfigurationVersion(ctx, "example", &apprunner.AutoScalingConfigurationVersionArgs{
// AutoScalingConfigurationName: pulumi.String("example"),
// MaxConcurrency: pulumi.Int(50),
// MaxSize: pulumi.Int(10),
// MinSize: pulumi.Int(2),
// Tags: pulumi.StringMap{
// "Name": pulumi.String("example-apprunner-autoscaling"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// App Runner AutoScaling Configuration Versions can be imported by using the `arn`, e.g.,
//
// ```sh
// $ pulumi import aws:apprunner/autoScalingConfigurationVersion:AutoScalingConfigurationVersion example "arn:aws:apprunner:us-east-1:1234567890:autoscalingconfiguration/example/1/69bdfe0115224b0db49398b7beb68e0f
// ```
type AutoScalingConfigurationVersion struct {
pulumi.CustomResourceState
// ARN of this auto scaling configuration version.
Arn pulumi.StringOutput `pulumi:"arn"`
// Name of the auto scaling configuration.
AutoScalingConfigurationName pulumi.StringOutput `pulumi:"autoScalingConfigurationName"`
// The revision of this auto scaling configuration.
AutoScalingConfigurationRevision pulumi.IntOutput `pulumi:"autoScalingConfigurationRevision"`
// Whether the auto scaling configuration has the highest `autoScalingConfigurationRevision` among all configurations that share the same `autoScalingConfigurationName`.
Latest pulumi.BoolOutput `pulumi:"latest"`
// The maximal number of concurrent requests that you want an instance to process. When the number of concurrent requests goes over this limit, App Runner scales up your service.
MaxConcurrency pulumi.IntPtrOutput `pulumi:"maxConcurrency"`
// The maximal number of instances that App Runner provisions for your service.
MaxSize pulumi.IntPtrOutput `pulumi:"maxSize"`
// The minimal number of instances that App Runner provisions for your service.
MinSize pulumi.IntPtrOutput `pulumi:"minSize"`
// The current state of the auto scaling configuration. An INACTIVE configuration revision has been deleted and can't be used. It is permanently removed some time after deletion.
Status pulumi.StringOutput `pulumi:"status"`
// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
}
// NewAutoScalingConfigurationVersion registers a new resource with the given unique name, arguments, and options.
func NewAutoScalingConfigurationVersion(ctx *pulumi.Context,
name string, args *AutoScalingConfigurationVersionArgs, opts ...pulumi.ResourceOption) (*AutoScalingConfigurationVersion, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AutoScalingConfigurationName == nil {
return nil, errors.New("invalid value for required argument 'AutoScalingConfigurationName'")
}
var resource AutoScalingConfigurationVersion
err := ctx.RegisterResource("aws:apprunner/autoScalingConfigurationVersion:AutoScalingConfigurationVersion", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAutoScalingConfigurationVersion gets an existing AutoScalingConfigurationVersion 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 GetAutoScalingConfigurationVersion(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AutoScalingConfigurationVersionState, opts ...pulumi.ResourceOption) (*AutoScalingConfigurationVersion, error) {
var resource AutoScalingConfigurationVersion
err := ctx.ReadResource("aws:apprunner/autoScalingConfigurationVersion:AutoScalingConfigurationVersion", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AutoScalingConfigurationVersion resources.
type autoScalingConfigurationVersionState struct {
// ARN of this auto scaling configuration version.
Arn *string `pulumi:"arn"`
// Name of the auto scaling configuration.
AutoScalingConfigurationName *string `pulumi:"autoScalingConfigurationName"`
// The revision of this auto scaling configuration.
AutoScalingConfigurationRevision *int `pulumi:"autoScalingConfigurationRevision"`
// Whether the auto scaling configuration has the highest `autoScalingConfigurationRevision` among all configurations that share the same `autoScalingConfigurationName`.
Latest *bool `pulumi:"latest"`
// The maximal number of concurrent requests that you want an instance to process. When the number of concurrent requests goes over this limit, App Runner scales up your service.
MaxConcurrency *int `pulumi:"maxConcurrency"`
// The maximal number of instances that App Runner provisions for your service.
MaxSize *int `pulumi:"maxSize"`
// The minimal number of instances that App Runner provisions for your service.
MinSize *int `pulumi:"minSize"`
// The current state of the auto scaling configuration. An INACTIVE configuration revision has been deleted and can't be used. It is permanently removed some time after deletion.
Status *string `pulumi:"status"`
// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll map[string]string `pulumi:"tagsAll"`
}
type AutoScalingConfigurationVersionState struct {
// ARN of this auto scaling configuration version.
Arn pulumi.StringPtrInput
// Name of the auto scaling configuration.
AutoScalingConfigurationName pulumi.StringPtrInput
// The revision of this auto scaling configuration.
AutoScalingConfigurationRevision pulumi.IntPtrInput
// Whether the auto scaling configuration has the highest `autoScalingConfigurationRevision` among all configurations that share the same `autoScalingConfigurationName`.
Latest pulumi.BoolPtrInput
// The maximal number of concurrent requests that you want an instance to process. When the number of concurrent requests goes over this limit, App Runner scales up your service.
MaxConcurrency pulumi.IntPtrInput
// The maximal number of instances that App Runner provisions for your service.
MaxSize pulumi.IntPtrInput
// The minimal number of instances that App Runner provisions for your service.
MinSize pulumi.IntPtrInput
// The current state of the auto scaling configuration. An INACTIVE configuration revision has been deleted and can't be used. It is permanently removed some time after deletion.
Status pulumi.StringPtrInput
// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll pulumi.StringMapInput
}
func (AutoScalingConfigurationVersionState) ElementType() reflect.Type {
return reflect.TypeOf((*autoScalingConfigurationVersionState)(nil)).Elem()
}
type autoScalingConfigurationVersionArgs struct {
// Name of the auto scaling configuration.
AutoScalingConfigurationName string `pulumi:"autoScalingConfigurationName"`
// The maximal number of concurrent requests that you want an instance to process. When the number of concurrent requests goes over this limit, App Runner scales up your service.
MaxConcurrency *int `pulumi:"maxConcurrency"`
// The maximal number of instances that App Runner provisions for your service.
MaxSize *int `pulumi:"maxSize"`
// The minimal number of instances that App Runner provisions for your service.
MinSize *int `pulumi:"minSize"`
// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a AutoScalingConfigurationVersion resource.
type AutoScalingConfigurationVersionArgs struct {
// Name of the auto scaling configuration.
AutoScalingConfigurationName pulumi.StringInput
// The maximal number of concurrent requests that you want an instance to process. When the number of concurrent requests goes over this limit, App Runner scales up your service.
MaxConcurrency pulumi.IntPtrInput
// The maximal number of instances that App Runner provisions for your service.
MaxSize pulumi.IntPtrInput
// The minimal number of instances that App Runner provisions for your service.
MinSize pulumi.IntPtrInput
// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
}
func (AutoScalingConfigurationVersionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*autoScalingConfigurationVersionArgs)(nil)).Elem()
}
type AutoScalingConfigurationVersionInput interface {
pulumi.Input
ToAutoScalingConfigurationVersionOutput() AutoScalingConfigurationVersionOutput
ToAutoScalingConfigurationVersionOutputWithContext(ctx context.Context) AutoScalingConfigurationVersionOutput
}
func (*AutoScalingConfigurationVersion) ElementType() reflect.Type {
return reflect.TypeOf((**AutoScalingConfigurationVersion)(nil)).Elem()
}
func (i *AutoScalingConfigurationVersion) ToAutoScalingConfigurationVersionOutput() AutoScalingConfigurationVersionOutput {
return i.ToAutoScalingConfigurationVersionOutputWithContext(context.Background())
}
func (i *AutoScalingConfigurationVersion) ToAutoScalingConfigurationVersionOutputWithContext(ctx context.Context) AutoScalingConfigurationVersionOutput {
return pulumi.ToOutputWithContext(ctx, i).(AutoScalingConfigurationVersionOutput)
}
// AutoScalingConfigurationVersionArrayInput is an input type that accepts AutoScalingConfigurationVersionArray and AutoScalingConfigurationVersionArrayOutput values.
// You can construct a concrete instance of `AutoScalingConfigurationVersionArrayInput` via:
//
// AutoScalingConfigurationVersionArray{ AutoScalingConfigurationVersionArgs{...} }
type AutoScalingConfigurationVersionArrayInput interface {
pulumi.Input
ToAutoScalingConfigurationVersionArrayOutput() AutoScalingConfigurationVersionArrayOutput
ToAutoScalingConfigurationVersionArrayOutputWithContext(context.Context) AutoScalingConfigurationVersionArrayOutput
}
type AutoScalingConfigurationVersionArray []AutoScalingConfigurationVersionInput
func (AutoScalingConfigurationVersionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AutoScalingConfigurationVersion)(nil)).Elem()
}
func (i AutoScalingConfigurationVersionArray) ToAutoScalingConfigurationVersionArrayOutput() AutoScalingConfigurationVersionArrayOutput {
return i.ToAutoScalingConfigurationVersionArrayOutputWithContext(context.Background())
}
func (i AutoScalingConfigurationVersionArray) ToAutoScalingConfigurationVersionArrayOutputWithContext(ctx context.Context) AutoScalingConfigurationVersionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AutoScalingConfigurationVersionArrayOutput)
}
// AutoScalingConfigurationVersionMapInput is an input type that accepts AutoScalingConfigurationVersionMap and AutoScalingConfigurationVersionMapOutput values.
// You can construct a concrete instance of `AutoScalingConfigurationVersionMapInput` via:
//
// AutoScalingConfigurationVersionMap{ "key": AutoScalingConfigurationVersionArgs{...} }
type AutoScalingConfigurationVersionMapInput interface {
pulumi.Input
ToAutoScalingConfigurationVersionMapOutput() AutoScalingConfigurationVersionMapOutput
ToAutoScalingConfigurationVersionMapOutputWithContext(context.Context) AutoScalingConfigurationVersionMapOutput
}
type AutoScalingConfigurationVersionMap map[string]AutoScalingConfigurationVersionInput
func (AutoScalingConfigurationVersionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AutoScalingConfigurationVersion)(nil)).Elem()
}
func (i AutoScalingConfigurationVersionMap) ToAutoScalingConfigurationVersionMapOutput() AutoScalingConfigurationVersionMapOutput {
return i.ToAutoScalingConfigurationVersionMapOutputWithContext(context.Background())
}
func (i AutoScalingConfigurationVersionMap) ToAutoScalingConfigurationVersionMapOutputWithContext(ctx context.Context) AutoScalingConfigurationVersionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AutoScalingConfigurationVersionMapOutput)
}
type AutoScalingConfigurationVersionOutput struct{ *pulumi.OutputState }
func (AutoScalingConfigurationVersionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AutoScalingConfigurationVersion)(nil)).Elem()
}
func (o AutoScalingConfigurationVersionOutput) ToAutoScalingConfigurationVersionOutput() AutoScalingConfigurationVersionOutput {
return o
}
func (o AutoScalingConfigurationVersionOutput) ToAutoScalingConfigurationVersionOutputWithContext(ctx context.Context) AutoScalingConfigurationVersionOutput {
return o
}
type AutoScalingConfigurationVersionArrayOutput struct{ *pulumi.OutputState }
func (AutoScalingConfigurationVersionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AutoScalingConfigurationVersion)(nil)).Elem()
}
func (o AutoScalingConfigurationVersionArrayOutput) ToAutoScalingConfigurationVersionArrayOutput() AutoScalingConfigurationVersionArrayOutput {
return o
}
func (o AutoScalingConfigurationVersionArrayOutput) ToAutoScalingConfigurationVersionArrayOutputWithContext(ctx context.Context) AutoScalingConfigurationVersionArrayOutput {
return o
}
func (o AutoScalingConfigurationVersionArrayOutput) Index(i pulumi.IntInput) AutoScalingConfigurationVersionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AutoScalingConfigurationVersion {
return vs[0].([]*AutoScalingConfigurationVersion)[vs[1].(int)]
}).(AutoScalingConfigurationVersionOutput)
}
type AutoScalingConfigurationVersionMapOutput struct{ *pulumi.OutputState }
func (AutoScalingConfigurationVersionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AutoScalingConfigurationVersion)(nil)).Elem()
}
func (o AutoScalingConfigurationVersionMapOutput) ToAutoScalingConfigurationVersionMapOutput() AutoScalingConfigurationVersionMapOutput {
return o
}
func (o AutoScalingConfigurationVersionMapOutput) ToAutoScalingConfigurationVersionMapOutputWithContext(ctx context.Context) AutoScalingConfigurationVersionMapOutput {
return o
}
func (o AutoScalingConfigurationVersionMapOutput) MapIndex(k pulumi.StringInput) AutoScalingConfigurationVersionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AutoScalingConfigurationVersion {
return vs[0].(map[string]*AutoScalingConfigurationVersion)[vs[1].(string)]
}).(AutoScalingConfigurationVersionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AutoScalingConfigurationVersionInput)(nil)).Elem(), &AutoScalingConfigurationVersion{})
pulumi.RegisterInputType(reflect.TypeOf((*AutoScalingConfigurationVersionArrayInput)(nil)).Elem(), AutoScalingConfigurationVersionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AutoScalingConfigurationVersionMapInput)(nil)).Elem(), AutoScalingConfigurationVersionMap{})
pulumi.RegisterOutputType(AutoScalingConfigurationVersionOutput{})
pulumi.RegisterOutputType(AutoScalingConfigurationVersionArrayOutput{})
pulumi.RegisterOutputType(AutoScalingConfigurationVersionMapOutput{})
}