aws-cdk-lib.aws_apigateway.ApiMappingOptions

interface ApiMappingOptions

LanguageType name
.NETAmazon.CDK.AWS.APIGateway.ApiMappingOptions
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#ApiMappingOptions
Javasoftware.amazon.awscdk.services.apigateway.ApiMappingOptions
Pythonaws_cdk.aws_apigateway.ApiMappingOptions
TypeScript (source)aws-cdk-lib » aws_apigateway » ApiMappingOptions

Options for creating an api mapping.

Example

declare const acmCertificateForExampleCom: any;
declare const restApi: apigateway.RestApi;
declare const secondRestApi: apigateway.RestApi;

const domain = new apigateway.DomainName(this, 'custom-domain', {
  domainName: 'example.com',
  certificate: acmCertificateForExampleCom,
  mapping: restApi,
});

domain.addApiMapping(secondRestApi.deploymentStage, {
  basePath: 'orders/v2/api',
});

Properties

NameTypeDescription
basePath?stringThe api 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.

basePath?

Type: string (optional, default: map requests from the domain root (e.g. example.com).)

The api 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.

If this is undefined, a mapping will be added for the empty path. Any request that does not match a mapping will get sent to the API that has been mapped to the empty path.