Class HttpApi
(experimental) Create a new API Gateway HTTP API endpoint.
Inherited Members
Namespace: Amazon.CDK.AWS.APIGatewayv2
Assembly: Amazon.CDK.AWS.APIGatewayv2.dll
Syntax (csharp)
public class HttpApi : Resource, IHttpApi, IApi, IResource, IConstruct, IDependable
Syntax (vb)
Public Class HttpApi
Inherits Resource
Implements IHttpApi, IApi, IResource, IConstruct, IDependable
Remarks
Stability: Experimental
Resource: AWS::ApiGatewayV2::Api
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.APIGatewayv2.Integrations;
Function booksDefaultFn;
var booksIntegration = new HttpLambdaIntegration("BooksIntegration", booksDefaultFn);
var httpApi = new HttpApi(this, "HttpApi");
httpApi.AddRoutes(new AddRoutesOptions {
Path = "/books",
Methods = new [] { HttpMethod.GET },
Integration = booksIntegration
});
Synopsis
Constructors
HttpApi(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
HttpApi(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
HttpApi(Construct, String, IHttpApiProps) |
Properties
ApiEndpoint | (experimental) Get the default endpoint for this API. |
ApiId | (experimental) The identifier of this API Gateway API. |
DefaultStage | (experimental) The default stage of this API. |
DisableExecuteApiEndpoint | (experimental) Specifies whether clients can invoke this HTTP API by using the default execute-api endpoint. |
HttpApiId | (experimental) The identifier of this API Gateway HTTP API. |
HttpApiName | (experimental) A human friendly name for this HTTP API. |
Url | (experimental) Get the URL to the default stage of this API. |
Methods
AddRoutes(IAddRoutesOptions) | (experimental) Add multiple routes that uses the same configuration. |
AddStage(String, IHttpStageOptions) | (experimental) Add a new stage. |
AddVpcLink(IVpcLinkProps) | (experimental) Add a new VpcLink. |
FromHttpApiAttributes(Construct, String, IHttpApiAttributes) | (experimental) Import an existing HTTP API into this CDK app. |
Metric(String, IMetricOptions) | (experimental) Return the given named metric for this Api Gateway. |
MetricClientError(IMetricOptions) | (experimental) Metric for the number of client-side errors captured in a given period. |
MetricCount(IMetricOptions) | (experimental) Metric for the total number API requests in a given period. |
MetricDataProcessed(IMetricOptions) | (experimental) Metric for the amount of data processed in bytes. |
MetricIntegrationLatency(IMetricOptions) | (experimental) Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend. |
MetricLatency(IMetricOptions) | (experimental) The time between when API Gateway receives a request from a client and when it returns a response to the client. |
MetricServerError(IMetricOptions) | (experimental) Metric for the number of server-side errors captured in a given period. |
Constructors
HttpApi(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected HttpApi(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
HttpApi(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected HttpApi(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
HttpApi(Construct, String, IHttpApiProps)
public HttpApi(Construct scope, string id, IHttpApiProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IHttpApiProps
Remarks
Stability: Experimental
Properties
ApiEndpoint
(experimental) Get the default endpoint for this API.
public virtual string ApiEndpoint { get; }
Property Value
System.String
Remarks
Stability: Experimental
ApiId
(experimental) The identifier of this API Gateway API.
public virtual string ApiId { get; }
Property Value
System.String
Remarks
Stability: Experimental
DefaultStage
(experimental) The default stage of this API.
public virtual IHttpStage DefaultStage { get; }
Property Value
Remarks
Stability: Experimental
DisableExecuteApiEndpoint
(experimental) Specifies whether clients can invoke this HTTP API by using the default execute-api endpoint.
public virtual Nullable<bool> DisableExecuteApiEndpoint { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Stability: Experimental
HttpApiId
(experimental) The identifier of this API Gateway HTTP API.
public virtual string HttpApiId { get; }
Property Value
System.String
Remarks
Stability: Experimental
HttpApiName
(experimental) A human friendly name for this HTTP API.
public virtual string HttpApiName { get; }
Property Value
System.String
Remarks
Note that this is different from httpApiId
.
Stability: Experimental
Url
(experimental) Get the URL to the default stage of this API.
public virtual string Url { get; }
Property Value
System.String
Remarks
Returns undefined
if createDefaultStage
is unset.
Stability: Experimental
Methods
AddRoutes(IAddRoutesOptions)
(experimental) Add multiple routes that uses the same configuration.
public virtual HttpRoute[] AddRoutes(IAddRoutesOptions options)
Parameters
- options IAddRoutesOptions
Returns
Remarks
The routes all go to the same path, but for different methods.
Stability: Experimental
AddStage(String, IHttpStageOptions)
(experimental) Add a new stage.
public virtual HttpStage AddStage(string id, IHttpStageOptions options)
Parameters
- id System.String
- options IHttpStageOptions
Returns
Remarks
Stability: Experimental
AddVpcLink(IVpcLinkProps)
(experimental) Add a new VpcLink.
public virtual VpcLink AddVpcLink(IVpcLinkProps options)
Parameters
- options IVpcLinkProps
Returns
Remarks
Stability: Experimental
FromHttpApiAttributes(Construct, String, IHttpApiAttributes)
(experimental) Import an existing HTTP API into this CDK app.
public static IHttpApi FromHttpApiAttributes(Construct scope, string id, IHttpApiAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs IHttpApiAttributes
Returns
Remarks
Stability: Experimental
Metric(String, IMetricOptions)
(experimental) Return the given named metric for this Api Gateway.
public virtual Metric Metric(string metricName, IMetricOptions props = null)
Parameters
- metricName System.String
- props IMetricOptions
Returns
Remarks
Stability: Experimental
MetricClientError(IMetricOptions)
(experimental) Metric for the number of client-side errors captured in a given period.
public virtual Metric MetricClientError(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Stability: Experimental
MetricCount(IMetricOptions)
(experimental) Metric for the total number API requests in a given period.
public virtual Metric MetricCount(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Stability: Experimental
MetricDataProcessed(IMetricOptions)
(experimental) Metric for the amount of data processed in bytes.
public virtual Metric MetricDataProcessed(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Stability: Experimental
MetricIntegrationLatency(IMetricOptions)
(experimental) Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend.
public virtual Metric MetricIntegrationLatency(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Stability: Experimental
MetricLatency(IMetricOptions)
(experimental) The time between when API Gateway receives a request from a client and when it returns a response to the client.
public virtual Metric MetricLatency(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
The latency includes the integration latency and other API Gateway overhead.
Stability: Experimental
MetricServerError(IMetricOptions)
(experimental) Metric for the number of server-side errors captured in a given period.
public virtual Metric MetricServerError(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Stability: Experimental