github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/apigateway/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 apigateway
     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  // Provides an API Gateway Authorizer.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigateway"
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lambda"
    28  //	"github.com/pulumi/pulumi-std/sdk/go/std"
    29  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    30  //
    31  // )
    32  //
    33  //	func main() {
    34  //		pulumi.Run(func(ctx *pulumi.Context) error {
    35  //			demoRestApi, err := apigateway.NewRestApi(ctx, "demo", &apigateway.RestApiArgs{
    36  //				Name: pulumi.String("auth-demo"),
    37  //			})
    38  //			if err != nil {
    39  //				return err
    40  //			}
    41  //			invocationAssumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
    42  //				Statements: []iam.GetPolicyDocumentStatement{
    43  //					{
    44  //						Effect: pulumi.StringRef("Allow"),
    45  //						Principals: []iam.GetPolicyDocumentStatementPrincipal{
    46  //							{
    47  //								Type: "Service",
    48  //								Identifiers: []string{
    49  //									"apigateway.amazonaws.com",
    50  //								},
    51  //							},
    52  //						},
    53  //						Actions: []string{
    54  //							"sts:AssumeRole",
    55  //						},
    56  //					},
    57  //				},
    58  //			}, nil)
    59  //			if err != nil {
    60  //				return err
    61  //			}
    62  //			invocationRole, err := iam.NewRole(ctx, "invocation_role", &iam.RoleArgs{
    63  //				Name:             pulumi.String("api_gateway_auth_invocation"),
    64  //				Path:             pulumi.String("/"),
    65  //				AssumeRolePolicy: pulumi.String(invocationAssumeRole.Json),
    66  //			})
    67  //			if err != nil {
    68  //				return err
    69  //			}
    70  //			lambdaAssumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
    71  //				Statements: []iam.GetPolicyDocumentStatement{
    72  //					{
    73  //						Effect: pulumi.StringRef("Allow"),
    74  //						Actions: []string{
    75  //							"sts:AssumeRole",
    76  //						},
    77  //						Principals: []iam.GetPolicyDocumentStatementPrincipal{
    78  //							{
    79  //								Type: "Service",
    80  //								Identifiers: []string{
    81  //									"lambda.amazonaws.com",
    82  //								},
    83  //							},
    84  //						},
    85  //					},
    86  //				},
    87  //			}, nil)
    88  //			if err != nil {
    89  //				return err
    90  //			}
    91  //			lambda, err := iam.NewRole(ctx, "lambda", &iam.RoleArgs{
    92  //				Name:             pulumi.String("demo-lambda"),
    93  //				AssumeRolePolicy: pulumi.String(lambdaAssumeRole.Json),
    94  //			})
    95  //			if err != nil {
    96  //				return err
    97  //			}
    98  //			invokeFilebase64sha256, err := std.Filebase64sha256(ctx, &std.Filebase64sha256Args{
    99  //				Input: "lambda-function.zip",
   100  //			}, nil)
   101  //			if err != nil {
   102  //				return err
   103  //			}
   104  //			authorizer, err := lambda.NewFunction(ctx, "authorizer", &lambda.FunctionArgs{
   105  //				Code:           pulumi.NewFileArchive("lambda-function.zip"),
   106  //				Name:           pulumi.String("api_gateway_authorizer"),
   107  //				Role:           lambda.Arn,
   108  //				Handler:        pulumi.String("exports.example"),
   109  //				SourceCodeHash: invokeFilebase64sha256.Result,
   110  //			})
   111  //			if err != nil {
   112  //				return err
   113  //			}
   114  //			_, err = apigateway.NewAuthorizer(ctx, "demo", &apigateway.AuthorizerArgs{
   115  //				Name:                  pulumi.String("demo"),
   116  //				RestApi:               demoRestApi.ID(),
   117  //				AuthorizerUri:         authorizer.InvokeArn,
   118  //				AuthorizerCredentials: invocationRole.Arn,
   119  //			})
   120  //			if err != nil {
   121  //				return err
   122  //			}
   123  //			invocationPolicy := iam.GetPolicyDocumentOutput(ctx, iam.GetPolicyDocumentOutputArgs{
   124  //				Statements: iam.GetPolicyDocumentStatementArray{
   125  //					&iam.GetPolicyDocumentStatementArgs{
   126  //						Effect: pulumi.String("Allow"),
   127  //						Actions: pulumi.StringArray{
   128  //							pulumi.String("lambda:InvokeFunction"),
   129  //						},
   130  //						Resources: pulumi.StringArray{
   131  //							authorizer.Arn,
   132  //						},
   133  //					},
   134  //				},
   135  //			}, nil)
   136  //			_, err = iam.NewRolePolicy(ctx, "invocation_policy", &iam.RolePolicyArgs{
   137  //				Name: pulumi.String("default"),
   138  //				Role: invocationRole.ID(),
   139  //				Policy: invocationPolicy.ApplyT(func(invocationPolicy iam.GetPolicyDocumentResult) (*string, error) {
   140  //					return &invocationPolicy.Json, nil
   141  //				}).(pulumi.StringPtrOutput),
   142  //			})
   143  //			if err != nil {
   144  //				return err
   145  //			}
   146  //			return nil
   147  //		})
   148  //	}
   149  //
   150  // ```
   151  // <!--End PulumiCodeChooser -->
   152  //
   153  // ## Import
   154  //
   155  // Using `pulumi import`, import AWS API Gateway Authorizer using the `REST-API-ID/AUTHORIZER-ID`. For example:
   156  //
   157  // ```sh
   158  // $ pulumi import aws:apigateway/authorizer:Authorizer authorizer 12345abcde/example
   159  // ```
   160  type Authorizer struct {
   161  	pulumi.CustomResourceState
   162  
   163  	// ARN of the API Gateway Authorizer
   164  	Arn pulumi.StringOutput `pulumi:"arn"`
   165  	// Credentials required for the authorizer. To specify an IAM Role for API Gateway to assume, use the IAM Role ARN.
   166  	AuthorizerCredentials pulumi.StringPtrOutput `pulumi:"authorizerCredentials"`
   167  	// TTL of cached authorizer results in seconds. Defaults to `300`.
   168  	AuthorizerResultTtlInSeconds pulumi.IntPtrOutput `pulumi:"authorizerResultTtlInSeconds"`
   169  	// Authorizer's Uniform Resource Identifier (URI). This must be a well-formed Lambda function URI in the form of `arn:aws:apigateway:{region}:lambda:path/{service_api}`,
   170  	// e.g., `arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:012345678912:function:my-function/invocations`
   171  	AuthorizerUri pulumi.StringPtrOutput `pulumi:"authorizerUri"`
   172  	// Source of the identity in an incoming request. Defaults to `method.request.header.Authorization`. For `REQUEST` type, this may be a comma-separated list of values, including headers, query string parameters and stage variables - e.g., `"method.request.header.SomeHeaderName,method.request.querystring.SomeQueryStringName,stageVariables.SomeStageVariableName"`
   173  	IdentitySource pulumi.StringPtrOutput `pulumi:"identitySource"`
   174  	// Validation expression for the incoming identity. For `TOKEN` type, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response.
   175  	IdentityValidationExpression pulumi.StringPtrOutput `pulumi:"identityValidationExpression"`
   176  	// Name of the authorizer
   177  	Name pulumi.StringOutput `pulumi:"name"`
   178  	// List of the Amazon Cognito user pool ARNs. Each element is of this format: `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`.
   179  	ProviderArns pulumi.StringArrayOutput `pulumi:"providerArns"`
   180  	// ID of the associated REST API
   181  	RestApi pulumi.StringOutput `pulumi:"restApi"`
   182  	// Type of the authorizer. Possible values are `TOKEN` for a Lambda function using a single authorization token submitted in a custom header, `REQUEST` for a Lambda function using incoming request parameters, or `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. Defaults to `TOKEN`.
   183  	Type pulumi.StringPtrOutput `pulumi:"type"`
   184  }
   185  
   186  // NewAuthorizer registers a new resource with the given unique name, arguments, and options.
   187  func NewAuthorizer(ctx *pulumi.Context,
   188  	name string, args *AuthorizerArgs, opts ...pulumi.ResourceOption) (*Authorizer, error) {
   189  	if args == nil {
   190  		return nil, errors.New("missing one or more required arguments")
   191  	}
   192  
   193  	if args.RestApi == nil {
   194  		return nil, errors.New("invalid value for required argument 'RestApi'")
   195  	}
   196  	opts = internal.PkgResourceDefaultOpts(opts)
   197  	var resource Authorizer
   198  	err := ctx.RegisterResource("aws:apigateway/authorizer:Authorizer", name, args, &resource, opts...)
   199  	if err != nil {
   200  		return nil, err
   201  	}
   202  	return &resource, nil
   203  }
   204  
   205  // GetAuthorizer gets an existing Authorizer resource's state with the given name, ID, and optional
   206  // state properties that are used to uniquely qualify the lookup (nil if not required).
   207  func GetAuthorizer(ctx *pulumi.Context,
   208  	name string, id pulumi.IDInput, state *AuthorizerState, opts ...pulumi.ResourceOption) (*Authorizer, error) {
   209  	var resource Authorizer
   210  	err := ctx.ReadResource("aws:apigateway/authorizer:Authorizer", name, id, state, &resource, opts...)
   211  	if err != nil {
   212  		return nil, err
   213  	}
   214  	return &resource, nil
   215  }
   216  
   217  // Input properties used for looking up and filtering Authorizer resources.
   218  type authorizerState struct {
   219  	// ARN of the API Gateway Authorizer
   220  	Arn *string `pulumi:"arn"`
   221  	// Credentials required for the authorizer. To specify an IAM Role for API Gateway to assume, use the IAM Role ARN.
   222  	AuthorizerCredentials *string `pulumi:"authorizerCredentials"`
   223  	// TTL of cached authorizer results in seconds. Defaults to `300`.
   224  	AuthorizerResultTtlInSeconds *int `pulumi:"authorizerResultTtlInSeconds"`
   225  	// Authorizer's Uniform Resource Identifier (URI). This must be a well-formed Lambda function URI in the form of `arn:aws:apigateway:{region}:lambda:path/{service_api}`,
   226  	// e.g., `arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:012345678912:function:my-function/invocations`
   227  	AuthorizerUri *string `pulumi:"authorizerUri"`
   228  	// Source of the identity in an incoming request. Defaults to `method.request.header.Authorization`. For `REQUEST` type, this may be a comma-separated list of values, including headers, query string parameters and stage variables - e.g., `"method.request.header.SomeHeaderName,method.request.querystring.SomeQueryStringName,stageVariables.SomeStageVariableName"`
   229  	IdentitySource *string `pulumi:"identitySource"`
   230  	// Validation expression for the incoming identity. For `TOKEN` type, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response.
   231  	IdentityValidationExpression *string `pulumi:"identityValidationExpression"`
   232  	// Name of the authorizer
   233  	Name *string `pulumi:"name"`
   234  	// List of the Amazon Cognito user pool ARNs. Each element is of this format: `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`.
   235  	ProviderArns []string `pulumi:"providerArns"`
   236  	// ID of the associated REST API
   237  	RestApi interface{} `pulumi:"restApi"`
   238  	// Type of the authorizer. Possible values are `TOKEN` for a Lambda function using a single authorization token submitted in a custom header, `REQUEST` for a Lambda function using incoming request parameters, or `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. Defaults to `TOKEN`.
   239  	Type *string `pulumi:"type"`
   240  }
   241  
   242  type AuthorizerState struct {
   243  	// ARN of the API Gateway Authorizer
   244  	Arn pulumi.StringPtrInput
   245  	// Credentials required for the authorizer. To specify an IAM Role for API Gateway to assume, use the IAM Role ARN.
   246  	AuthorizerCredentials pulumi.StringPtrInput
   247  	// TTL of cached authorizer results in seconds. Defaults to `300`.
   248  	AuthorizerResultTtlInSeconds pulumi.IntPtrInput
   249  	// Authorizer's Uniform Resource Identifier (URI). This must be a well-formed Lambda function URI in the form of `arn:aws:apigateway:{region}:lambda:path/{service_api}`,
   250  	// e.g., `arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:012345678912:function:my-function/invocations`
   251  	AuthorizerUri pulumi.StringPtrInput
   252  	// Source of the identity in an incoming request. Defaults to `method.request.header.Authorization`. For `REQUEST` type, this may be a comma-separated list of values, including headers, query string parameters and stage variables - e.g., `"method.request.header.SomeHeaderName,method.request.querystring.SomeQueryStringName,stageVariables.SomeStageVariableName"`
   253  	IdentitySource pulumi.StringPtrInput
   254  	// Validation expression for the incoming identity. For `TOKEN` type, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response.
   255  	IdentityValidationExpression pulumi.StringPtrInput
   256  	// Name of the authorizer
   257  	Name pulumi.StringPtrInput
   258  	// List of the Amazon Cognito user pool ARNs. Each element is of this format: `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`.
   259  	ProviderArns pulumi.StringArrayInput
   260  	// ID of the associated REST API
   261  	RestApi pulumi.Input
   262  	// Type of the authorizer. Possible values are `TOKEN` for a Lambda function using a single authorization token submitted in a custom header, `REQUEST` for a Lambda function using incoming request parameters, or `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. Defaults to `TOKEN`.
   263  	Type pulumi.StringPtrInput
   264  }
   265  
   266  func (AuthorizerState) ElementType() reflect.Type {
   267  	return reflect.TypeOf((*authorizerState)(nil)).Elem()
   268  }
   269  
   270  type authorizerArgs struct {
   271  	// Credentials required for the authorizer. To specify an IAM Role for API Gateway to assume, use the IAM Role ARN.
   272  	AuthorizerCredentials *string `pulumi:"authorizerCredentials"`
   273  	// TTL of cached authorizer results in seconds. Defaults to `300`.
   274  	AuthorizerResultTtlInSeconds *int `pulumi:"authorizerResultTtlInSeconds"`
   275  	// Authorizer's Uniform Resource Identifier (URI). This must be a well-formed Lambda function URI in the form of `arn:aws:apigateway:{region}:lambda:path/{service_api}`,
   276  	// e.g., `arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:012345678912:function:my-function/invocations`
   277  	AuthorizerUri *string `pulumi:"authorizerUri"`
   278  	// Source of the identity in an incoming request. Defaults to `method.request.header.Authorization`. For `REQUEST` type, this may be a comma-separated list of values, including headers, query string parameters and stage variables - e.g., `"method.request.header.SomeHeaderName,method.request.querystring.SomeQueryStringName,stageVariables.SomeStageVariableName"`
   279  	IdentitySource *string `pulumi:"identitySource"`
   280  	// Validation expression for the incoming identity. For `TOKEN` type, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response.
   281  	IdentityValidationExpression *string `pulumi:"identityValidationExpression"`
   282  	// Name of the authorizer
   283  	Name *string `pulumi:"name"`
   284  	// List of the Amazon Cognito user pool ARNs. Each element is of this format: `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`.
   285  	ProviderArns []string `pulumi:"providerArns"`
   286  	// ID of the associated REST API
   287  	RestApi interface{} `pulumi:"restApi"`
   288  	// Type of the authorizer. Possible values are `TOKEN` for a Lambda function using a single authorization token submitted in a custom header, `REQUEST` for a Lambda function using incoming request parameters, or `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. Defaults to `TOKEN`.
   289  	Type *string `pulumi:"type"`
   290  }
   291  
   292  // The set of arguments for constructing a Authorizer resource.
   293  type AuthorizerArgs struct {
   294  	// Credentials required for the authorizer. To specify an IAM Role for API Gateway to assume, use the IAM Role ARN.
   295  	AuthorizerCredentials pulumi.StringPtrInput
   296  	// TTL of cached authorizer results in seconds. Defaults to `300`.
   297  	AuthorizerResultTtlInSeconds pulumi.IntPtrInput
   298  	// Authorizer's Uniform Resource Identifier (URI). This must be a well-formed Lambda function URI in the form of `arn:aws:apigateway:{region}:lambda:path/{service_api}`,
   299  	// e.g., `arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:012345678912:function:my-function/invocations`
   300  	AuthorizerUri pulumi.StringPtrInput
   301  	// Source of the identity in an incoming request. Defaults to `method.request.header.Authorization`. For `REQUEST` type, this may be a comma-separated list of values, including headers, query string parameters and stage variables - e.g., `"method.request.header.SomeHeaderName,method.request.querystring.SomeQueryStringName,stageVariables.SomeStageVariableName"`
   302  	IdentitySource pulumi.StringPtrInput
   303  	// Validation expression for the incoming identity. For `TOKEN` type, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response.
   304  	IdentityValidationExpression pulumi.StringPtrInput
   305  	// Name of the authorizer
   306  	Name pulumi.StringPtrInput
   307  	// List of the Amazon Cognito user pool ARNs. Each element is of this format: `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`.
   308  	ProviderArns pulumi.StringArrayInput
   309  	// ID of the associated REST API
   310  	RestApi pulumi.Input
   311  	// Type of the authorizer. Possible values are `TOKEN` for a Lambda function using a single authorization token submitted in a custom header, `REQUEST` for a Lambda function using incoming request parameters, or `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. Defaults to `TOKEN`.
   312  	Type pulumi.StringPtrInput
   313  }
   314  
   315  func (AuthorizerArgs) ElementType() reflect.Type {
   316  	return reflect.TypeOf((*authorizerArgs)(nil)).Elem()
   317  }
   318  
   319  type AuthorizerInput interface {
   320  	pulumi.Input
   321  
   322  	ToAuthorizerOutput() AuthorizerOutput
   323  	ToAuthorizerOutputWithContext(ctx context.Context) AuthorizerOutput
   324  }
   325  
   326  func (*Authorizer) ElementType() reflect.Type {
   327  	return reflect.TypeOf((**Authorizer)(nil)).Elem()
   328  }
   329  
   330  func (i *Authorizer) ToAuthorizerOutput() AuthorizerOutput {
   331  	return i.ToAuthorizerOutputWithContext(context.Background())
   332  }
   333  
   334  func (i *Authorizer) ToAuthorizerOutputWithContext(ctx context.Context) AuthorizerOutput {
   335  	return pulumi.ToOutputWithContext(ctx, i).(AuthorizerOutput)
   336  }
   337  
   338  // AuthorizerArrayInput is an input type that accepts AuthorizerArray and AuthorizerArrayOutput values.
   339  // You can construct a concrete instance of `AuthorizerArrayInput` via:
   340  //
   341  //	AuthorizerArray{ AuthorizerArgs{...} }
   342  type AuthorizerArrayInput interface {
   343  	pulumi.Input
   344  
   345  	ToAuthorizerArrayOutput() AuthorizerArrayOutput
   346  	ToAuthorizerArrayOutputWithContext(context.Context) AuthorizerArrayOutput
   347  }
   348  
   349  type AuthorizerArray []AuthorizerInput
   350  
   351  func (AuthorizerArray) ElementType() reflect.Type {
   352  	return reflect.TypeOf((*[]*Authorizer)(nil)).Elem()
   353  }
   354  
   355  func (i AuthorizerArray) ToAuthorizerArrayOutput() AuthorizerArrayOutput {
   356  	return i.ToAuthorizerArrayOutputWithContext(context.Background())
   357  }
   358  
   359  func (i AuthorizerArray) ToAuthorizerArrayOutputWithContext(ctx context.Context) AuthorizerArrayOutput {
   360  	return pulumi.ToOutputWithContext(ctx, i).(AuthorizerArrayOutput)
   361  }
   362  
   363  // AuthorizerMapInput is an input type that accepts AuthorizerMap and AuthorizerMapOutput values.
   364  // You can construct a concrete instance of `AuthorizerMapInput` via:
   365  //
   366  //	AuthorizerMap{ "key": AuthorizerArgs{...} }
   367  type AuthorizerMapInput interface {
   368  	pulumi.Input
   369  
   370  	ToAuthorizerMapOutput() AuthorizerMapOutput
   371  	ToAuthorizerMapOutputWithContext(context.Context) AuthorizerMapOutput
   372  }
   373  
   374  type AuthorizerMap map[string]AuthorizerInput
   375  
   376  func (AuthorizerMap) ElementType() reflect.Type {
   377  	return reflect.TypeOf((*map[string]*Authorizer)(nil)).Elem()
   378  }
   379  
   380  func (i AuthorizerMap) ToAuthorizerMapOutput() AuthorizerMapOutput {
   381  	return i.ToAuthorizerMapOutputWithContext(context.Background())
   382  }
   383  
   384  func (i AuthorizerMap) ToAuthorizerMapOutputWithContext(ctx context.Context) AuthorizerMapOutput {
   385  	return pulumi.ToOutputWithContext(ctx, i).(AuthorizerMapOutput)
   386  }
   387  
   388  type AuthorizerOutput struct{ *pulumi.OutputState }
   389  
   390  func (AuthorizerOutput) ElementType() reflect.Type {
   391  	return reflect.TypeOf((**Authorizer)(nil)).Elem()
   392  }
   393  
   394  func (o AuthorizerOutput) ToAuthorizerOutput() AuthorizerOutput {
   395  	return o
   396  }
   397  
   398  func (o AuthorizerOutput) ToAuthorizerOutputWithContext(ctx context.Context) AuthorizerOutput {
   399  	return o
   400  }
   401  
   402  // ARN of the API Gateway Authorizer
   403  func (o AuthorizerOutput) Arn() pulumi.StringOutput {
   404  	return o.ApplyT(func(v *Authorizer) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   405  }
   406  
   407  // Credentials required for the authorizer. To specify an IAM Role for API Gateway to assume, use the IAM Role ARN.
   408  func (o AuthorizerOutput) AuthorizerCredentials() pulumi.StringPtrOutput {
   409  	return o.ApplyT(func(v *Authorizer) pulumi.StringPtrOutput { return v.AuthorizerCredentials }).(pulumi.StringPtrOutput)
   410  }
   411  
   412  // TTL of cached authorizer results in seconds. Defaults to `300`.
   413  func (o AuthorizerOutput) AuthorizerResultTtlInSeconds() pulumi.IntPtrOutput {
   414  	return o.ApplyT(func(v *Authorizer) pulumi.IntPtrOutput { return v.AuthorizerResultTtlInSeconds }).(pulumi.IntPtrOutput)
   415  }
   416  
   417  // Authorizer's Uniform Resource Identifier (URI). This must be a well-formed Lambda function URI in the form of `arn:aws:apigateway:{region}:lambda:path/{service_api}`,
   418  // e.g., `arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:012345678912:function:my-function/invocations`
   419  func (o AuthorizerOutput) AuthorizerUri() pulumi.StringPtrOutput {
   420  	return o.ApplyT(func(v *Authorizer) pulumi.StringPtrOutput { return v.AuthorizerUri }).(pulumi.StringPtrOutput)
   421  }
   422  
   423  // Source of the identity in an incoming request. Defaults to `method.request.header.Authorization`. For `REQUEST` type, this may be a comma-separated list of values, including headers, query string parameters and stage variables - e.g., `"method.request.header.SomeHeaderName,method.request.querystring.SomeQueryStringName,stageVariables.SomeStageVariableName"`
   424  func (o AuthorizerOutput) IdentitySource() pulumi.StringPtrOutput {
   425  	return o.ApplyT(func(v *Authorizer) pulumi.StringPtrOutput { return v.IdentitySource }).(pulumi.StringPtrOutput)
   426  }
   427  
   428  // Validation expression for the incoming identity. For `TOKEN` type, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response.
   429  func (o AuthorizerOutput) IdentityValidationExpression() pulumi.StringPtrOutput {
   430  	return o.ApplyT(func(v *Authorizer) pulumi.StringPtrOutput { return v.IdentityValidationExpression }).(pulumi.StringPtrOutput)
   431  }
   432  
   433  // Name of the authorizer
   434  func (o AuthorizerOutput) Name() pulumi.StringOutput {
   435  	return o.ApplyT(func(v *Authorizer) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   436  }
   437  
   438  // List of the Amazon Cognito user pool ARNs. Each element is of this format: `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`.
   439  func (o AuthorizerOutput) ProviderArns() pulumi.StringArrayOutput {
   440  	return o.ApplyT(func(v *Authorizer) pulumi.StringArrayOutput { return v.ProviderArns }).(pulumi.StringArrayOutput)
   441  }
   442  
   443  // ID of the associated REST API
   444  func (o AuthorizerOutput) RestApi() pulumi.StringOutput {
   445  	return o.ApplyT(func(v *Authorizer) pulumi.StringOutput { return v.RestApi }).(pulumi.StringOutput)
   446  }
   447  
   448  // Type of the authorizer. Possible values are `TOKEN` for a Lambda function using a single authorization token submitted in a custom header, `REQUEST` for a Lambda function using incoming request parameters, or `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. Defaults to `TOKEN`.
   449  func (o AuthorizerOutput) Type() pulumi.StringPtrOutput {
   450  	return o.ApplyT(func(v *Authorizer) pulumi.StringPtrOutput { return v.Type }).(pulumi.StringPtrOutput)
   451  }
   452  
   453  type AuthorizerArrayOutput struct{ *pulumi.OutputState }
   454  
   455  func (AuthorizerArrayOutput) ElementType() reflect.Type {
   456  	return reflect.TypeOf((*[]*Authorizer)(nil)).Elem()
   457  }
   458  
   459  func (o AuthorizerArrayOutput) ToAuthorizerArrayOutput() AuthorizerArrayOutput {
   460  	return o
   461  }
   462  
   463  func (o AuthorizerArrayOutput) ToAuthorizerArrayOutputWithContext(ctx context.Context) AuthorizerArrayOutput {
   464  	return o
   465  }
   466  
   467  func (o AuthorizerArrayOutput) Index(i pulumi.IntInput) AuthorizerOutput {
   468  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Authorizer {
   469  		return vs[0].([]*Authorizer)[vs[1].(int)]
   470  	}).(AuthorizerOutput)
   471  }
   472  
   473  type AuthorizerMapOutput struct{ *pulumi.OutputState }
   474  
   475  func (AuthorizerMapOutput) ElementType() reflect.Type {
   476  	return reflect.TypeOf((*map[string]*Authorizer)(nil)).Elem()
   477  }
   478  
   479  func (o AuthorizerMapOutput) ToAuthorizerMapOutput() AuthorizerMapOutput {
   480  	return o
   481  }
   482  
   483  func (o AuthorizerMapOutput) ToAuthorizerMapOutputWithContext(ctx context.Context) AuthorizerMapOutput {
   484  	return o
   485  }
   486  
   487  func (o AuthorizerMapOutput) MapIndex(k pulumi.StringInput) AuthorizerOutput {
   488  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Authorizer {
   489  		return vs[0].(map[string]*Authorizer)[vs[1].(string)]
   490  	}).(AuthorizerOutput)
   491  }
   492  
   493  func init() {
   494  	pulumi.RegisterInputType(reflect.TypeOf((*AuthorizerInput)(nil)).Elem(), &Authorizer{})
   495  	pulumi.RegisterInputType(reflect.TypeOf((*AuthorizerArrayInput)(nil)).Elem(), AuthorizerArray{})
   496  	pulumi.RegisterInputType(reflect.TypeOf((*AuthorizerMapInput)(nil)).Elem(), AuthorizerMap{})
   497  	pulumi.RegisterOutputType(AuthorizerOutput{})
   498  	pulumi.RegisterOutputType(AuthorizerArrayOutput{})
   499  	pulumi.RegisterOutputType(AuthorizerMapOutput{})
   500  }