github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/servicequotas/template.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 servicequotas 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 // Resource for managing an AWS Service Quotas Template. 16 // 17 // > Only the management account of an organization can alter Service Quota templates, and this must be done from the `us-east-1` region. 18 // 19 // ## Example Usage 20 // 21 // ### Basic Usage 22 // 23 // <!--Start PulumiCodeChooser --> 24 // ```go 25 // package main 26 // 27 // import ( 28 // 29 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/servicequotas" 30 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 31 // 32 // ) 33 // 34 // func main() { 35 // pulumi.Run(func(ctx *pulumi.Context) error { 36 // _, err := servicequotas.NewTemplate(ctx, "example", &servicequotas.TemplateArgs{ 37 // Region: pulumi.String("us-east-1"), 38 // QuotaCode: pulumi.String("L-2ACBD22F"), 39 // ServiceCode: pulumi.String("lambda"), 40 // Value: pulumi.Float64(80), 41 // }) 42 // if err != nil { 43 // return err 44 // } 45 // return nil 46 // }) 47 // } 48 // 49 // ``` 50 // <!--End PulumiCodeChooser --> 51 // 52 // ## Import 53 // 54 // Using `pulumi import`, import Service Quotas Template using the `id`. For example: 55 // 56 // ```sh 57 // $ pulumi import aws:servicequotas/template:Template example us-east-1,L-2ACBD22F,lambda 58 // ``` 59 type Template struct { 60 pulumi.CustomResourceState 61 62 // Indicates whether the quota is global. 63 GlobalQuota pulumi.BoolOutput `pulumi:"globalQuota"` 64 // Quota identifier. To find the quota code for a specific quota, use the servicequotas.ServiceQuota data source. 65 QuotaCode pulumi.StringOutput `pulumi:"quotaCode"` 66 // Quota name. 67 QuotaName pulumi.StringOutput `pulumi:"quotaName"` 68 // AWS Region to which the template applies. 69 Region pulumi.StringOutput `pulumi:"region"` 70 // Service identifier. To find the service code value for an AWS service, use the servicequotas.getService data source. 71 ServiceCode pulumi.StringOutput `pulumi:"serviceCode"` 72 // Service name. 73 ServiceName pulumi.StringOutput `pulumi:"serviceName"` 74 // Unit of measurement. 75 Unit pulumi.StringOutput `pulumi:"unit"` 76 // The new, increased value for the quota. 77 Value pulumi.Float64Output `pulumi:"value"` 78 } 79 80 // NewTemplate registers a new resource with the given unique name, arguments, and options. 81 func NewTemplate(ctx *pulumi.Context, 82 name string, args *TemplateArgs, opts ...pulumi.ResourceOption) (*Template, error) { 83 if args == nil { 84 return nil, errors.New("missing one or more required arguments") 85 } 86 87 if args.QuotaCode == nil { 88 return nil, errors.New("invalid value for required argument 'QuotaCode'") 89 } 90 if args.Region == nil { 91 return nil, errors.New("invalid value for required argument 'Region'") 92 } 93 if args.ServiceCode == nil { 94 return nil, errors.New("invalid value for required argument 'ServiceCode'") 95 } 96 if args.Value == nil { 97 return nil, errors.New("invalid value for required argument 'Value'") 98 } 99 opts = internal.PkgResourceDefaultOpts(opts) 100 var resource Template 101 err := ctx.RegisterResource("aws:servicequotas/template:Template", name, args, &resource, opts...) 102 if err != nil { 103 return nil, err 104 } 105 return &resource, nil 106 } 107 108 // GetTemplate gets an existing Template resource's state with the given name, ID, and optional 109 // state properties that are used to uniquely qualify the lookup (nil if not required). 110 func GetTemplate(ctx *pulumi.Context, 111 name string, id pulumi.IDInput, state *TemplateState, opts ...pulumi.ResourceOption) (*Template, error) { 112 var resource Template 113 err := ctx.ReadResource("aws:servicequotas/template:Template", name, id, state, &resource, opts...) 114 if err != nil { 115 return nil, err 116 } 117 return &resource, nil 118 } 119 120 // Input properties used for looking up and filtering Template resources. 121 type templateState struct { 122 // Indicates whether the quota is global. 123 GlobalQuota *bool `pulumi:"globalQuota"` 124 // Quota identifier. To find the quota code for a specific quota, use the servicequotas.ServiceQuota data source. 125 QuotaCode *string `pulumi:"quotaCode"` 126 // Quota name. 127 QuotaName *string `pulumi:"quotaName"` 128 // AWS Region to which the template applies. 129 Region *string `pulumi:"region"` 130 // Service identifier. To find the service code value for an AWS service, use the servicequotas.getService data source. 131 ServiceCode *string `pulumi:"serviceCode"` 132 // Service name. 133 ServiceName *string `pulumi:"serviceName"` 134 // Unit of measurement. 135 Unit *string `pulumi:"unit"` 136 // The new, increased value for the quota. 137 Value *float64 `pulumi:"value"` 138 } 139 140 type TemplateState struct { 141 // Indicates whether the quota is global. 142 GlobalQuota pulumi.BoolPtrInput 143 // Quota identifier. To find the quota code for a specific quota, use the servicequotas.ServiceQuota data source. 144 QuotaCode pulumi.StringPtrInput 145 // Quota name. 146 QuotaName pulumi.StringPtrInput 147 // AWS Region to which the template applies. 148 Region pulumi.StringPtrInput 149 // Service identifier. To find the service code value for an AWS service, use the servicequotas.getService data source. 150 ServiceCode pulumi.StringPtrInput 151 // Service name. 152 ServiceName pulumi.StringPtrInput 153 // Unit of measurement. 154 Unit pulumi.StringPtrInput 155 // The new, increased value for the quota. 156 Value pulumi.Float64PtrInput 157 } 158 159 func (TemplateState) ElementType() reflect.Type { 160 return reflect.TypeOf((*templateState)(nil)).Elem() 161 } 162 163 type templateArgs struct { 164 // Quota identifier. To find the quota code for a specific quota, use the servicequotas.ServiceQuota data source. 165 QuotaCode string `pulumi:"quotaCode"` 166 // AWS Region to which the template applies. 167 Region string `pulumi:"region"` 168 // Service identifier. To find the service code value for an AWS service, use the servicequotas.getService data source. 169 ServiceCode string `pulumi:"serviceCode"` 170 // The new, increased value for the quota. 171 Value float64 `pulumi:"value"` 172 } 173 174 // The set of arguments for constructing a Template resource. 175 type TemplateArgs struct { 176 // Quota identifier. To find the quota code for a specific quota, use the servicequotas.ServiceQuota data source. 177 QuotaCode pulumi.StringInput 178 // AWS Region to which the template applies. 179 Region pulumi.StringInput 180 // Service identifier. To find the service code value for an AWS service, use the servicequotas.getService data source. 181 ServiceCode pulumi.StringInput 182 // The new, increased value for the quota. 183 Value pulumi.Float64Input 184 } 185 186 func (TemplateArgs) ElementType() reflect.Type { 187 return reflect.TypeOf((*templateArgs)(nil)).Elem() 188 } 189 190 type TemplateInput interface { 191 pulumi.Input 192 193 ToTemplateOutput() TemplateOutput 194 ToTemplateOutputWithContext(ctx context.Context) TemplateOutput 195 } 196 197 func (*Template) ElementType() reflect.Type { 198 return reflect.TypeOf((**Template)(nil)).Elem() 199 } 200 201 func (i *Template) ToTemplateOutput() TemplateOutput { 202 return i.ToTemplateOutputWithContext(context.Background()) 203 } 204 205 func (i *Template) ToTemplateOutputWithContext(ctx context.Context) TemplateOutput { 206 return pulumi.ToOutputWithContext(ctx, i).(TemplateOutput) 207 } 208 209 // TemplateArrayInput is an input type that accepts TemplateArray and TemplateArrayOutput values. 210 // You can construct a concrete instance of `TemplateArrayInput` via: 211 // 212 // TemplateArray{ TemplateArgs{...} } 213 type TemplateArrayInput interface { 214 pulumi.Input 215 216 ToTemplateArrayOutput() TemplateArrayOutput 217 ToTemplateArrayOutputWithContext(context.Context) TemplateArrayOutput 218 } 219 220 type TemplateArray []TemplateInput 221 222 func (TemplateArray) ElementType() reflect.Type { 223 return reflect.TypeOf((*[]*Template)(nil)).Elem() 224 } 225 226 func (i TemplateArray) ToTemplateArrayOutput() TemplateArrayOutput { 227 return i.ToTemplateArrayOutputWithContext(context.Background()) 228 } 229 230 func (i TemplateArray) ToTemplateArrayOutputWithContext(ctx context.Context) TemplateArrayOutput { 231 return pulumi.ToOutputWithContext(ctx, i).(TemplateArrayOutput) 232 } 233 234 // TemplateMapInput is an input type that accepts TemplateMap and TemplateMapOutput values. 235 // You can construct a concrete instance of `TemplateMapInput` via: 236 // 237 // TemplateMap{ "key": TemplateArgs{...} } 238 type TemplateMapInput interface { 239 pulumi.Input 240 241 ToTemplateMapOutput() TemplateMapOutput 242 ToTemplateMapOutputWithContext(context.Context) TemplateMapOutput 243 } 244 245 type TemplateMap map[string]TemplateInput 246 247 func (TemplateMap) ElementType() reflect.Type { 248 return reflect.TypeOf((*map[string]*Template)(nil)).Elem() 249 } 250 251 func (i TemplateMap) ToTemplateMapOutput() TemplateMapOutput { 252 return i.ToTemplateMapOutputWithContext(context.Background()) 253 } 254 255 func (i TemplateMap) ToTemplateMapOutputWithContext(ctx context.Context) TemplateMapOutput { 256 return pulumi.ToOutputWithContext(ctx, i).(TemplateMapOutput) 257 } 258 259 type TemplateOutput struct{ *pulumi.OutputState } 260 261 func (TemplateOutput) ElementType() reflect.Type { 262 return reflect.TypeOf((**Template)(nil)).Elem() 263 } 264 265 func (o TemplateOutput) ToTemplateOutput() TemplateOutput { 266 return o 267 } 268 269 func (o TemplateOutput) ToTemplateOutputWithContext(ctx context.Context) TemplateOutput { 270 return o 271 } 272 273 // Indicates whether the quota is global. 274 func (o TemplateOutput) GlobalQuota() pulumi.BoolOutput { 275 return o.ApplyT(func(v *Template) pulumi.BoolOutput { return v.GlobalQuota }).(pulumi.BoolOutput) 276 } 277 278 // Quota identifier. To find the quota code for a specific quota, use the servicequotas.ServiceQuota data source. 279 func (o TemplateOutput) QuotaCode() pulumi.StringOutput { 280 return o.ApplyT(func(v *Template) pulumi.StringOutput { return v.QuotaCode }).(pulumi.StringOutput) 281 } 282 283 // Quota name. 284 func (o TemplateOutput) QuotaName() pulumi.StringOutput { 285 return o.ApplyT(func(v *Template) pulumi.StringOutput { return v.QuotaName }).(pulumi.StringOutput) 286 } 287 288 // AWS Region to which the template applies. 289 func (o TemplateOutput) Region() pulumi.StringOutput { 290 return o.ApplyT(func(v *Template) pulumi.StringOutput { return v.Region }).(pulumi.StringOutput) 291 } 292 293 // Service identifier. To find the service code value for an AWS service, use the servicequotas.getService data source. 294 func (o TemplateOutput) ServiceCode() pulumi.StringOutput { 295 return o.ApplyT(func(v *Template) pulumi.StringOutput { return v.ServiceCode }).(pulumi.StringOutput) 296 } 297 298 // Service name. 299 func (o TemplateOutput) ServiceName() pulumi.StringOutput { 300 return o.ApplyT(func(v *Template) pulumi.StringOutput { return v.ServiceName }).(pulumi.StringOutput) 301 } 302 303 // Unit of measurement. 304 func (o TemplateOutput) Unit() pulumi.StringOutput { 305 return o.ApplyT(func(v *Template) pulumi.StringOutput { return v.Unit }).(pulumi.StringOutput) 306 } 307 308 // The new, increased value for the quota. 309 func (o TemplateOutput) Value() pulumi.Float64Output { 310 return o.ApplyT(func(v *Template) pulumi.Float64Output { return v.Value }).(pulumi.Float64Output) 311 } 312 313 type TemplateArrayOutput struct{ *pulumi.OutputState } 314 315 func (TemplateArrayOutput) ElementType() reflect.Type { 316 return reflect.TypeOf((*[]*Template)(nil)).Elem() 317 } 318 319 func (o TemplateArrayOutput) ToTemplateArrayOutput() TemplateArrayOutput { 320 return o 321 } 322 323 func (o TemplateArrayOutput) ToTemplateArrayOutputWithContext(ctx context.Context) TemplateArrayOutput { 324 return o 325 } 326 327 func (o TemplateArrayOutput) Index(i pulumi.IntInput) TemplateOutput { 328 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Template { 329 return vs[0].([]*Template)[vs[1].(int)] 330 }).(TemplateOutput) 331 } 332 333 type TemplateMapOutput struct{ *pulumi.OutputState } 334 335 func (TemplateMapOutput) ElementType() reflect.Type { 336 return reflect.TypeOf((*map[string]*Template)(nil)).Elem() 337 } 338 339 func (o TemplateMapOutput) ToTemplateMapOutput() TemplateMapOutput { 340 return o 341 } 342 343 func (o TemplateMapOutput) ToTemplateMapOutputWithContext(ctx context.Context) TemplateMapOutput { 344 return o 345 } 346 347 func (o TemplateMapOutput) MapIndex(k pulumi.StringInput) TemplateOutput { 348 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Template { 349 return vs[0].(map[string]*Template)[vs[1].(string)] 350 }).(TemplateOutput) 351 } 352 353 func init() { 354 pulumi.RegisterInputType(reflect.TypeOf((*TemplateInput)(nil)).Elem(), &Template{}) 355 pulumi.RegisterInputType(reflect.TypeOf((*TemplateArrayInput)(nil)).Elem(), TemplateArray{}) 356 pulumi.RegisterInputType(reflect.TypeOf((*TemplateMapInput)(nil)).Elem(), TemplateMap{}) 357 pulumi.RegisterOutputType(TemplateOutput{}) 358 pulumi.RegisterOutputType(TemplateArrayOutput{}) 359 pulumi.RegisterOutputType(TemplateMapOutput{}) 360 }