github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/apprunner/defaultAutoScalingConfigurationVersion.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package apprunner 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Manages the default App Runner auto scaling configuration. 16 // When creating or updating this resource the existing default auto scaling configuration will be set to non-default automatically. 17 // When creating or updating this resource the configuration is automatically assigned as the default to the new services you create in the future. The new default designation doesn't affect the associations that were previously set for existing services. 18 // Each account can have only one default auto scaling configuration per Region. 19 // 20 // ## Example Usage 21 // 22 // <!--Start PulumiCodeChooser --> 23 // ```go 24 // package main 25 // 26 // import ( 27 // 28 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apprunner" 29 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 30 // 31 // ) 32 // 33 // func main() { 34 // pulumi.Run(func(ctx *pulumi.Context) error { 35 // example, err := apprunner.NewAutoScalingConfigurationVersion(ctx, "example", &apprunner.AutoScalingConfigurationVersionArgs{ 36 // AutoScalingConfigurationName: pulumi.String("example"), 37 // MaxConcurrency: pulumi.Int(50), 38 // MaxSize: pulumi.Int(10), 39 // MinSize: pulumi.Int(2), 40 // }) 41 // if err != nil { 42 // return err 43 // } 44 // _, err = apprunner.NewDefaultAutoScalingConfigurationVersion(ctx, "example", &apprunner.DefaultAutoScalingConfigurationVersionArgs{ 45 // AutoScalingConfigurationArn: example.Arn, 46 // }) 47 // if err != nil { 48 // return err 49 // } 50 // return nil 51 // }) 52 // } 53 // 54 // ``` 55 // <!--End PulumiCodeChooser --> 56 // 57 // ## Import 58 // 59 // Using `pulumi import`, import App Runner default auto scaling configurations using the current Region. For example: 60 // 61 // ```sh 62 // $ pulumi import aws:apprunner/defaultAutoScalingConfigurationVersion:DefaultAutoScalingConfigurationVersion example us-west-2 63 // ``` 64 type DefaultAutoScalingConfigurationVersion struct { 65 pulumi.CustomResourceState 66 67 // The ARN of the App Runner auto scaling configuration that you want to set as the default. 68 AutoScalingConfigurationArn pulumi.StringOutput `pulumi:"autoScalingConfigurationArn"` 69 } 70 71 // NewDefaultAutoScalingConfigurationVersion registers a new resource with the given unique name, arguments, and options. 72 func NewDefaultAutoScalingConfigurationVersion(ctx *pulumi.Context, 73 name string, args *DefaultAutoScalingConfigurationVersionArgs, opts ...pulumi.ResourceOption) (*DefaultAutoScalingConfigurationVersion, error) { 74 if args == nil { 75 return nil, errors.New("missing one or more required arguments") 76 } 77 78 if args.AutoScalingConfigurationArn == nil { 79 return nil, errors.New("invalid value for required argument 'AutoScalingConfigurationArn'") 80 } 81 opts = internal.PkgResourceDefaultOpts(opts) 82 var resource DefaultAutoScalingConfigurationVersion 83 err := ctx.RegisterResource("aws:apprunner/defaultAutoScalingConfigurationVersion:DefaultAutoScalingConfigurationVersion", name, args, &resource, opts...) 84 if err != nil { 85 return nil, err 86 } 87 return &resource, nil 88 } 89 90 // GetDefaultAutoScalingConfigurationVersion gets an existing DefaultAutoScalingConfigurationVersion resource's state with the given name, ID, and optional 91 // state properties that are used to uniquely qualify the lookup (nil if not required). 92 func GetDefaultAutoScalingConfigurationVersion(ctx *pulumi.Context, 93 name string, id pulumi.IDInput, state *DefaultAutoScalingConfigurationVersionState, opts ...pulumi.ResourceOption) (*DefaultAutoScalingConfigurationVersion, error) { 94 var resource DefaultAutoScalingConfigurationVersion 95 err := ctx.ReadResource("aws:apprunner/defaultAutoScalingConfigurationVersion:DefaultAutoScalingConfigurationVersion", name, id, state, &resource, opts...) 96 if err != nil { 97 return nil, err 98 } 99 return &resource, nil 100 } 101 102 // Input properties used for looking up and filtering DefaultAutoScalingConfigurationVersion resources. 103 type defaultAutoScalingConfigurationVersionState struct { 104 // The ARN of the App Runner auto scaling configuration that you want to set as the default. 105 AutoScalingConfigurationArn *string `pulumi:"autoScalingConfigurationArn"` 106 } 107 108 type DefaultAutoScalingConfigurationVersionState struct { 109 // The ARN of the App Runner auto scaling configuration that you want to set as the default. 110 AutoScalingConfigurationArn pulumi.StringPtrInput 111 } 112 113 func (DefaultAutoScalingConfigurationVersionState) ElementType() reflect.Type { 114 return reflect.TypeOf((*defaultAutoScalingConfigurationVersionState)(nil)).Elem() 115 } 116 117 type defaultAutoScalingConfigurationVersionArgs struct { 118 // The ARN of the App Runner auto scaling configuration that you want to set as the default. 119 AutoScalingConfigurationArn string `pulumi:"autoScalingConfigurationArn"` 120 } 121 122 // The set of arguments for constructing a DefaultAutoScalingConfigurationVersion resource. 123 type DefaultAutoScalingConfigurationVersionArgs struct { 124 // The ARN of the App Runner auto scaling configuration that you want to set as the default. 125 AutoScalingConfigurationArn pulumi.StringInput 126 } 127 128 func (DefaultAutoScalingConfigurationVersionArgs) ElementType() reflect.Type { 129 return reflect.TypeOf((*defaultAutoScalingConfigurationVersionArgs)(nil)).Elem() 130 } 131 132 type DefaultAutoScalingConfigurationVersionInput interface { 133 pulumi.Input 134 135 ToDefaultAutoScalingConfigurationVersionOutput() DefaultAutoScalingConfigurationVersionOutput 136 ToDefaultAutoScalingConfigurationVersionOutputWithContext(ctx context.Context) DefaultAutoScalingConfigurationVersionOutput 137 } 138 139 func (*DefaultAutoScalingConfigurationVersion) ElementType() reflect.Type { 140 return reflect.TypeOf((**DefaultAutoScalingConfigurationVersion)(nil)).Elem() 141 } 142 143 func (i *DefaultAutoScalingConfigurationVersion) ToDefaultAutoScalingConfigurationVersionOutput() DefaultAutoScalingConfigurationVersionOutput { 144 return i.ToDefaultAutoScalingConfigurationVersionOutputWithContext(context.Background()) 145 } 146 147 func (i *DefaultAutoScalingConfigurationVersion) ToDefaultAutoScalingConfigurationVersionOutputWithContext(ctx context.Context) DefaultAutoScalingConfigurationVersionOutput { 148 return pulumi.ToOutputWithContext(ctx, i).(DefaultAutoScalingConfigurationVersionOutput) 149 } 150 151 // DefaultAutoScalingConfigurationVersionArrayInput is an input type that accepts DefaultAutoScalingConfigurationVersionArray and DefaultAutoScalingConfigurationVersionArrayOutput values. 152 // You can construct a concrete instance of `DefaultAutoScalingConfigurationVersionArrayInput` via: 153 // 154 // DefaultAutoScalingConfigurationVersionArray{ DefaultAutoScalingConfigurationVersionArgs{...} } 155 type DefaultAutoScalingConfigurationVersionArrayInput interface { 156 pulumi.Input 157 158 ToDefaultAutoScalingConfigurationVersionArrayOutput() DefaultAutoScalingConfigurationVersionArrayOutput 159 ToDefaultAutoScalingConfigurationVersionArrayOutputWithContext(context.Context) DefaultAutoScalingConfigurationVersionArrayOutput 160 } 161 162 type DefaultAutoScalingConfigurationVersionArray []DefaultAutoScalingConfigurationVersionInput 163 164 func (DefaultAutoScalingConfigurationVersionArray) ElementType() reflect.Type { 165 return reflect.TypeOf((*[]*DefaultAutoScalingConfigurationVersion)(nil)).Elem() 166 } 167 168 func (i DefaultAutoScalingConfigurationVersionArray) ToDefaultAutoScalingConfigurationVersionArrayOutput() DefaultAutoScalingConfigurationVersionArrayOutput { 169 return i.ToDefaultAutoScalingConfigurationVersionArrayOutputWithContext(context.Background()) 170 } 171 172 func (i DefaultAutoScalingConfigurationVersionArray) ToDefaultAutoScalingConfigurationVersionArrayOutputWithContext(ctx context.Context) DefaultAutoScalingConfigurationVersionArrayOutput { 173 return pulumi.ToOutputWithContext(ctx, i).(DefaultAutoScalingConfigurationVersionArrayOutput) 174 } 175 176 // DefaultAutoScalingConfigurationVersionMapInput is an input type that accepts DefaultAutoScalingConfigurationVersionMap and DefaultAutoScalingConfigurationVersionMapOutput values. 177 // You can construct a concrete instance of `DefaultAutoScalingConfigurationVersionMapInput` via: 178 // 179 // DefaultAutoScalingConfigurationVersionMap{ "key": DefaultAutoScalingConfigurationVersionArgs{...} } 180 type DefaultAutoScalingConfigurationVersionMapInput interface { 181 pulumi.Input 182 183 ToDefaultAutoScalingConfigurationVersionMapOutput() DefaultAutoScalingConfigurationVersionMapOutput 184 ToDefaultAutoScalingConfigurationVersionMapOutputWithContext(context.Context) DefaultAutoScalingConfigurationVersionMapOutput 185 } 186 187 type DefaultAutoScalingConfigurationVersionMap map[string]DefaultAutoScalingConfigurationVersionInput 188 189 func (DefaultAutoScalingConfigurationVersionMap) ElementType() reflect.Type { 190 return reflect.TypeOf((*map[string]*DefaultAutoScalingConfigurationVersion)(nil)).Elem() 191 } 192 193 func (i DefaultAutoScalingConfigurationVersionMap) ToDefaultAutoScalingConfigurationVersionMapOutput() DefaultAutoScalingConfigurationVersionMapOutput { 194 return i.ToDefaultAutoScalingConfigurationVersionMapOutputWithContext(context.Background()) 195 } 196 197 func (i DefaultAutoScalingConfigurationVersionMap) ToDefaultAutoScalingConfigurationVersionMapOutputWithContext(ctx context.Context) DefaultAutoScalingConfigurationVersionMapOutput { 198 return pulumi.ToOutputWithContext(ctx, i).(DefaultAutoScalingConfigurationVersionMapOutput) 199 } 200 201 type DefaultAutoScalingConfigurationVersionOutput struct{ *pulumi.OutputState } 202 203 func (DefaultAutoScalingConfigurationVersionOutput) ElementType() reflect.Type { 204 return reflect.TypeOf((**DefaultAutoScalingConfigurationVersion)(nil)).Elem() 205 } 206 207 func (o DefaultAutoScalingConfigurationVersionOutput) ToDefaultAutoScalingConfigurationVersionOutput() DefaultAutoScalingConfigurationVersionOutput { 208 return o 209 } 210 211 func (o DefaultAutoScalingConfigurationVersionOutput) ToDefaultAutoScalingConfigurationVersionOutputWithContext(ctx context.Context) DefaultAutoScalingConfigurationVersionOutput { 212 return o 213 } 214 215 // The ARN of the App Runner auto scaling configuration that you want to set as the default. 216 func (o DefaultAutoScalingConfigurationVersionOutput) AutoScalingConfigurationArn() pulumi.StringOutput { 217 return o.ApplyT(func(v *DefaultAutoScalingConfigurationVersion) pulumi.StringOutput { 218 return v.AutoScalingConfigurationArn 219 }).(pulumi.StringOutput) 220 } 221 222 type DefaultAutoScalingConfigurationVersionArrayOutput struct{ *pulumi.OutputState } 223 224 func (DefaultAutoScalingConfigurationVersionArrayOutput) ElementType() reflect.Type { 225 return reflect.TypeOf((*[]*DefaultAutoScalingConfigurationVersion)(nil)).Elem() 226 } 227 228 func (o DefaultAutoScalingConfigurationVersionArrayOutput) ToDefaultAutoScalingConfigurationVersionArrayOutput() DefaultAutoScalingConfigurationVersionArrayOutput { 229 return o 230 } 231 232 func (o DefaultAutoScalingConfigurationVersionArrayOutput) ToDefaultAutoScalingConfigurationVersionArrayOutputWithContext(ctx context.Context) DefaultAutoScalingConfigurationVersionArrayOutput { 233 return o 234 } 235 236 func (o DefaultAutoScalingConfigurationVersionArrayOutput) Index(i pulumi.IntInput) DefaultAutoScalingConfigurationVersionOutput { 237 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DefaultAutoScalingConfigurationVersion { 238 return vs[0].([]*DefaultAutoScalingConfigurationVersion)[vs[1].(int)] 239 }).(DefaultAutoScalingConfigurationVersionOutput) 240 } 241 242 type DefaultAutoScalingConfigurationVersionMapOutput struct{ *pulumi.OutputState } 243 244 func (DefaultAutoScalingConfigurationVersionMapOutput) ElementType() reflect.Type { 245 return reflect.TypeOf((*map[string]*DefaultAutoScalingConfigurationVersion)(nil)).Elem() 246 } 247 248 func (o DefaultAutoScalingConfigurationVersionMapOutput) ToDefaultAutoScalingConfigurationVersionMapOutput() DefaultAutoScalingConfigurationVersionMapOutput { 249 return o 250 } 251 252 func (o DefaultAutoScalingConfigurationVersionMapOutput) ToDefaultAutoScalingConfigurationVersionMapOutputWithContext(ctx context.Context) DefaultAutoScalingConfigurationVersionMapOutput { 253 return o 254 } 255 256 func (o DefaultAutoScalingConfigurationVersionMapOutput) MapIndex(k pulumi.StringInput) DefaultAutoScalingConfigurationVersionOutput { 257 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DefaultAutoScalingConfigurationVersion { 258 return vs[0].(map[string]*DefaultAutoScalingConfigurationVersion)[vs[1].(string)] 259 }).(DefaultAutoScalingConfigurationVersionOutput) 260 } 261 262 func init() { 263 pulumi.RegisterInputType(reflect.TypeOf((*DefaultAutoScalingConfigurationVersionInput)(nil)).Elem(), &DefaultAutoScalingConfigurationVersion{}) 264 pulumi.RegisterInputType(reflect.TypeOf((*DefaultAutoScalingConfigurationVersionArrayInput)(nil)).Elem(), DefaultAutoScalingConfigurationVersionArray{}) 265 pulumi.RegisterInputType(reflect.TypeOf((*DefaultAutoScalingConfigurationVersionMapInput)(nil)).Elem(), DefaultAutoScalingConfigurationVersionMap{}) 266 pulumi.RegisterOutputType(DefaultAutoScalingConfigurationVersionOutput{}) 267 pulumi.RegisterOutputType(DefaultAutoScalingConfigurationVersionArrayOutput{}) 268 pulumi.RegisterOutputType(DefaultAutoScalingConfigurationVersionMapOutput{}) 269 }