Skip to content
v2.273.0

StepFunctionsRestApi L2 construct ​

Defines an API Gateway REST API with a Synchrounous Express State Machine as a proxy integration.

Example ​

ts
declare const machine: stepfunctions.IStateMachine;

new apigateway.StepFunctionsRestApi(this, 'StepFunctionsRestApi', {
  stateMachine: machine,
  useDefaultMethodResponses: false,
});
python
# machine: stepfunctions.IStateMachine


apigateway.StepFunctionsRestApi(self, "StepFunctionsRestApi",
    state_machine=machine,
    use_default_method_responses=False
)
java
IStateMachine machine;


StepFunctionsRestApi.Builder.create(this, "StepFunctionsRestApi")
        .stateMachine(machine)
        .useDefaultMethodResponses(false)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
IStateMachine machine;


new StepFunctionsRestApi(this, "StepFunctionsRestApi", new StepFunctionsRestApiProps {
    StateMachine = machine,
    UseDefaultMethodResponses = false
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var machine IStateMachine


apigateway.NewStepFunctionsRestApi(this, jsii.String("StepFunctionsRestApi"), &StepFunctionsRestApiProps{
	StateMachine: machine,
	UseDefaultMethodResponses: jsii.Boolean(false),
})

Initializer ​

ts
new StepFunctionsRestApi(scope: Construct, id: string, props: StepFunctionsRestApiProps)
python
StepFunctionsRestApi(scope: Construct, id: str, props: StepFunctionsRestApiProps)
java
new StepFunctionsRestApi(Construct scope, String id, StepFunctionsRestApiProps props)
csharp
new StepFunctionsRestApi(Construct scope, string id, StepFunctionsRestApiProps props)
go
NewStepFunctionsRestApi(Scope Construct, Id *string, Props StepFunctionsRestApiProps)

Construct Props ​

apiKeySourceTypeApiKeySourceTypeapi_key_source_typeApiKeySourceTypeapiKeySourceTypeApiKeySourceTypeApiKeySourceTypeApiKeySourceTypeApiKeySourceTypeApiKeySourceType= Metering is disabled.#
The source of the API key for metering requests according to a usage plan.
authorizerbooleanauthorizerboolauthorizerBooleanAuthorizerboolAuthorizer*bool= false#
If the whole authorizer object, including custom context values should be in the execution input.

The execution input will include a new key authorizer:

{ "body": {}, "authorizer": { "key": "value" } }

binaryMediaTypesstring[]binary_media_typestyping.List[str]binaryMediaTypesList<String>BinaryMediaTypesstring[]BinaryMediaTypes*[]*string= RestApi supports only UTF-8-enco…#
The list of binary media mime-types that are supported by the RestApi resource, such as "image/png" or "application/octet-stream".
default

Default: RestApi supports only UTF-8-encoded text payloads.

cloneFromIRestApiclone_fromIRestApicloneFromIRestApiCloneFromIRestApiCloneFromIRestApi= None.#
The ID of the API Gateway RestApi resource that you want to clone.
cloudWatchRolebooleancloud_watch_roleboolcloudWatchRoleBooleanCloudWatchRoleboolCloudWatchRole*bool= false if `@aws-cdk/aws-apigatewa…#
Automatically configure an AWS CloudWatch role for API Gateway.
default

Default: false if @aws-cdk/aws-apigateway:disableCloudWatchRole is enabled, true otherwise

cloudWatchRoleRemovalPolicyRemovalPolicycloud_watch_role_removal_policyRemovalPolicycloudWatchRoleRemovalPolicyRemovalPolicyCloudWatchRoleRemovalPolicyRemovalPolicyCloudWatchRoleRemovalPolicyRemovalPolicy= RemovalPolicy.RETAIN#
The removal policy applied to the AWS CloudWatch role when this resource is removed from the application.

Requires cloudWatchRole to be enabled.

defaultCorsPreflightOptionsCorsOptionsdefault_cors_preflight_optionsCorsOptionsdefaultCorsPreflightOptionsCorsOptionsDefaultCorsPreflightOptionsCorsOptionsDefaultCorsPreflightOptionsCorsOptions= CORS is disabled#
Adds a CORS preflight OPTIONS method to this resource and all child resources.

You can add CORS at the resource-level using addCorsPreflight.

defaultIntegrationIntegrationdefault_integrationIntegrationdefaultIntegrationIntegrationDefaultIntegrationIntegrationDefaultIntegrationIntegration= Inherited from parent.#
An integration to use as a default for all methods created within this API unless an integration is specified.
defaultMethodOptionsMethodOptionsdefault_method_optionsMethodOptionsdefaultMethodOptionsMethodOptionsDefaultMethodOptionsMethodOptionsDefaultMethodOptionsMethodOptions= Inherited from parent.#
Method options to use as a default for all methods created within this API unless custom options are specified.
deploybooleandeploybooldeployBooleanDeployboolDeploy*bool= true#
Indicates if a Deployment should be automatically created for this API, and recreated when the API model (resources, methods) changes.
notes

Since API Gateway deployments are immutable, When this option is enabled (by default), an AWS::ApiGateway::Deployment resource will automatically created with a logical ID that hashes the API model (methods, resources and options). This means that when the model changes, the logical ID of this CloudFormation resource will change, and a new deployment will be created.

If this is set, latestDeployment will refer to the Deployment object and deploymentStage will refer to a Stage that points to this deployment. To customize the stage options, use the deployOptions property.

A CloudFormation Output will also be defined with the root URL endpoint of this REST API.

deployOptionsStageOptionsdeploy_optionsStageOptionsdeployOptionsStageOptionsDeployOptionsStageOptionsDeployOptionsStageOptions= Based on defaults of `StageOptio…#
Options for the API Gateway stage that will always point to the latest deployment when `deploy` is enabled.

If deploy is disabled, this value cannot be set.

default

Default: Based on defaults of StageOptions.

descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string= 'Automatically created by the Re…#
A description of the RestApi construct.
default

Default: 'Automatically created by the RestApi construct'

disableExecuteApiEndpointbooleandisable_execute_api_endpointbooldisableExecuteApiEndpointBooleanDisableExecuteApiEndpointboolDisableExecuteApiEndpoint*bool= false#
Specifies whether clients can invoke the API using the default execute-api endpoint.

To require that clients use a custom domain name to invoke the API, disable the default endpoint.

domainNameDomainNameOptionsdomain_nameDomainNameOptionsdomainNameDomainNameOptionsDomainNameDomainNameOptionsDomainNameDomainNameOptions= no domain name is defined, use `…#
Configure a custom domain name and map it to this API.
default

Default: no domain name is defined, use addDomainName or directly define a DomainName.

endpointConfigurationEndpointConfigurationendpoint_configurationEndpointConfigurationendpointConfigurationEndpointConfigurationEndpointConfigurationEndpointConfigurationEndpointConfigurationEndpointConfiguration= EndpointType.EDGE#
The EndpointConfiguration property type specifies the endpoint types of a REST API.
endpointExportNamestringendpoint_export_namestrendpointExportNameStringEndpointExportNamestringEndpointExportName*string= when no export name is given, ou…#
Export name for the CfnOutput containing the API endpoint.
default

Default: when no export name is given, output will be created without export

endpointTypesEndpointType[]endpoint_typestyping.List[EndpointType]endpointTypesList<EndpointType>EndpointTypesEndpointType[]EndpointTypes*[]EndpointType= EndpointType.EDGE#
A list of the endpoint types of the API.

Use this property when creating an API.

failOnWarningsbooleanfail_on_warningsboolfailOnWarningsBooleanFailOnWarningsboolFailOnWarnings*bool= false#
Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the RestApi resource.
headersbooleanheadersboolheadersBooleanHeadersboolHeaders*bool= false#
Check if header is to be included inside the execution input.

The execution input will include a new key headers:

{ "body": {}, "headers": { "header1": "value", "header2": "value" } }

minCompressionSizeSizemin_compression_sizeSizeminCompressionSizeSizeMinCompressionSizeSizeMinCompressionSizeSize= Compression is disabled.#
A Size(in bytes, kibibytes, mebibytes etc) that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API.

When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.

minimumCompressionSizenumberminimum_compression_sizeint | floatminimumCompressionSizeNumberMinimumCompressionSizedoubleMinimumCompressionSize*float64= Compression is disabled.deprecated#
- superseded by `minCompressionSize`

When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.

parameters{ [key: string]: string }parameterstyping.Mapping[str, str]parametersMap<String, String>ParametersIDictionary<string, string>Parameters*map[string]*string= No parameters.#
Custom header parameters for the request.
pathbooleanpathboolpathBooleanPathboolPath*bool= true#
Check if path is to be included inside the execution input.

The execution input will include a new key path:

{ "body": {}, "path": { "resourceName": "resourceValue" } }

A policy document that contains the permissions for this RestApi.
querystringbooleanquerystringboolquerystringBooleanQuerystringboolQuerystring*bool= true#
Check if querystring is to be included inside the execution input.

The execution input will include a new key queryString:

{ "body": {}, "querystring": { "key": "value" } }

requestContextRequestContextrequest_contextRequestContextrequestContextRequestContextRequestContextRequestContextRequestContextRequestContext= all parameters within request co…#
Which details of the incoming request must be passed onto the underlying state machine, such as, account id, user identity, request id, etc.

The execution input will include a new key requestContext:

{ "body": {}, "requestContext": { "key": "value" } }

default

Default: all parameters within request context will be set as false

restApiNamestringrest_api_namestrrestApiNameStringRestApiNamestringRestApiName*string= ID of the RestApi construct.#
A name for the API Gateway RestApi resource.
retainDeploymentsbooleanretain_deploymentsboolretainDeploymentsBooleanRetainDeploymentsboolRetainDeployments*bool= false#
Retains old deployment resources when the API changes.

This allows manually reverting stages to point to old deployments via the AWS Console.

roleIRoleroleIRoleroleIRoleRoleIRoleRoleIRole= a new role is created#
An IAM role that API Gateway will assume to start the execution of the state machine.
stateMachineIStateMachinestate_machineIStateMachinestateMachineIStateMachineStateMachineIStateMachineStateMachineIStateMachinerequired#
The default State Machine that handles all requests from this API.

This stateMachine will be used as the default integration for all methods in this API, unless specified otherwise in addMethod.

useDefaultMethodResponsesbooleanuse_default_method_responsesbooluseDefaultMethodResponsesBooleanUseDefaultMethodResponsesboolUseDefaultMethodResponses*bool= true#
Whether to add default response models with 200, 400, and 500 status codes to the method.

Properties ​

deploymentStageStagedeployment_stageStagedeploymentStageStageDeploymentStageStageDeploymentStageStagerequired#
API Gateway stage that points to the latest deployment (if defined).

If deploy is disabled, you will need to explicitly assign this value in order to set up integrations.

domainNameDomainNamedomain_nameDomainNamedomainNameDomainNameDomainNameDomainNameDomainNameDomainName#
The first domain name mapped to this API, if defined through the `domainName` configuration prop, or added via `addDomainName`.
The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

latestDeploymentDeploymentlatest_deploymentDeploymentlatestDeploymentDeploymentLatestDeploymentDeploymentLatestDeploymentDeployment#
API Gateway deployment that represents the latest changes of the API.

This resource will be automatically updated every time the REST API model changes. This will be undefined if deploy is false.

methodsMethod[]methodstyping.List[Method]methodsList<Method>MethodsMethod[]Methods*[]Methodrequired#
The list of methods bound to this RestApi.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#
Uniquely identifies this class.
restApiIdstringrest_api_idstrrestApiIdStringRestApiIdstringRestApiId*stringrequired#
The ID of this API Gateway RestApi.
restApiNamestringrest_api_namestrrestApiNameStringRestApiNamestringRestApiName*stringrequired#
A human friendly name for this Rest API.

Note that this is different from restApiId.

restApiRefRestApiReferencerest_api_refRestApiReferencerestApiRefRestApiReferenceRestApiRefRestApiReferenceRestApiRefRestApiReferencerequired#
A reference to a RestApi resource.
restApiRootResourceIdstringrest_api_root_resource_idstrrestApiRootResourceIdStringRestApiRootResourceIdstringRestApiRootResourceId*stringrequired#
The resource ID of the root resource.
Represents the root resource of this API endpoint ('/').

Resources and Methods are added to this resource.

stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this resource is defined.
urlstringurlstrurlStringUrlstringUrl*stringrequired#
The deployed root URL of this REST API.

Methods ​

addApiKey(id: string, options?: ApiKeyOptions): IApiKeydef add_api_key(self, id: str, options: typing.Optional[ApiKeyOptions] = None) -> IApiKeypublic IApiKey addApiKey(String id, ApiKeyOptions options)public IApiKey AddApiKey(string id, ApiKeyOptions? options = null)func AddApiKey(Id *string, Options ApiKeyOptions) IApiKey#
Add an ApiKey to the deploymentStage.
addDomainName(id: string, options: DomainNameOptions): DomainNamedef add_domain_name(self, id: str, options: DomainNameOptions) -> DomainNamepublic DomainName addDomainName(String id, DomainNameOptions options)public DomainName AddDomainName(string id, DomainNameOptions options)func AddDomainName(Id *string, Options DomainNameOptions) DomainName#
Defines an API Gateway domain name and maps it to this API.
2 parameters

Parameters

  • ididididId — The construct id.
  • optionsoptionsoptionsoptionsOptions — custom domain options.
addGatewayResponse(id: string, options: GatewayResponseOptions): GatewayResponsedef add_gateway_response(self, id: str, options: GatewayResponseOptions) -> GatewayResponsepublic GatewayResponse addGatewayResponse(String id, GatewayResponseOptions options)public GatewayResponse AddGatewayResponse(string id, GatewayResponseOptions options)func AddGatewayResponse(Id *string, Options GatewayResponseOptions) GatewayResponse#
Adds a new gateway response.
addModel(id: string, props: ModelOptions): Modeldef add_model(self, id: str, props: ModelOptions) -> Modelpublic Model addModel(String id, ModelOptions props)public Model AddModel(string id, ModelOptions props)func AddModel(Id *string, Props ModelOptions) Model#
Adds a new model.
addRequestValidator(id: string, props: RequestValidatorOptions): RequestValidatordef add_request_validator(self, id: str, props: RequestValidatorOptions) -> RequestValidatorpublic RequestValidator addRequestValidator(String id, RequestValidatorOptions props)public RequestValidator AddRequestValidator(string id, RequestValidatorOptions props)func AddRequestValidator(Id *string, Props RequestValidatorOptions) RequestValidator#
Adds a new request validator.
addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResultdef add_to_resource_policy(self, statement: PolicyStatement) -> AddToResourcePolicyResultpublic AddToResourcePolicyResult addToResourcePolicy(PolicyStatement statement)public AddToResourcePolicyResult AddToResourcePolicy(PolicyStatement statement)func AddToResourcePolicy(Statement PolicyStatement) AddToResourcePolicyResult#
Adds a statement to the resource policy associated with this rest api.

A resource policy will be automatically created upon the first call to addToResourcePolicy.

Note that this does not work with imported rest api.

1 parameter

Parameters

  • statementstatementstatementstatementStatement — The policy statement to add.
addUsagePlan(id: string, props?: UsagePlanProps): UsagePlandef add_usage_plan(self, id: str, props: typing.Optional[UsagePlanProps] = None) -> UsagePlanpublic UsagePlan addUsagePlan(String id, UsagePlanProps props)public UsagePlan AddUsagePlan(string id, UsagePlanProps? props = null)func AddUsagePlan(Id *string, Props UsagePlanProps) UsagePlan#
Adds a usage plan.
applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Override the cross-stack reference strength for this resource.
notes · 1 parameter

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

arnForExecuteApi(method?: string, path?: string, stage?: string): stringdef arn_for_execute_api(self, method: typing.Optional[str] = None, path: typing.Optional[str] = None, stage: typing.Optional[str] = None) -> strpublic String arnForExecuteApi(String method, String path, String stage)public string ArnForExecuteApi(string? method = null, string? path = null, string? stage = null)func ArnForExecuteApi(Method *string, Path *string, Stage *string) *string#
Gets the "execute-api" ARN.
fromRestApiAttributes(scope: Construct, id: string, attrs: RestApiAttributes): IRestApi@staticmethod def from_rest_api_attributes(scope: Construct, id: str, attrs: RestApiAttributes) -> IRestApipublic static IRestApi fromRestApiAttributes(Construct scope, String id, RestApiAttributes attrs)public static IRestApi FromRestApiAttributes(Construct scope, string id, RestApiAttributes attrs)func FromRestApiAttributes(Scope Construct, Id *string, Attrs RestApiAttributes) IRestApistatic#
Import an existing RestApi that can be configured with additional Methods and Resources.
fromRestApiId(scope: Construct, id: string, restApiId: string): IRestApi@staticmethod def from_rest_api_id(scope: Construct, id: str, rest_api_id: str) -> IRestApipublic static IRestApi fromRestApiId(Construct scope, String id, String restApiId)public static IRestApi FromRestApiId(Construct scope, string id, string restApiId)func FromRestApiId(Scope Construct, Id *string, RestApiId *string) IRestApistatic#
Import an existing RestApi.
grantInvokeFromVpcEndpointsOnly(vpcEndpoints: IVpcEndpoint[]): voiddef grant_invoke_from_vpc_endpoints_only(self, vpc_endpoints: typing.List[IVpcEndpoint]) -> Nonepublic void grantInvokeFromVpcEndpointsOnly(List<IVpcEndpoint> vpcEndpoints)public void GrantInvokeFromVpcEndpointsOnly(IVpcEndpoint[] vpcEndpoints)func GrantInvokeFromVpcEndpointsOnly(VpcEndpoints *[]IVpcEndpoint)#
Add a resource policy that only allows API execution from a VPC Endpoint to create a private API.
1 parameter

Parameters

  • vpcEndpointsvpc_endpointsvpcEndpointsvpcEndpointsVpcEndpoints — the interface VPC endpoints to grant access to.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#
Returns true if the construct was created by CDK, and false otherwise.
isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#
Check whether the given construct is a Resource.
isRestApi(x: any): boolean@staticmethod def is_rest_api(x: Any) -> boolpublic static Boolean isRestApi(Object x)public static bool IsRestApi(object x)func IsRestApi(X interface{}) *boolstatic#
Return whether the given object is a `RestApi`.
metric(metricName: string, props?: MetricOptions): Metricdef metric(self, metric_name: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metric(String metricName, MetricOptions props)public Metric Metric(string metricName, MetricOptions? props = null)func Metric(MetricName *string, Props MetricOptions) Metric#
Returns the given named metric for this API.
metricCacheHitCount(props?: MetricOptions): Metricdef metric_cache_hit_count(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricCacheHitCount(MetricOptions props)public Metric MetricCacheHitCount(MetricOptions? props = null)func MetricCacheHitCount(Props MetricOptions) Metric#
Metric for the number of requests served from the API cache in a given period.

Default: sum over 5 minutes

metricCacheMissCount(props?: MetricOptions): Metricdef metric_cache_miss_count(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricCacheMissCount(MetricOptions props)public Metric MetricCacheMissCount(MetricOptions? props = null)func MetricCacheMissCount(Props MetricOptions) Metric#
Metric for the number of requests served from the backend in a given period, when API caching is enabled.

Default: sum over 5 minutes

metricClientError(props?: MetricOptions): Metricdef metric_client_error(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricClientError(MetricOptions props)public Metric MetricClientError(MetricOptions? props = null)func MetricClientError(Props MetricOptions) Metric#
Metric for the number of client-side errors captured in a given period.

Default: sum over 5 minutes

metricCount(props?: MetricOptions): Metricdef metric_count(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricCount(MetricOptions props)public Metric MetricCount(MetricOptions? props = null)func MetricCount(Props MetricOptions) Metric#
Metric for the total number API requests in a given period.

Default: sample count over 5 minutes

metricIntegrationLatency(props?: MetricOptions): Metricdef metric_integration_latency(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricIntegrationLatency(MetricOptions props)public Metric MetricIntegrationLatency(MetricOptions? props = null)func MetricIntegrationLatency(Props MetricOptions) Metric#
Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend.

Default: average over 5 minutes.

metricLatency(props?: MetricOptions): Metricdef metric_latency(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricLatency(MetricOptions props)public Metric MetricLatency(MetricOptions? props = null)func MetricLatency(Props MetricOptions) Metric#
The time between when API Gateway receives a request from a client and when it returns a response to the client.

The latency includes the integration latency and other API Gateway overhead.

Default: average over 5 minutes.

metricServerError(props?: MetricOptions): Metricdef metric_server_error(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricServerError(MetricOptions props)public Metric MetricServerError(MetricOptions? props = null)func MetricServerError(Props MetricOptions) Metric#
Metric for the number of server-side errors captured in a given period.

Default: sum over 5 minutes

toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
urlForPath(path?: string): stringdef url_for_path(self, path: typing.Optional[str] = None) -> strpublic String urlForPath(String path)public string UrlForPath(string? path = null)func UrlForPath(Path *string) *string#
Returns the URL for an HTTP path.

Fails if deploymentStage is not set either by deploy or explicitly.

with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.