github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/apigatewayv2/api.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 API.
    16  //
    17  // > **Note:** Amazon API Gateway Version 2 resources are used for creating and deploying WebSocket and HTTP APIs. To create and deploy REST APIs, use Amazon API Gateway Version 1 resources.
    18  //
    19  // ## Example Usage
    20  //
    21  // ### Basic WebSocket API
    22  //
    23  // <!--Start PulumiCodeChooser -->
    24  // ```go
    25  // package main
    26  //
    27  // import (
    28  //
    29  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2"
    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 := apigatewayv2.NewApi(ctx, "example", &apigatewayv2.ApiArgs{
    37  //				Name:                     pulumi.String("example-websocket-api"),
    38  //				ProtocolType:             pulumi.String("WEBSOCKET"),
    39  //				RouteSelectionExpression: pulumi.String("$request.body.action"),
    40  //			})
    41  //			if err != nil {
    42  //				return err
    43  //			}
    44  //			return nil
    45  //		})
    46  //	}
    47  //
    48  // ```
    49  // <!--End PulumiCodeChooser -->
    50  //
    51  // ### Basic HTTP API
    52  //
    53  // <!--Start PulumiCodeChooser -->
    54  // ```go
    55  // package main
    56  //
    57  // import (
    58  //
    59  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2"
    60  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    61  //
    62  // )
    63  //
    64  //	func main() {
    65  //		pulumi.Run(func(ctx *pulumi.Context) error {
    66  //			_, err := apigatewayv2.NewApi(ctx, "example", &apigatewayv2.ApiArgs{
    67  //				Name:         pulumi.String("example-http-api"),
    68  //				ProtocolType: pulumi.String("HTTP"),
    69  //			})
    70  //			if err != nil {
    71  //				return err
    72  //			}
    73  //			return nil
    74  //		})
    75  //	}
    76  //
    77  // ```
    78  // <!--End PulumiCodeChooser -->
    79  //
    80  // ## Import
    81  //
    82  // Using `pulumi import`, import `aws_apigatewayv2_api` using the API identifier. For example:
    83  //
    84  // ```sh
    85  // $ pulumi import aws:apigatewayv2/api:Api example aabbccddee
    86  // ```
    87  type Api struct {
    88  	pulumi.CustomResourceState
    89  
    90  	// URI of the API, of the form `https://{api-id}.execute-api.{region}.amazonaws.com` for HTTP APIs and `wss://{api-id}.execute-api.{region}.amazonaws.com` for WebSocket APIs.
    91  	ApiEndpoint pulumi.StringOutput `pulumi:"apiEndpoint"`
    92  	// An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions).
    93  	// Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`.
    94  	// Applicable for WebSocket APIs.
    95  	ApiKeySelectionExpression pulumi.StringPtrOutput `pulumi:"apiKeySelectionExpression"`
    96  	// ARN of the API.
    97  	Arn pulumi.StringOutput `pulumi:"arn"`
    98  	// An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
    99  	Body pulumi.StringPtrOutput `pulumi:"body"`
   100  	// Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs.
   101  	CorsConfiguration ApiCorsConfigurationPtrOutput `pulumi:"corsConfiguration"`
   102  	// Part of _quick create_. Specifies any credentials required for the integration. Applicable for HTTP APIs.
   103  	CredentialsArn pulumi.StringPtrOutput `pulumi:"credentialsArn"`
   104  	// Description of the API. Must be less than or equal to 1024 characters in length.
   105  	Description pulumi.StringPtrOutput `pulumi:"description"`
   106  	// Whether clients can invoke the API by using the default `execute-api` endpoint.
   107  	// By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`.
   108  	// To require that clients use a custom domain name to invoke the API, disable the default endpoint.
   109  	DisableExecuteApiEndpoint pulumi.BoolPtrOutput `pulumi:"disableExecuteApiEndpoint"`
   110  	// ARN prefix to be used in an `lambda.Permission`'s `sourceArn` attribute
   111  	// or in an `iam.Policy` to authorize access to the [`@connections` API](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html).
   112  	// See the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-control-access-iam.html) for details.
   113  	ExecutionArn pulumi.StringOutput `pulumi:"executionArn"`
   114  	// Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs.
   115  	FailOnWarnings pulumi.BoolPtrOutput `pulumi:"failOnWarnings"`
   116  	// Name of the API. Must be less than or equal to 128 characters in length.
   117  	Name pulumi.StringOutput `pulumi:"name"`
   118  	// API protocol. Valid values: `HTTP`, `WEBSOCKET`.
   119  	ProtocolType pulumi.StringOutput `pulumi:"protocolType"`
   120  	// Part of _quick create_. Specifies any [route key](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html). Applicable for HTTP APIs.
   121  	RouteKey pulumi.StringPtrOutput `pulumi:"routeKey"`
   122  	// The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API.
   123  	// Defaults to `$request.method $request.path`.
   124  	RouteSelectionExpression pulumi.StringPtrOutput `pulumi:"routeSelectionExpression"`
   125  	// Map of tags to assign to the API. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   126  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   127  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   128  	//
   129  	// Deprecated: Please use `tags` instead.
   130  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   131  	// Part of _quick create_. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes.
   132  	// For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN.
   133  	// The type of the integration will be `HTTP_PROXY` or `AWS_PROXY`, respectively. Applicable for HTTP APIs.
   134  	Target pulumi.StringPtrOutput `pulumi:"target"`
   135  	// Version identifier for the API. Must be between 1 and 64 characters in length.
   136  	Version pulumi.StringPtrOutput `pulumi:"version"`
   137  }
   138  
   139  // NewApi registers a new resource with the given unique name, arguments, and options.
   140  func NewApi(ctx *pulumi.Context,
   141  	name string, args *ApiArgs, opts ...pulumi.ResourceOption) (*Api, error) {
   142  	if args == nil {
   143  		return nil, errors.New("missing one or more required arguments")
   144  	}
   145  
   146  	if args.ProtocolType == nil {
   147  		return nil, errors.New("invalid value for required argument 'ProtocolType'")
   148  	}
   149  	opts = internal.PkgResourceDefaultOpts(opts)
   150  	var resource Api
   151  	err := ctx.RegisterResource("aws:apigatewayv2/api:Api", name, args, &resource, opts...)
   152  	if err != nil {
   153  		return nil, err
   154  	}
   155  	return &resource, nil
   156  }
   157  
   158  // GetApi gets an existing Api resource's state with the given name, ID, and optional
   159  // state properties that are used to uniquely qualify the lookup (nil if not required).
   160  func GetApi(ctx *pulumi.Context,
   161  	name string, id pulumi.IDInput, state *ApiState, opts ...pulumi.ResourceOption) (*Api, error) {
   162  	var resource Api
   163  	err := ctx.ReadResource("aws:apigatewayv2/api:Api", name, id, state, &resource, opts...)
   164  	if err != nil {
   165  		return nil, err
   166  	}
   167  	return &resource, nil
   168  }
   169  
   170  // Input properties used for looking up and filtering Api resources.
   171  type apiState struct {
   172  	// URI of the API, of the form `https://{api-id}.execute-api.{region}.amazonaws.com` for HTTP APIs and `wss://{api-id}.execute-api.{region}.amazonaws.com` for WebSocket APIs.
   173  	ApiEndpoint *string `pulumi:"apiEndpoint"`
   174  	// An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions).
   175  	// Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`.
   176  	// Applicable for WebSocket APIs.
   177  	ApiKeySelectionExpression *string `pulumi:"apiKeySelectionExpression"`
   178  	// ARN of the API.
   179  	Arn *string `pulumi:"arn"`
   180  	// An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
   181  	Body *string `pulumi:"body"`
   182  	// Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs.
   183  	CorsConfiguration *ApiCorsConfiguration `pulumi:"corsConfiguration"`
   184  	// Part of _quick create_. Specifies any credentials required for the integration. Applicable for HTTP APIs.
   185  	CredentialsArn *string `pulumi:"credentialsArn"`
   186  	// Description of the API. Must be less than or equal to 1024 characters in length.
   187  	Description *string `pulumi:"description"`
   188  	// Whether clients can invoke the API by using the default `execute-api` endpoint.
   189  	// By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`.
   190  	// To require that clients use a custom domain name to invoke the API, disable the default endpoint.
   191  	DisableExecuteApiEndpoint *bool `pulumi:"disableExecuteApiEndpoint"`
   192  	// ARN prefix to be used in an `lambda.Permission`'s `sourceArn` attribute
   193  	// or in an `iam.Policy` to authorize access to the [`@connections` API](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html).
   194  	// See the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-control-access-iam.html) for details.
   195  	ExecutionArn *string `pulumi:"executionArn"`
   196  	// Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs.
   197  	FailOnWarnings *bool `pulumi:"failOnWarnings"`
   198  	// Name of the API. Must be less than or equal to 128 characters in length.
   199  	Name *string `pulumi:"name"`
   200  	// API protocol. Valid values: `HTTP`, `WEBSOCKET`.
   201  	ProtocolType *string `pulumi:"protocolType"`
   202  	// Part of _quick create_. Specifies any [route key](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html). Applicable for HTTP APIs.
   203  	RouteKey *string `pulumi:"routeKey"`
   204  	// The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API.
   205  	// Defaults to `$request.method $request.path`.
   206  	RouteSelectionExpression *string `pulumi:"routeSelectionExpression"`
   207  	// Map of tags to assign to the API. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   208  	Tags map[string]string `pulumi:"tags"`
   209  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   210  	//
   211  	// Deprecated: Please use `tags` instead.
   212  	TagsAll map[string]string `pulumi:"tagsAll"`
   213  	// Part of _quick create_. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes.
   214  	// For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN.
   215  	// The type of the integration will be `HTTP_PROXY` or `AWS_PROXY`, respectively. Applicable for HTTP APIs.
   216  	Target *string `pulumi:"target"`
   217  	// Version identifier for the API. Must be between 1 and 64 characters in length.
   218  	Version *string `pulumi:"version"`
   219  }
   220  
   221  type ApiState struct {
   222  	// URI of the API, of the form `https://{api-id}.execute-api.{region}.amazonaws.com` for HTTP APIs and `wss://{api-id}.execute-api.{region}.amazonaws.com` for WebSocket APIs.
   223  	ApiEndpoint pulumi.StringPtrInput
   224  	// An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions).
   225  	// Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`.
   226  	// Applicable for WebSocket APIs.
   227  	ApiKeySelectionExpression pulumi.StringPtrInput
   228  	// ARN of the API.
   229  	Arn pulumi.StringPtrInput
   230  	// An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
   231  	Body pulumi.StringPtrInput
   232  	// Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs.
   233  	CorsConfiguration ApiCorsConfigurationPtrInput
   234  	// Part of _quick create_. Specifies any credentials required for the integration. Applicable for HTTP APIs.
   235  	CredentialsArn pulumi.StringPtrInput
   236  	// Description of the API. Must be less than or equal to 1024 characters in length.
   237  	Description pulumi.StringPtrInput
   238  	// Whether clients can invoke the API by using the default `execute-api` endpoint.
   239  	// By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`.
   240  	// To require that clients use a custom domain name to invoke the API, disable the default endpoint.
   241  	DisableExecuteApiEndpoint pulumi.BoolPtrInput
   242  	// ARN prefix to be used in an `lambda.Permission`'s `sourceArn` attribute
   243  	// or in an `iam.Policy` to authorize access to the [`@connections` API](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html).
   244  	// See the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-control-access-iam.html) for details.
   245  	ExecutionArn pulumi.StringPtrInput
   246  	// Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs.
   247  	FailOnWarnings pulumi.BoolPtrInput
   248  	// Name of the API. Must be less than or equal to 128 characters in length.
   249  	Name pulumi.StringPtrInput
   250  	// API protocol. Valid values: `HTTP`, `WEBSOCKET`.
   251  	ProtocolType pulumi.StringPtrInput
   252  	// Part of _quick create_. Specifies any [route key](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html). Applicable for HTTP APIs.
   253  	RouteKey pulumi.StringPtrInput
   254  	// The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API.
   255  	// Defaults to `$request.method $request.path`.
   256  	RouteSelectionExpression pulumi.StringPtrInput
   257  	// Map of tags to assign to the API. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   258  	Tags pulumi.StringMapInput
   259  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   260  	//
   261  	// Deprecated: Please use `tags` instead.
   262  	TagsAll pulumi.StringMapInput
   263  	// Part of _quick create_. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes.
   264  	// For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN.
   265  	// The type of the integration will be `HTTP_PROXY` or `AWS_PROXY`, respectively. Applicable for HTTP APIs.
   266  	Target pulumi.StringPtrInput
   267  	// Version identifier for the API. Must be between 1 and 64 characters in length.
   268  	Version pulumi.StringPtrInput
   269  }
   270  
   271  func (ApiState) ElementType() reflect.Type {
   272  	return reflect.TypeOf((*apiState)(nil)).Elem()
   273  }
   274  
   275  type apiArgs struct {
   276  	// An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions).
   277  	// Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`.
   278  	// Applicable for WebSocket APIs.
   279  	ApiKeySelectionExpression *string `pulumi:"apiKeySelectionExpression"`
   280  	// An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
   281  	Body *string `pulumi:"body"`
   282  	// Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs.
   283  	CorsConfiguration *ApiCorsConfiguration `pulumi:"corsConfiguration"`
   284  	// Part of _quick create_. Specifies any credentials required for the integration. Applicable for HTTP APIs.
   285  	CredentialsArn *string `pulumi:"credentialsArn"`
   286  	// Description of the API. Must be less than or equal to 1024 characters in length.
   287  	Description *string `pulumi:"description"`
   288  	// Whether clients can invoke the API by using the default `execute-api` endpoint.
   289  	// By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`.
   290  	// To require that clients use a custom domain name to invoke the API, disable the default endpoint.
   291  	DisableExecuteApiEndpoint *bool `pulumi:"disableExecuteApiEndpoint"`
   292  	// Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs.
   293  	FailOnWarnings *bool `pulumi:"failOnWarnings"`
   294  	// Name of the API. Must be less than or equal to 128 characters in length.
   295  	Name *string `pulumi:"name"`
   296  	// API protocol. Valid values: `HTTP`, `WEBSOCKET`.
   297  	ProtocolType string `pulumi:"protocolType"`
   298  	// Part of _quick create_. Specifies any [route key](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html). Applicable for HTTP APIs.
   299  	RouteKey *string `pulumi:"routeKey"`
   300  	// The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API.
   301  	// Defaults to `$request.method $request.path`.
   302  	RouteSelectionExpression *string `pulumi:"routeSelectionExpression"`
   303  	// Map of tags to assign to the API. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   304  	Tags map[string]string `pulumi:"tags"`
   305  	// Part of _quick create_. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes.
   306  	// For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN.
   307  	// The type of the integration will be `HTTP_PROXY` or `AWS_PROXY`, respectively. Applicable for HTTP APIs.
   308  	Target *string `pulumi:"target"`
   309  	// Version identifier for the API. Must be between 1 and 64 characters in length.
   310  	Version *string `pulumi:"version"`
   311  }
   312  
   313  // The set of arguments for constructing a Api resource.
   314  type ApiArgs struct {
   315  	// An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions).
   316  	// Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`.
   317  	// Applicable for WebSocket APIs.
   318  	ApiKeySelectionExpression pulumi.StringPtrInput
   319  	// An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
   320  	Body pulumi.StringPtrInput
   321  	// Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs.
   322  	CorsConfiguration ApiCorsConfigurationPtrInput
   323  	// Part of _quick create_. Specifies any credentials required for the integration. Applicable for HTTP APIs.
   324  	CredentialsArn pulumi.StringPtrInput
   325  	// Description of the API. Must be less than or equal to 1024 characters in length.
   326  	Description pulumi.StringPtrInput
   327  	// Whether clients can invoke the API by using the default `execute-api` endpoint.
   328  	// By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`.
   329  	// To require that clients use a custom domain name to invoke the API, disable the default endpoint.
   330  	DisableExecuteApiEndpoint pulumi.BoolPtrInput
   331  	// Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs.
   332  	FailOnWarnings pulumi.BoolPtrInput
   333  	// Name of the API. Must be less than or equal to 128 characters in length.
   334  	Name pulumi.StringPtrInput
   335  	// API protocol. Valid values: `HTTP`, `WEBSOCKET`.
   336  	ProtocolType pulumi.StringInput
   337  	// Part of _quick create_. Specifies any [route key](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html). Applicable for HTTP APIs.
   338  	RouteKey pulumi.StringPtrInput
   339  	// The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API.
   340  	// Defaults to `$request.method $request.path`.
   341  	RouteSelectionExpression pulumi.StringPtrInput
   342  	// Map of tags to assign to the API. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   343  	Tags pulumi.StringMapInput
   344  	// Part of _quick create_. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes.
   345  	// For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN.
   346  	// The type of the integration will be `HTTP_PROXY` or `AWS_PROXY`, respectively. Applicable for HTTP APIs.
   347  	Target pulumi.StringPtrInput
   348  	// Version identifier for the API. Must be between 1 and 64 characters in length.
   349  	Version pulumi.StringPtrInput
   350  }
   351  
   352  func (ApiArgs) ElementType() reflect.Type {
   353  	return reflect.TypeOf((*apiArgs)(nil)).Elem()
   354  }
   355  
   356  type ApiInput interface {
   357  	pulumi.Input
   358  
   359  	ToApiOutput() ApiOutput
   360  	ToApiOutputWithContext(ctx context.Context) ApiOutput
   361  }
   362  
   363  func (*Api) ElementType() reflect.Type {
   364  	return reflect.TypeOf((**Api)(nil)).Elem()
   365  }
   366  
   367  func (i *Api) ToApiOutput() ApiOutput {
   368  	return i.ToApiOutputWithContext(context.Background())
   369  }
   370  
   371  func (i *Api) ToApiOutputWithContext(ctx context.Context) ApiOutput {
   372  	return pulumi.ToOutputWithContext(ctx, i).(ApiOutput)
   373  }
   374  
   375  // ApiArrayInput is an input type that accepts ApiArray and ApiArrayOutput values.
   376  // You can construct a concrete instance of `ApiArrayInput` via:
   377  //
   378  //	ApiArray{ ApiArgs{...} }
   379  type ApiArrayInput interface {
   380  	pulumi.Input
   381  
   382  	ToApiArrayOutput() ApiArrayOutput
   383  	ToApiArrayOutputWithContext(context.Context) ApiArrayOutput
   384  }
   385  
   386  type ApiArray []ApiInput
   387  
   388  func (ApiArray) ElementType() reflect.Type {
   389  	return reflect.TypeOf((*[]*Api)(nil)).Elem()
   390  }
   391  
   392  func (i ApiArray) ToApiArrayOutput() ApiArrayOutput {
   393  	return i.ToApiArrayOutputWithContext(context.Background())
   394  }
   395  
   396  func (i ApiArray) ToApiArrayOutputWithContext(ctx context.Context) ApiArrayOutput {
   397  	return pulumi.ToOutputWithContext(ctx, i).(ApiArrayOutput)
   398  }
   399  
   400  // ApiMapInput is an input type that accepts ApiMap and ApiMapOutput values.
   401  // You can construct a concrete instance of `ApiMapInput` via:
   402  //
   403  //	ApiMap{ "key": ApiArgs{...} }
   404  type ApiMapInput interface {
   405  	pulumi.Input
   406  
   407  	ToApiMapOutput() ApiMapOutput
   408  	ToApiMapOutputWithContext(context.Context) ApiMapOutput
   409  }
   410  
   411  type ApiMap map[string]ApiInput
   412  
   413  func (ApiMap) ElementType() reflect.Type {
   414  	return reflect.TypeOf((*map[string]*Api)(nil)).Elem()
   415  }
   416  
   417  func (i ApiMap) ToApiMapOutput() ApiMapOutput {
   418  	return i.ToApiMapOutputWithContext(context.Background())
   419  }
   420  
   421  func (i ApiMap) ToApiMapOutputWithContext(ctx context.Context) ApiMapOutput {
   422  	return pulumi.ToOutputWithContext(ctx, i).(ApiMapOutput)
   423  }
   424  
   425  type ApiOutput struct{ *pulumi.OutputState }
   426  
   427  func (ApiOutput) ElementType() reflect.Type {
   428  	return reflect.TypeOf((**Api)(nil)).Elem()
   429  }
   430  
   431  func (o ApiOutput) ToApiOutput() ApiOutput {
   432  	return o
   433  }
   434  
   435  func (o ApiOutput) ToApiOutputWithContext(ctx context.Context) ApiOutput {
   436  	return o
   437  }
   438  
   439  // URI of the API, of the form `https://{api-id}.execute-api.{region}.amazonaws.com` for HTTP APIs and `wss://{api-id}.execute-api.{region}.amazonaws.com` for WebSocket APIs.
   440  func (o ApiOutput) ApiEndpoint() pulumi.StringOutput {
   441  	return o.ApplyT(func(v *Api) pulumi.StringOutput { return v.ApiEndpoint }).(pulumi.StringOutput)
   442  }
   443  
   444  // An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions).
   445  // Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`.
   446  // Applicable for WebSocket APIs.
   447  func (o ApiOutput) ApiKeySelectionExpression() pulumi.StringPtrOutput {
   448  	return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.ApiKeySelectionExpression }).(pulumi.StringPtrOutput)
   449  }
   450  
   451  // ARN of the API.
   452  func (o ApiOutput) Arn() pulumi.StringOutput {
   453  	return o.ApplyT(func(v *Api) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   454  }
   455  
   456  // An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
   457  func (o ApiOutput) Body() pulumi.StringPtrOutput {
   458  	return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.Body }).(pulumi.StringPtrOutput)
   459  }
   460  
   461  // Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs.
   462  func (o ApiOutput) CorsConfiguration() ApiCorsConfigurationPtrOutput {
   463  	return o.ApplyT(func(v *Api) ApiCorsConfigurationPtrOutput { return v.CorsConfiguration }).(ApiCorsConfigurationPtrOutput)
   464  }
   465  
   466  // Part of _quick create_. Specifies any credentials required for the integration. Applicable for HTTP APIs.
   467  func (o ApiOutput) CredentialsArn() pulumi.StringPtrOutput {
   468  	return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.CredentialsArn }).(pulumi.StringPtrOutput)
   469  }
   470  
   471  // Description of the API. Must be less than or equal to 1024 characters in length.
   472  func (o ApiOutput) Description() pulumi.StringPtrOutput {
   473  	return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   474  }
   475  
   476  // Whether clients can invoke the API by using the default `execute-api` endpoint.
   477  // By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`.
   478  // To require that clients use a custom domain name to invoke the API, disable the default endpoint.
   479  func (o ApiOutput) DisableExecuteApiEndpoint() pulumi.BoolPtrOutput {
   480  	return o.ApplyT(func(v *Api) pulumi.BoolPtrOutput { return v.DisableExecuteApiEndpoint }).(pulumi.BoolPtrOutput)
   481  }
   482  
   483  // ARN prefix to be used in an `lambda.Permission`'s `sourceArn` attribute
   484  // or in an `iam.Policy` to authorize access to the [`@connections` API](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html).
   485  // See the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-control-access-iam.html) for details.
   486  func (o ApiOutput) ExecutionArn() pulumi.StringOutput {
   487  	return o.ApplyT(func(v *Api) pulumi.StringOutput { return v.ExecutionArn }).(pulumi.StringOutput)
   488  }
   489  
   490  // Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs.
   491  func (o ApiOutput) FailOnWarnings() pulumi.BoolPtrOutput {
   492  	return o.ApplyT(func(v *Api) pulumi.BoolPtrOutput { return v.FailOnWarnings }).(pulumi.BoolPtrOutput)
   493  }
   494  
   495  // Name of the API. Must be less than or equal to 128 characters in length.
   496  func (o ApiOutput) Name() pulumi.StringOutput {
   497  	return o.ApplyT(func(v *Api) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   498  }
   499  
   500  // API protocol. Valid values: `HTTP`, `WEBSOCKET`.
   501  func (o ApiOutput) ProtocolType() pulumi.StringOutput {
   502  	return o.ApplyT(func(v *Api) pulumi.StringOutput { return v.ProtocolType }).(pulumi.StringOutput)
   503  }
   504  
   505  // Part of _quick create_. Specifies any [route key](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html). Applicable for HTTP APIs.
   506  func (o ApiOutput) RouteKey() pulumi.StringPtrOutput {
   507  	return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.RouteKey }).(pulumi.StringPtrOutput)
   508  }
   509  
   510  // The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API.
   511  // Defaults to `$request.method $request.path`.
   512  func (o ApiOutput) RouteSelectionExpression() pulumi.StringPtrOutput {
   513  	return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.RouteSelectionExpression }).(pulumi.StringPtrOutput)
   514  }
   515  
   516  // Map of tags to assign to the API. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   517  func (o ApiOutput) Tags() pulumi.StringMapOutput {
   518  	return o.ApplyT(func(v *Api) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   519  }
   520  
   521  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   522  //
   523  // Deprecated: Please use `tags` instead.
   524  func (o ApiOutput) TagsAll() pulumi.StringMapOutput {
   525  	return o.ApplyT(func(v *Api) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   526  }
   527  
   528  // Part of _quick create_. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes.
   529  // For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN.
   530  // The type of the integration will be `HTTP_PROXY` or `AWS_PROXY`, respectively. Applicable for HTTP APIs.
   531  func (o ApiOutput) Target() pulumi.StringPtrOutput {
   532  	return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.Target }).(pulumi.StringPtrOutput)
   533  }
   534  
   535  // Version identifier for the API. Must be between 1 and 64 characters in length.
   536  func (o ApiOutput) Version() pulumi.StringPtrOutput {
   537  	return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.Version }).(pulumi.StringPtrOutput)
   538  }
   539  
   540  type ApiArrayOutput struct{ *pulumi.OutputState }
   541  
   542  func (ApiArrayOutput) ElementType() reflect.Type {
   543  	return reflect.TypeOf((*[]*Api)(nil)).Elem()
   544  }
   545  
   546  func (o ApiArrayOutput) ToApiArrayOutput() ApiArrayOutput {
   547  	return o
   548  }
   549  
   550  func (o ApiArrayOutput) ToApiArrayOutputWithContext(ctx context.Context) ApiArrayOutput {
   551  	return o
   552  }
   553  
   554  func (o ApiArrayOutput) Index(i pulumi.IntInput) ApiOutput {
   555  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Api {
   556  		return vs[0].([]*Api)[vs[1].(int)]
   557  	}).(ApiOutput)
   558  }
   559  
   560  type ApiMapOutput struct{ *pulumi.OutputState }
   561  
   562  func (ApiMapOutput) ElementType() reflect.Type {
   563  	return reflect.TypeOf((*map[string]*Api)(nil)).Elem()
   564  }
   565  
   566  func (o ApiMapOutput) ToApiMapOutput() ApiMapOutput {
   567  	return o
   568  }
   569  
   570  func (o ApiMapOutput) ToApiMapOutputWithContext(ctx context.Context) ApiMapOutput {
   571  	return o
   572  }
   573  
   574  func (o ApiMapOutput) MapIndex(k pulumi.StringInput) ApiOutput {
   575  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Api {
   576  		return vs[0].(map[string]*Api)[vs[1].(string)]
   577  	}).(ApiOutput)
   578  }
   579  
   580  func init() {
   581  	pulumi.RegisterInputType(reflect.TypeOf((*ApiInput)(nil)).Elem(), &Api{})
   582  	pulumi.RegisterInputType(reflect.TypeOf((*ApiArrayInput)(nil)).Elem(), ApiArray{})
   583  	pulumi.RegisterInputType(reflect.TypeOf((*ApiMapInput)(nil)).Elem(), ApiMap{})
   584  	pulumi.RegisterOutputType(ApiOutput{})
   585  	pulumi.RegisterOutputType(ApiArrayOutput{})
   586  	pulumi.RegisterOutputType(ApiMapOutput{})
   587  }