This resource creates a base path that clients who call your API must use in the invocation URL. Unless you're importing a domain with `DomainName.fromDomainNameAttributes()`, you can use `DomainName.addBasePathMapping()` to define mappings.
import { BasePathMapping } from 'aws-cdk-lib/aws-apigateway';Or use the module namespace:
import * as apigateway from 'aws-cdk-lib/aws-apigateway';
// apigateway.BasePathMappingConfiguration passed to the constructor as BasePathMappingProps.
domainNameRequiredIDomainNameRefThe DomainName to associate with this base path mapping.
restApiRequiredIRestApiRefThe RestApi resource to target.
BasePathMappingOptionsattachToStageOptionalinherited from BasePathMappingOptionsbooleanWhether to attach the base path mapping to a stage. Use this property to create a base path mapping without attaching it to the Rest API default stage. This property is ignored if `stage` is provided.
Default: - true
basePathOptionalinherited from BasePathMappingOptionsstringThe base path name that callers of the API must provide in the URL after the domain name (e.g. `example.com/base-path`). If you specify this property, it can't be an empty string.
Default: - map requests from the domain root (e.g. `example.com`). If this
is undefined, no additional mappings will be allowed on this domain name.
stageOptionalinherited from BasePathMappingOptionsStageThe Deployment stage of API [disable-awslint:ref-via-interface].
Default: - map to deploymentStage of restApi otherwise stage needs to pass in URL
Everything you need to know about Amazon API Gateway on one page. HD quality, print-friendly.
Download Free Infographicaws-apigateway