/
api.go
315 lines (272 loc) · 25.6 KB
/
api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apigatewayv2
import (
"context"
"reflect"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The “AWS::ApiGatewayV2::Api“ resource creates an API. WebSocket APIs and HTTP APIs are supported. For more information about WebSocket APIs, see [About WebSocket APIs in API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-overview.html) in the *API Gateway Developer Guide*. For more information about HTTP APIs, see [HTTP APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html) in the *API Gateway Developer Guide.*
type Api struct {
pulumi.CustomResourceState
ApiEndpoint pulumi.StringOutput `pulumi:"apiEndpoint"`
ApiId pulumi.StringOutput `pulumi:"apiId"`
// An API key selection expression. Supported only for WebSocket APIs. See [API Key Selection Expressions](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions).
ApiKeySelectionExpression pulumi.StringPtrOutput `pulumi:"apiKeySelectionExpression"`
// Specifies how to interpret the base path of the API during import. Valid values are ``ignore``, ``prepend``, and ``split``. The default value is ``ignore``. To learn more, see [Set the OpenAPI basePath Property](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api-basePath.html). Supported only for HTTP APIs.
BasePath pulumi.StringPtrOutput `pulumi:"basePath"`
// The OpenAPI definition. Supported only for HTTP APIs. To import an HTTP API, you must specify a ``Body`` or ``BodyS3Location``. If you specify a ``Body`` or ``BodyS3Location``, don't specify CloudFormation resources such as ``AWS::ApiGatewayV2::Authorizer`` or ``AWS::ApiGatewayV2::Route``. API Gateway doesn't support the combination of OpenAPI and CloudFormation resources.
//
// Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::ApiGatewayV2::Api` for more information about the expected schema for this property.
Body pulumi.AnyOutput `pulumi:"body"`
// The S3 location of an OpenAPI definition. Supported only for HTTP APIs. To import an HTTP API, you must specify a ``Body`` or ``BodyS3Location``. If you specify a ``Body`` or ``BodyS3Location``, don't specify CloudFormation resources such as ``AWS::ApiGatewayV2::Authorizer`` or ``AWS::ApiGatewayV2::Route``. API Gateway doesn't support the combination of OpenAPI and CloudFormation resources.
BodyS3Location ApiBodyS3LocationPtrOutput `pulumi:"bodyS3Location"`
// A CORS configuration. Supported only for HTTP APIs. See [Configuring CORS](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html) for more information.
CorsConfiguration ApiCorsPtrOutput `pulumi:"corsConfiguration"`
// This property is part of quick create. It specifies the credentials required for the integration, if any. For a Lambda integration, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify ``arn:aws:iam::*:user/*``. To use resource-based permissions on supported AWS services, specify ``null``. Currently, this property is not used for HTTP integrations. Supported only for HTTP APIs.
CredentialsArn pulumi.StringPtrOutput `pulumi:"credentialsArn"`
// The description of the API.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Specifies whether clients can invoke your API by using the default ``execute-api`` endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
DisableExecuteApiEndpoint pulumi.BoolPtrOutput `pulumi:"disableExecuteApiEndpoint"`
// Avoid validating models when creating a deployment. Supported only for WebSocket APIs.
DisableSchemaValidation pulumi.BoolPtrOutput `pulumi:"disableSchemaValidation"`
// Specifies whether to rollback the API creation when a warning is encountered. By default, API creation continues if a warning is encountered.
FailOnWarnings pulumi.BoolPtrOutput `pulumi:"failOnWarnings"`
// The name of the API. Required unless you specify an OpenAPI definition for ``Body`` or ``S3BodyLocation``.
Name pulumi.StringPtrOutput `pulumi:"name"`
// The API protocol. Valid values are ``WEBSOCKET`` or ``HTTP``. Required unless you specify an OpenAPI definition for ``Body`` or ``S3BodyLocation``.
ProtocolType pulumi.StringPtrOutput `pulumi:"protocolType"`
// This property is part of quick create. If you don't specify a ``routeKey``, a default route of ``$default`` is created. The ``$default`` route acts as a catch-all for any request made to your API, for a particular stage. The ``$default`` route key can't be modified. You can add routes after creating the API, and you can update the route keys of additional routes. Supported only for HTTP APIs.
RouteKey pulumi.StringPtrOutput `pulumi:"routeKey"`
// The route selection expression for the API. For HTTP APIs, the ``routeSelectionExpression`` must be ``${request.method} ${request.path}``. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.
RouteSelectionExpression pulumi.StringPtrOutput `pulumi:"routeSelectionExpression"`
// The collection of tags. Each tag element is associated with a given resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// This property is 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. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. Supported only for HTTP APIs.
Target pulumi.StringPtrOutput `pulumi:"target"`
// A version identifier for the API.
Version pulumi.StringPtrOutput `pulumi:"version"`
}
// NewApi registers a new resource with the given unique name, arguments, and options.
func NewApi(ctx *pulumi.Context,
name string, args *ApiArgs, opts ...pulumi.ResourceOption) (*Api, error) {
if args == nil {
args = &ApiArgs{}
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"protocolType",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Api
err := ctx.RegisterResource("aws-native:apigatewayv2:Api", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetApi gets an existing Api resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetApi(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ApiState, opts ...pulumi.ResourceOption) (*Api, error) {
var resource Api
err := ctx.ReadResource("aws-native:apigatewayv2:Api", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Api resources.
type apiState struct {
}
type ApiState struct {
}
func (ApiState) ElementType() reflect.Type {
return reflect.TypeOf((*apiState)(nil)).Elem()
}
type apiArgs struct {
// An API key selection expression. Supported only for WebSocket APIs. See [API Key Selection Expressions](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions).
ApiKeySelectionExpression *string `pulumi:"apiKeySelectionExpression"`
// Specifies how to interpret the base path of the API during import. Valid values are ``ignore``, ``prepend``, and ``split``. The default value is ``ignore``. To learn more, see [Set the OpenAPI basePath Property](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api-basePath.html). Supported only for HTTP APIs.
BasePath *string `pulumi:"basePath"`
// The OpenAPI definition. Supported only for HTTP APIs. To import an HTTP API, you must specify a ``Body`` or ``BodyS3Location``. If you specify a ``Body`` or ``BodyS3Location``, don't specify CloudFormation resources such as ``AWS::ApiGatewayV2::Authorizer`` or ``AWS::ApiGatewayV2::Route``. API Gateway doesn't support the combination of OpenAPI and CloudFormation resources.
//
// Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::ApiGatewayV2::Api` for more information about the expected schema for this property.
Body interface{} `pulumi:"body"`
// The S3 location of an OpenAPI definition. Supported only for HTTP APIs. To import an HTTP API, you must specify a ``Body`` or ``BodyS3Location``. If you specify a ``Body`` or ``BodyS3Location``, don't specify CloudFormation resources such as ``AWS::ApiGatewayV2::Authorizer`` or ``AWS::ApiGatewayV2::Route``. API Gateway doesn't support the combination of OpenAPI and CloudFormation resources.
BodyS3Location *ApiBodyS3Location `pulumi:"bodyS3Location"`
// A CORS configuration. Supported only for HTTP APIs. See [Configuring CORS](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html) for more information.
CorsConfiguration *ApiCors `pulumi:"corsConfiguration"`
// This property is part of quick create. It specifies the credentials required for the integration, if any. For a Lambda integration, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify ``arn:aws:iam::*:user/*``. To use resource-based permissions on supported AWS services, specify ``null``. Currently, this property is not used for HTTP integrations. Supported only for HTTP APIs.
CredentialsArn *string `pulumi:"credentialsArn"`
// The description of the API.
Description *string `pulumi:"description"`
// Specifies whether clients can invoke your API by using the default ``execute-api`` endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
DisableExecuteApiEndpoint *bool `pulumi:"disableExecuteApiEndpoint"`
// Avoid validating models when creating a deployment. Supported only for WebSocket APIs.
DisableSchemaValidation *bool `pulumi:"disableSchemaValidation"`
// Specifies whether to rollback the API creation when a warning is encountered. By default, API creation continues if a warning is encountered.
FailOnWarnings *bool `pulumi:"failOnWarnings"`
// The name of the API. Required unless you specify an OpenAPI definition for ``Body`` or ``S3BodyLocation``.
Name *string `pulumi:"name"`
// The API protocol. Valid values are ``WEBSOCKET`` or ``HTTP``. Required unless you specify an OpenAPI definition for ``Body`` or ``S3BodyLocation``.
ProtocolType *string `pulumi:"protocolType"`
// This property is part of quick create. If you don't specify a ``routeKey``, a default route of ``$default`` is created. The ``$default`` route acts as a catch-all for any request made to your API, for a particular stage. The ``$default`` route key can't be modified. You can add routes after creating the API, and you can update the route keys of additional routes. Supported only for HTTP APIs.
RouteKey *string `pulumi:"routeKey"`
// The route selection expression for the API. For HTTP APIs, the ``routeSelectionExpression`` must be ``${request.method} ${request.path}``. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.
RouteSelectionExpression *string `pulumi:"routeSelectionExpression"`
// The collection of tags. Each tag element is associated with a given resource.
Tags map[string]string `pulumi:"tags"`
// This property is 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. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. Supported only for HTTP APIs.
Target *string `pulumi:"target"`
// A version identifier for the API.
Version *string `pulumi:"version"`
}
// The set of arguments for constructing a Api resource.
type ApiArgs struct {
// An API key selection expression. Supported only for WebSocket APIs. See [API Key Selection Expressions](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions).
ApiKeySelectionExpression pulumi.StringPtrInput
// Specifies how to interpret the base path of the API during import. Valid values are ``ignore``, ``prepend``, and ``split``. The default value is ``ignore``. To learn more, see [Set the OpenAPI basePath Property](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api-basePath.html). Supported only for HTTP APIs.
BasePath pulumi.StringPtrInput
// The OpenAPI definition. Supported only for HTTP APIs. To import an HTTP API, you must specify a ``Body`` or ``BodyS3Location``. If you specify a ``Body`` or ``BodyS3Location``, don't specify CloudFormation resources such as ``AWS::ApiGatewayV2::Authorizer`` or ``AWS::ApiGatewayV2::Route``. API Gateway doesn't support the combination of OpenAPI and CloudFormation resources.
//
// Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::ApiGatewayV2::Api` for more information about the expected schema for this property.
Body pulumi.Input
// The S3 location of an OpenAPI definition. Supported only for HTTP APIs. To import an HTTP API, you must specify a ``Body`` or ``BodyS3Location``. If you specify a ``Body`` or ``BodyS3Location``, don't specify CloudFormation resources such as ``AWS::ApiGatewayV2::Authorizer`` or ``AWS::ApiGatewayV2::Route``. API Gateway doesn't support the combination of OpenAPI and CloudFormation resources.
BodyS3Location ApiBodyS3LocationPtrInput
// A CORS configuration. Supported only for HTTP APIs. See [Configuring CORS](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html) for more information.
CorsConfiguration ApiCorsPtrInput
// This property is part of quick create. It specifies the credentials required for the integration, if any. For a Lambda integration, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify ``arn:aws:iam::*:user/*``. To use resource-based permissions on supported AWS services, specify ``null``. Currently, this property is not used for HTTP integrations. Supported only for HTTP APIs.
CredentialsArn pulumi.StringPtrInput
// The description of the API.
Description pulumi.StringPtrInput
// Specifies whether clients can invoke your API by using the default ``execute-api`` endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
DisableExecuteApiEndpoint pulumi.BoolPtrInput
// Avoid validating models when creating a deployment. Supported only for WebSocket APIs.
DisableSchemaValidation pulumi.BoolPtrInput
// Specifies whether to rollback the API creation when a warning is encountered. By default, API creation continues if a warning is encountered.
FailOnWarnings pulumi.BoolPtrInput
// The name of the API. Required unless you specify an OpenAPI definition for ``Body`` or ``S3BodyLocation``.
Name pulumi.StringPtrInput
// The API protocol. Valid values are ``WEBSOCKET`` or ``HTTP``. Required unless you specify an OpenAPI definition for ``Body`` or ``S3BodyLocation``.
ProtocolType pulumi.StringPtrInput
// This property is part of quick create. If you don't specify a ``routeKey``, a default route of ``$default`` is created. The ``$default`` route acts as a catch-all for any request made to your API, for a particular stage. The ``$default`` route key can't be modified. You can add routes after creating the API, and you can update the route keys of additional routes. Supported only for HTTP APIs.
RouteKey pulumi.StringPtrInput
// The route selection expression for the API. For HTTP APIs, the ``routeSelectionExpression`` must be ``${request.method} ${request.path}``. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.
RouteSelectionExpression pulumi.StringPtrInput
// The collection of tags. Each tag element is associated with a given resource.
Tags pulumi.StringMapInput
// This property is 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. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. Supported only for HTTP APIs.
Target pulumi.StringPtrInput
// A version identifier for the API.
Version pulumi.StringPtrInput
}
func (ApiArgs) ElementType() reflect.Type {
return reflect.TypeOf((*apiArgs)(nil)).Elem()
}
type ApiInput interface {
pulumi.Input
ToApiOutput() ApiOutput
ToApiOutputWithContext(ctx context.Context) ApiOutput
}
func (*Api) ElementType() reflect.Type {
return reflect.TypeOf((**Api)(nil)).Elem()
}
func (i *Api) ToApiOutput() ApiOutput {
return i.ToApiOutputWithContext(context.Background())
}
func (i *Api) ToApiOutputWithContext(ctx context.Context) ApiOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApiOutput)
}
type ApiOutput struct{ *pulumi.OutputState }
func (ApiOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Api)(nil)).Elem()
}
func (o ApiOutput) ToApiOutput() ApiOutput {
return o
}
func (o ApiOutput) ToApiOutputWithContext(ctx context.Context) ApiOutput {
return o
}
func (o ApiOutput) ApiEndpoint() pulumi.StringOutput {
return o.ApplyT(func(v *Api) pulumi.StringOutput { return v.ApiEndpoint }).(pulumi.StringOutput)
}
func (o ApiOutput) ApiId() pulumi.StringOutput {
return o.ApplyT(func(v *Api) pulumi.StringOutput { return v.ApiId }).(pulumi.StringOutput)
}
// An API key selection expression. Supported only for WebSocket APIs. See [API Key Selection Expressions](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions).
func (o ApiOutput) ApiKeySelectionExpression() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.ApiKeySelectionExpression }).(pulumi.StringPtrOutput)
}
// Specifies how to interpret the base path of the API during import. Valid values are “ignore“, “prepend“, and “split“. The default value is “ignore“. To learn more, see [Set the OpenAPI basePath Property](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api-basePath.html). Supported only for HTTP APIs.
func (o ApiOutput) BasePath() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.BasePath }).(pulumi.StringPtrOutput)
}
// The OpenAPI definition. Supported only for HTTP APIs. To import an HTTP API, you must specify a “Body“ or “BodyS3Location“. If you specify a “Body“ or “BodyS3Location“, don't specify CloudFormation resources such as “AWS::ApiGatewayV2::Authorizer“ or “AWS::ApiGatewayV2::Route“. API Gateway doesn't support the combination of OpenAPI and CloudFormation resources.
//
// Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::ApiGatewayV2::Api` for more information about the expected schema for this property.
func (o ApiOutput) Body() pulumi.AnyOutput {
return o.ApplyT(func(v *Api) pulumi.AnyOutput { return v.Body }).(pulumi.AnyOutput)
}
// The S3 location of an OpenAPI definition. Supported only for HTTP APIs. To import an HTTP API, you must specify a “Body“ or “BodyS3Location“. If you specify a “Body“ or “BodyS3Location“, don't specify CloudFormation resources such as “AWS::ApiGatewayV2::Authorizer“ or “AWS::ApiGatewayV2::Route“. API Gateway doesn't support the combination of OpenAPI and CloudFormation resources.
func (o ApiOutput) BodyS3Location() ApiBodyS3LocationPtrOutput {
return o.ApplyT(func(v *Api) ApiBodyS3LocationPtrOutput { return v.BodyS3Location }).(ApiBodyS3LocationPtrOutput)
}
// A CORS configuration. Supported only for HTTP APIs. See [Configuring CORS](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html) for more information.
func (o ApiOutput) CorsConfiguration() ApiCorsPtrOutput {
return o.ApplyT(func(v *Api) ApiCorsPtrOutput { return v.CorsConfiguration }).(ApiCorsPtrOutput)
}
// This property is part of quick create. It specifies the credentials required for the integration, if any. For a Lambda integration, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify “arn:aws:iam::*:user/*“. To use resource-based permissions on supported AWS services, specify “null“. Currently, this property is not used for HTTP integrations. Supported only for HTTP APIs.
func (o ApiOutput) CredentialsArn() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.CredentialsArn }).(pulumi.StringPtrOutput)
}
// The description of the API.
func (o ApiOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Specifies whether clients can invoke your API by using the default “execute-api“ endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
func (o ApiOutput) DisableExecuteApiEndpoint() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Api) pulumi.BoolPtrOutput { return v.DisableExecuteApiEndpoint }).(pulumi.BoolPtrOutput)
}
// Avoid validating models when creating a deployment. Supported only for WebSocket APIs.
func (o ApiOutput) DisableSchemaValidation() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Api) pulumi.BoolPtrOutput { return v.DisableSchemaValidation }).(pulumi.BoolPtrOutput)
}
// Specifies whether to rollback the API creation when a warning is encountered. By default, API creation continues if a warning is encountered.
func (o ApiOutput) FailOnWarnings() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Api) pulumi.BoolPtrOutput { return v.FailOnWarnings }).(pulumi.BoolPtrOutput)
}
// The name of the API. Required unless you specify an OpenAPI definition for “Body“ or “S3BodyLocation“.
func (o ApiOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.Name }).(pulumi.StringPtrOutput)
}
// The API protocol. Valid values are “WEBSOCKET“ or “HTTP“. Required unless you specify an OpenAPI definition for “Body“ or “S3BodyLocation“.
func (o ApiOutput) ProtocolType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.ProtocolType }).(pulumi.StringPtrOutput)
}
// This property is part of quick create. If you don't specify a “routeKey“, a default route of “$default“ is created. The “$default“ route acts as a catch-all for any request made to your API, for a particular stage. The “$default“ route key can't be modified. You can add routes after creating the API, and you can update the route keys of additional routes. Supported only for HTTP APIs.
func (o ApiOutput) RouteKey() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.RouteKey }).(pulumi.StringPtrOutput)
}
// The route selection expression for the API. For HTTP APIs, the “routeSelectionExpression“ must be “${request.method} ${request.path}“. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.
func (o ApiOutput) RouteSelectionExpression() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.RouteSelectionExpression }).(pulumi.StringPtrOutput)
}
// The collection of tags. Each tag element is associated with a given resource.
func (o ApiOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *Api) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// This property is 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. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. Supported only for HTTP APIs.
func (o ApiOutput) Target() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.Target }).(pulumi.StringPtrOutput)
}
// A version identifier for the API.
func (o ApiOutput) Version() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Api) pulumi.StringPtrOutput { return v.Version }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ApiInput)(nil)).Elem(), &Api{})
pulumi.RegisterOutputType(ApiOutput{})
}