github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/apigatewayv2/authorizer.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 apigatewayv2 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 an Amazon API Gateway Version 2 authorizer. 16 // More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api.html). 17 // 18 // ## Example Usage 19 // 20 // ### Basic WebSocket API 21 // 22 // <!--Start PulumiCodeChooser --> 23 // ```go 24 // package main 25 // 26 // import ( 27 // 28 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" 29 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 30 // 31 // ) 32 // 33 // func main() { 34 // pulumi.Run(func(ctx *pulumi.Context) error { 35 // _, err := apigatewayv2.NewAuthorizer(ctx, "example", &apigatewayv2.AuthorizerArgs{ 36 // ApiId: pulumi.Any(exampleAwsApigatewayv2Api.Id), 37 // AuthorizerType: pulumi.String("REQUEST"), 38 // AuthorizerUri: pulumi.Any(exampleAwsLambdaFunction.InvokeArn), 39 // IdentitySources: pulumi.StringArray{ 40 // pulumi.String("route.request.header.Auth"), 41 // }, 42 // Name: pulumi.String("example-authorizer"), 43 // }) 44 // if err != nil { 45 // return err 46 // } 47 // return nil 48 // }) 49 // } 50 // 51 // ``` 52 // <!--End PulumiCodeChooser --> 53 // 54 // ### Basic HTTP API 55 // 56 // <!--Start PulumiCodeChooser --> 57 // ```go 58 // package main 59 // 60 // import ( 61 // 62 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" 63 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 64 // 65 // ) 66 // 67 // func main() { 68 // pulumi.Run(func(ctx *pulumi.Context) error { 69 // _, err := apigatewayv2.NewAuthorizer(ctx, "example", &apigatewayv2.AuthorizerArgs{ 70 // ApiId: pulumi.Any(exampleAwsApigatewayv2Api.Id), 71 // AuthorizerType: pulumi.String("REQUEST"), 72 // AuthorizerUri: pulumi.Any(exampleAwsLambdaFunction.InvokeArn), 73 // IdentitySources: pulumi.StringArray{ 74 // pulumi.String("$request.header.Authorization"), 75 // }, 76 // Name: pulumi.String("example-authorizer"), 77 // AuthorizerPayloadFormatVersion: pulumi.String("2.0"), 78 // }) 79 // if err != nil { 80 // return err 81 // } 82 // return nil 83 // }) 84 // } 85 // 86 // ``` 87 // <!--End PulumiCodeChooser --> 88 // 89 // ## Import 90 // 91 // Using `pulumi import`, import `aws_apigatewayv2_authorizer` using the API identifier and authorizer identifier. For example: 92 // 93 // ```sh 94 // $ pulumi import aws:apigatewayv2/authorizer:Authorizer example aabbccddee/1122334 95 // ``` 96 type Authorizer struct { 97 pulumi.CustomResourceState 98 99 // API identifier. 100 ApiId pulumi.StringOutput `pulumi:"apiId"` 101 // Required credentials as an IAM role for API Gateway to invoke the authorizer. 102 // Supported only for `REQUEST` authorizers. 103 AuthorizerCredentialsArn pulumi.StringPtrOutput `pulumi:"authorizerCredentialsArn"` 104 // Format of the payload sent to an HTTP API Lambda authorizer. Required for HTTP API Lambda authorizers. 105 // Valid values: `1.0`, `2.0`. 106 AuthorizerPayloadFormatVersion pulumi.StringPtrOutput `pulumi:"authorizerPayloadFormatVersion"` 107 // Time to live (TTL) for cached authorizer results, in seconds. If it equals 0, authorization caching is disabled. 108 // If it is greater than 0, API Gateway caches authorizer responses. The maximum value is 3600, or 1 hour. Defaults to `300`. 109 // Supported only for HTTP API Lambda authorizers. 110 AuthorizerResultTtlInSeconds pulumi.IntOutput `pulumi:"authorizerResultTtlInSeconds"` 111 // Authorizer type. Valid values: `JWT`, `REQUEST`. 112 // Specify `REQUEST` for a Lambda function using incoming request parameters. 113 // For HTTP APIs, specify `JWT` to use JSON Web Tokens. 114 AuthorizerType pulumi.StringOutput `pulumi:"authorizerType"` 115 // Authorizer's Uniform Resource Identifier (URI). 116 // For `REQUEST` authorizers this must be a well-formed Lambda function URI, such as the `invokeArn` attribute of the `lambda.Function` resource. 117 // Supported only for `REQUEST` authorizers. Must be between 1 and 2048 characters in length. 118 AuthorizerUri pulumi.StringPtrOutput `pulumi:"authorizerUri"` 119 // Whether a Lambda authorizer returns a response in a simple format. If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy. 120 // Supported only for HTTP APIs. 121 EnableSimpleResponses pulumi.BoolPtrOutput `pulumi:"enableSimpleResponses"` 122 // Identity sources for which authorization is requested. 123 // For `REQUEST` authorizers the value is a list of one or more mapping expressions of the specified request parameters. 124 // For `JWT` authorizers the single entry specifies where to extract the JSON Web Token (JWT) from inbound requests. 125 IdentitySources pulumi.StringArrayOutput `pulumi:"identitySources"` 126 // Configuration of a JWT authorizer. Required for the `JWT` authorizer type. 127 // Supported only for HTTP APIs. 128 JwtConfiguration AuthorizerJwtConfigurationPtrOutput `pulumi:"jwtConfiguration"` 129 // Name of the authorizer. Must be between 1 and 128 characters in length. 130 Name pulumi.StringOutput `pulumi:"name"` 131 } 132 133 // NewAuthorizer registers a new resource with the given unique name, arguments, and options. 134 func NewAuthorizer(ctx *pulumi.Context, 135 name string, args *AuthorizerArgs, opts ...pulumi.ResourceOption) (*Authorizer, error) { 136 if args == nil { 137 return nil, errors.New("missing one or more required arguments") 138 } 139 140 if args.ApiId == nil { 141 return nil, errors.New("invalid value for required argument 'ApiId'") 142 } 143 if args.AuthorizerType == nil { 144 return nil, errors.New("invalid value for required argument 'AuthorizerType'") 145 } 146 opts = internal.PkgResourceDefaultOpts(opts) 147 var resource Authorizer 148 err := ctx.RegisterResource("aws:apigatewayv2/authorizer:Authorizer", name, args, &resource, opts...) 149 if err != nil { 150 return nil, err 151 } 152 return &resource, nil 153 } 154 155 // GetAuthorizer gets an existing Authorizer resource's state with the given name, ID, and optional 156 // state properties that are used to uniquely qualify the lookup (nil if not required). 157 func GetAuthorizer(ctx *pulumi.Context, 158 name string, id pulumi.IDInput, state *AuthorizerState, opts ...pulumi.ResourceOption) (*Authorizer, error) { 159 var resource Authorizer 160 err := ctx.ReadResource("aws:apigatewayv2/authorizer:Authorizer", name, id, state, &resource, opts...) 161 if err != nil { 162 return nil, err 163 } 164 return &resource, nil 165 } 166 167 // Input properties used for looking up and filtering Authorizer resources. 168 type authorizerState struct { 169 // API identifier. 170 ApiId *string `pulumi:"apiId"` 171 // Required credentials as an IAM role for API Gateway to invoke the authorizer. 172 // Supported only for `REQUEST` authorizers. 173 AuthorizerCredentialsArn *string `pulumi:"authorizerCredentialsArn"` 174 // Format of the payload sent to an HTTP API Lambda authorizer. Required for HTTP API Lambda authorizers. 175 // Valid values: `1.0`, `2.0`. 176 AuthorizerPayloadFormatVersion *string `pulumi:"authorizerPayloadFormatVersion"` 177 // Time to live (TTL) for cached authorizer results, in seconds. If it equals 0, authorization caching is disabled. 178 // If it is greater than 0, API Gateway caches authorizer responses. The maximum value is 3600, or 1 hour. Defaults to `300`. 179 // Supported only for HTTP API Lambda authorizers. 180 AuthorizerResultTtlInSeconds *int `pulumi:"authorizerResultTtlInSeconds"` 181 // Authorizer type. Valid values: `JWT`, `REQUEST`. 182 // Specify `REQUEST` for a Lambda function using incoming request parameters. 183 // For HTTP APIs, specify `JWT` to use JSON Web Tokens. 184 AuthorizerType *string `pulumi:"authorizerType"` 185 // Authorizer's Uniform Resource Identifier (URI). 186 // For `REQUEST` authorizers this must be a well-formed Lambda function URI, such as the `invokeArn` attribute of the `lambda.Function` resource. 187 // Supported only for `REQUEST` authorizers. Must be between 1 and 2048 characters in length. 188 AuthorizerUri *string `pulumi:"authorizerUri"` 189 // Whether a Lambda authorizer returns a response in a simple format. If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy. 190 // Supported only for HTTP APIs. 191 EnableSimpleResponses *bool `pulumi:"enableSimpleResponses"` 192 // Identity sources for which authorization is requested. 193 // For `REQUEST` authorizers the value is a list of one or more mapping expressions of the specified request parameters. 194 // For `JWT` authorizers the single entry specifies where to extract the JSON Web Token (JWT) from inbound requests. 195 IdentitySources []string `pulumi:"identitySources"` 196 // Configuration of a JWT authorizer. Required for the `JWT` authorizer type. 197 // Supported only for HTTP APIs. 198 JwtConfiguration *AuthorizerJwtConfiguration `pulumi:"jwtConfiguration"` 199 // Name of the authorizer. Must be between 1 and 128 characters in length. 200 Name *string `pulumi:"name"` 201 } 202 203 type AuthorizerState struct { 204 // API identifier. 205 ApiId pulumi.StringPtrInput 206 // Required credentials as an IAM role for API Gateway to invoke the authorizer. 207 // Supported only for `REQUEST` authorizers. 208 AuthorizerCredentialsArn pulumi.StringPtrInput 209 // Format of the payload sent to an HTTP API Lambda authorizer. Required for HTTP API Lambda authorizers. 210 // Valid values: `1.0`, `2.0`. 211 AuthorizerPayloadFormatVersion pulumi.StringPtrInput 212 // Time to live (TTL) for cached authorizer results, in seconds. If it equals 0, authorization caching is disabled. 213 // If it is greater than 0, API Gateway caches authorizer responses. The maximum value is 3600, or 1 hour. Defaults to `300`. 214 // Supported only for HTTP API Lambda authorizers. 215 AuthorizerResultTtlInSeconds pulumi.IntPtrInput 216 // Authorizer type. Valid values: `JWT`, `REQUEST`. 217 // Specify `REQUEST` for a Lambda function using incoming request parameters. 218 // For HTTP APIs, specify `JWT` to use JSON Web Tokens. 219 AuthorizerType pulumi.StringPtrInput 220 // Authorizer's Uniform Resource Identifier (URI). 221 // For `REQUEST` authorizers this must be a well-formed Lambda function URI, such as the `invokeArn` attribute of the `lambda.Function` resource. 222 // Supported only for `REQUEST` authorizers. Must be between 1 and 2048 characters in length. 223 AuthorizerUri pulumi.StringPtrInput 224 // Whether a Lambda authorizer returns a response in a simple format. If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy. 225 // Supported only for HTTP APIs. 226 EnableSimpleResponses pulumi.BoolPtrInput 227 // Identity sources for which authorization is requested. 228 // For `REQUEST` authorizers the value is a list of one or more mapping expressions of the specified request parameters. 229 // For `JWT` authorizers the single entry specifies where to extract the JSON Web Token (JWT) from inbound requests. 230 IdentitySources pulumi.StringArrayInput 231 // Configuration of a JWT authorizer. Required for the `JWT` authorizer type. 232 // Supported only for HTTP APIs. 233 JwtConfiguration AuthorizerJwtConfigurationPtrInput 234 // Name of the authorizer. Must be between 1 and 128 characters in length. 235 Name pulumi.StringPtrInput 236 } 237 238 func (AuthorizerState) ElementType() reflect.Type { 239 return reflect.TypeOf((*authorizerState)(nil)).Elem() 240 } 241 242 type authorizerArgs struct { 243 // API identifier. 244 ApiId string `pulumi:"apiId"` 245 // Required credentials as an IAM role for API Gateway to invoke the authorizer. 246 // Supported only for `REQUEST` authorizers. 247 AuthorizerCredentialsArn *string `pulumi:"authorizerCredentialsArn"` 248 // Format of the payload sent to an HTTP API Lambda authorizer. Required for HTTP API Lambda authorizers. 249 // Valid values: `1.0`, `2.0`. 250 AuthorizerPayloadFormatVersion *string `pulumi:"authorizerPayloadFormatVersion"` 251 // Time to live (TTL) for cached authorizer results, in seconds. If it equals 0, authorization caching is disabled. 252 // If it is greater than 0, API Gateway caches authorizer responses. The maximum value is 3600, or 1 hour. Defaults to `300`. 253 // Supported only for HTTP API Lambda authorizers. 254 AuthorizerResultTtlInSeconds *int `pulumi:"authorizerResultTtlInSeconds"` 255 // Authorizer type. Valid values: `JWT`, `REQUEST`. 256 // Specify `REQUEST` for a Lambda function using incoming request parameters. 257 // For HTTP APIs, specify `JWT` to use JSON Web Tokens. 258 AuthorizerType string `pulumi:"authorizerType"` 259 // Authorizer's Uniform Resource Identifier (URI). 260 // For `REQUEST` authorizers this must be a well-formed Lambda function URI, such as the `invokeArn` attribute of the `lambda.Function` resource. 261 // Supported only for `REQUEST` authorizers. Must be between 1 and 2048 characters in length. 262 AuthorizerUri *string `pulumi:"authorizerUri"` 263 // Whether a Lambda authorizer returns a response in a simple format. If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy. 264 // Supported only for HTTP APIs. 265 EnableSimpleResponses *bool `pulumi:"enableSimpleResponses"` 266 // Identity sources for which authorization is requested. 267 // For `REQUEST` authorizers the value is a list of one or more mapping expressions of the specified request parameters. 268 // For `JWT` authorizers the single entry specifies where to extract the JSON Web Token (JWT) from inbound requests. 269 IdentitySources []string `pulumi:"identitySources"` 270 // Configuration of a JWT authorizer. Required for the `JWT` authorizer type. 271 // Supported only for HTTP APIs. 272 JwtConfiguration *AuthorizerJwtConfiguration `pulumi:"jwtConfiguration"` 273 // Name of the authorizer. Must be between 1 and 128 characters in length. 274 Name *string `pulumi:"name"` 275 } 276 277 // The set of arguments for constructing a Authorizer resource. 278 type AuthorizerArgs struct { 279 // API identifier. 280 ApiId pulumi.StringInput 281 // Required credentials as an IAM role for API Gateway to invoke the authorizer. 282 // Supported only for `REQUEST` authorizers. 283 AuthorizerCredentialsArn pulumi.StringPtrInput 284 // Format of the payload sent to an HTTP API Lambda authorizer. Required for HTTP API Lambda authorizers. 285 // Valid values: `1.0`, `2.0`. 286 AuthorizerPayloadFormatVersion pulumi.StringPtrInput 287 // Time to live (TTL) for cached authorizer results, in seconds. If it equals 0, authorization caching is disabled. 288 // If it is greater than 0, API Gateway caches authorizer responses. The maximum value is 3600, or 1 hour. Defaults to `300`. 289 // Supported only for HTTP API Lambda authorizers. 290 AuthorizerResultTtlInSeconds pulumi.IntPtrInput 291 // Authorizer type. Valid values: `JWT`, `REQUEST`. 292 // Specify `REQUEST` for a Lambda function using incoming request parameters. 293 // For HTTP APIs, specify `JWT` to use JSON Web Tokens. 294 AuthorizerType pulumi.StringInput 295 // Authorizer's Uniform Resource Identifier (URI). 296 // For `REQUEST` authorizers this must be a well-formed Lambda function URI, such as the `invokeArn` attribute of the `lambda.Function` resource. 297 // Supported only for `REQUEST` authorizers. Must be between 1 and 2048 characters in length. 298 AuthorizerUri pulumi.StringPtrInput 299 // Whether a Lambda authorizer returns a response in a simple format. If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy. 300 // Supported only for HTTP APIs. 301 EnableSimpleResponses pulumi.BoolPtrInput 302 // Identity sources for which authorization is requested. 303 // For `REQUEST` authorizers the value is a list of one or more mapping expressions of the specified request parameters. 304 // For `JWT` authorizers the single entry specifies where to extract the JSON Web Token (JWT) from inbound requests. 305 IdentitySources pulumi.StringArrayInput 306 // Configuration of a JWT authorizer. Required for the `JWT` authorizer type. 307 // Supported only for HTTP APIs. 308 JwtConfiguration AuthorizerJwtConfigurationPtrInput 309 // Name of the authorizer. Must be between 1 and 128 characters in length. 310 Name pulumi.StringPtrInput 311 } 312 313 func (AuthorizerArgs) ElementType() reflect.Type { 314 return reflect.TypeOf((*authorizerArgs)(nil)).Elem() 315 } 316 317 type AuthorizerInput interface { 318 pulumi.Input 319 320 ToAuthorizerOutput() AuthorizerOutput 321 ToAuthorizerOutputWithContext(ctx context.Context) AuthorizerOutput 322 } 323 324 func (*Authorizer) ElementType() reflect.Type { 325 return reflect.TypeOf((**Authorizer)(nil)).Elem() 326 } 327 328 func (i *Authorizer) ToAuthorizerOutput() AuthorizerOutput { 329 return i.ToAuthorizerOutputWithContext(context.Background()) 330 } 331 332 func (i *Authorizer) ToAuthorizerOutputWithContext(ctx context.Context) AuthorizerOutput { 333 return pulumi.ToOutputWithContext(ctx, i).(AuthorizerOutput) 334 } 335 336 // AuthorizerArrayInput is an input type that accepts AuthorizerArray and AuthorizerArrayOutput values. 337 // You can construct a concrete instance of `AuthorizerArrayInput` via: 338 // 339 // AuthorizerArray{ AuthorizerArgs{...} } 340 type AuthorizerArrayInput interface { 341 pulumi.Input 342 343 ToAuthorizerArrayOutput() AuthorizerArrayOutput 344 ToAuthorizerArrayOutputWithContext(context.Context) AuthorizerArrayOutput 345 } 346 347 type AuthorizerArray []AuthorizerInput 348 349 func (AuthorizerArray) ElementType() reflect.Type { 350 return reflect.TypeOf((*[]*Authorizer)(nil)).Elem() 351 } 352 353 func (i AuthorizerArray) ToAuthorizerArrayOutput() AuthorizerArrayOutput { 354 return i.ToAuthorizerArrayOutputWithContext(context.Background()) 355 } 356 357 func (i AuthorizerArray) ToAuthorizerArrayOutputWithContext(ctx context.Context) AuthorizerArrayOutput { 358 return pulumi.ToOutputWithContext(ctx, i).(AuthorizerArrayOutput) 359 } 360 361 // AuthorizerMapInput is an input type that accepts AuthorizerMap and AuthorizerMapOutput values. 362 // You can construct a concrete instance of `AuthorizerMapInput` via: 363 // 364 // AuthorizerMap{ "key": AuthorizerArgs{...} } 365 type AuthorizerMapInput interface { 366 pulumi.Input 367 368 ToAuthorizerMapOutput() AuthorizerMapOutput 369 ToAuthorizerMapOutputWithContext(context.Context) AuthorizerMapOutput 370 } 371 372 type AuthorizerMap map[string]AuthorizerInput 373 374 func (AuthorizerMap) ElementType() reflect.Type { 375 return reflect.TypeOf((*map[string]*Authorizer)(nil)).Elem() 376 } 377 378 func (i AuthorizerMap) ToAuthorizerMapOutput() AuthorizerMapOutput { 379 return i.ToAuthorizerMapOutputWithContext(context.Background()) 380 } 381 382 func (i AuthorizerMap) ToAuthorizerMapOutputWithContext(ctx context.Context) AuthorizerMapOutput { 383 return pulumi.ToOutputWithContext(ctx, i).(AuthorizerMapOutput) 384 } 385 386 type AuthorizerOutput struct{ *pulumi.OutputState } 387 388 func (AuthorizerOutput) ElementType() reflect.Type { 389 return reflect.TypeOf((**Authorizer)(nil)).Elem() 390 } 391 392 func (o AuthorizerOutput) ToAuthorizerOutput() AuthorizerOutput { 393 return o 394 } 395 396 func (o AuthorizerOutput) ToAuthorizerOutputWithContext(ctx context.Context) AuthorizerOutput { 397 return o 398 } 399 400 // API identifier. 401 func (o AuthorizerOutput) ApiId() pulumi.StringOutput { 402 return o.ApplyT(func(v *Authorizer) pulumi.StringOutput { return v.ApiId }).(pulumi.StringOutput) 403 } 404 405 // Required credentials as an IAM role for API Gateway to invoke the authorizer. 406 // Supported only for `REQUEST` authorizers. 407 func (o AuthorizerOutput) AuthorizerCredentialsArn() pulumi.StringPtrOutput { 408 return o.ApplyT(func(v *Authorizer) pulumi.StringPtrOutput { return v.AuthorizerCredentialsArn }).(pulumi.StringPtrOutput) 409 } 410 411 // Format of the payload sent to an HTTP API Lambda authorizer. Required for HTTP API Lambda authorizers. 412 // Valid values: `1.0`, `2.0`. 413 func (o AuthorizerOutput) AuthorizerPayloadFormatVersion() pulumi.StringPtrOutput { 414 return o.ApplyT(func(v *Authorizer) pulumi.StringPtrOutput { return v.AuthorizerPayloadFormatVersion }).(pulumi.StringPtrOutput) 415 } 416 417 // Time to live (TTL) for cached authorizer results, in seconds. If it equals 0, authorization caching is disabled. 418 // If it is greater than 0, API Gateway caches authorizer responses. The maximum value is 3600, or 1 hour. Defaults to `300`. 419 // Supported only for HTTP API Lambda authorizers. 420 func (o AuthorizerOutput) AuthorizerResultTtlInSeconds() pulumi.IntOutput { 421 return o.ApplyT(func(v *Authorizer) pulumi.IntOutput { return v.AuthorizerResultTtlInSeconds }).(pulumi.IntOutput) 422 } 423 424 // Authorizer type. Valid values: `JWT`, `REQUEST`. 425 // Specify `REQUEST` for a Lambda function using incoming request parameters. 426 // For HTTP APIs, specify `JWT` to use JSON Web Tokens. 427 func (o AuthorizerOutput) AuthorizerType() pulumi.StringOutput { 428 return o.ApplyT(func(v *Authorizer) pulumi.StringOutput { return v.AuthorizerType }).(pulumi.StringOutput) 429 } 430 431 // Authorizer's Uniform Resource Identifier (URI). 432 // For `REQUEST` authorizers this must be a well-formed Lambda function URI, such as the `invokeArn` attribute of the `lambda.Function` resource. 433 // Supported only for `REQUEST` authorizers. Must be between 1 and 2048 characters in length. 434 func (o AuthorizerOutput) AuthorizerUri() pulumi.StringPtrOutput { 435 return o.ApplyT(func(v *Authorizer) pulumi.StringPtrOutput { return v.AuthorizerUri }).(pulumi.StringPtrOutput) 436 } 437 438 // Whether a Lambda authorizer returns a response in a simple format. If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy. 439 // Supported only for HTTP APIs. 440 func (o AuthorizerOutput) EnableSimpleResponses() pulumi.BoolPtrOutput { 441 return o.ApplyT(func(v *Authorizer) pulumi.BoolPtrOutput { return v.EnableSimpleResponses }).(pulumi.BoolPtrOutput) 442 } 443 444 // Identity sources for which authorization is requested. 445 // For `REQUEST` authorizers the value is a list of one or more mapping expressions of the specified request parameters. 446 // For `JWT` authorizers the single entry specifies where to extract the JSON Web Token (JWT) from inbound requests. 447 func (o AuthorizerOutput) IdentitySources() pulumi.StringArrayOutput { 448 return o.ApplyT(func(v *Authorizer) pulumi.StringArrayOutput { return v.IdentitySources }).(pulumi.StringArrayOutput) 449 } 450 451 // Configuration of a JWT authorizer. Required for the `JWT` authorizer type. 452 // Supported only for HTTP APIs. 453 func (o AuthorizerOutput) JwtConfiguration() AuthorizerJwtConfigurationPtrOutput { 454 return o.ApplyT(func(v *Authorizer) AuthorizerJwtConfigurationPtrOutput { return v.JwtConfiguration }).(AuthorizerJwtConfigurationPtrOutput) 455 } 456 457 // Name of the authorizer. Must be between 1 and 128 characters in length. 458 func (o AuthorizerOutput) Name() pulumi.StringOutput { 459 return o.ApplyT(func(v *Authorizer) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 460 } 461 462 type AuthorizerArrayOutput struct{ *pulumi.OutputState } 463 464 func (AuthorizerArrayOutput) ElementType() reflect.Type { 465 return reflect.TypeOf((*[]*Authorizer)(nil)).Elem() 466 } 467 468 func (o AuthorizerArrayOutput) ToAuthorizerArrayOutput() AuthorizerArrayOutput { 469 return o 470 } 471 472 func (o AuthorizerArrayOutput) ToAuthorizerArrayOutputWithContext(ctx context.Context) AuthorizerArrayOutput { 473 return o 474 } 475 476 func (o AuthorizerArrayOutput) Index(i pulumi.IntInput) AuthorizerOutput { 477 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Authorizer { 478 return vs[0].([]*Authorizer)[vs[1].(int)] 479 }).(AuthorizerOutput) 480 } 481 482 type AuthorizerMapOutput struct{ *pulumi.OutputState } 483 484 func (AuthorizerMapOutput) ElementType() reflect.Type { 485 return reflect.TypeOf((*map[string]*Authorizer)(nil)).Elem() 486 } 487 488 func (o AuthorizerMapOutput) ToAuthorizerMapOutput() AuthorizerMapOutput { 489 return o 490 } 491 492 func (o AuthorizerMapOutput) ToAuthorizerMapOutputWithContext(ctx context.Context) AuthorizerMapOutput { 493 return o 494 } 495 496 func (o AuthorizerMapOutput) MapIndex(k pulumi.StringInput) AuthorizerOutput { 497 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Authorizer { 498 return vs[0].(map[string]*Authorizer)[vs[1].(string)] 499 }).(AuthorizerOutput) 500 } 501 502 func init() { 503 pulumi.RegisterInputType(reflect.TypeOf((*AuthorizerInput)(nil)).Elem(), &Authorizer{}) 504 pulumi.RegisterInputType(reflect.TypeOf((*AuthorizerArrayInput)(nil)).Elem(), AuthorizerArray{}) 505 pulumi.RegisterInputType(reflect.TypeOf((*AuthorizerMapInput)(nil)).Elem(), AuthorizerMap{}) 506 pulumi.RegisterOutputType(AuthorizerOutput{}) 507 pulumi.RegisterOutputType(AuthorizerArrayOutput{}) 508 pulumi.RegisterOutputType(AuthorizerMapOutput{}) 509 }