aws-cdk-lib.aws_apigateway.BasePathMappingProps

interface BasePathMappingProps

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

Example

declare const api: apigateway.RestApi;

const domainName = apigateway.DomainName.fromDomainNameAttributes(this, 'DomainName', {
  domainName: 'domainName',
  domainNameAliasHostedZoneId: 'domainNameAliasHostedZoneId',
  domainNameAliasTarget: 'domainNameAliasTarget',
});

new apigateway.BasePathMapping(this, 'BasePathMapping', {
  domainName: domainName,
  restApi: api,
});

Properties

NameTypeDescription
domainNameIDomainNameThe DomainName to associate with this base path mapping.
restApiIRestApiThe RestApi resource to target.
attachToStage?booleanWhether to attach the base path mapping to a stage.
basePath?stringThe 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.
stage?StageThe Deployment stage of API [disable-awslint:ref-via-interface].

domainName

Type: IDomainName

The DomainName to associate with this base path mapping.


restApi

Type: IRestApi

The RestApi resource to target.


attachToStage?

Type: boolean (optional, default: true)

Whether 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.


basePath?

Type: string (optional, 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.)

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


stage?

Type: Stage (optional, default: map to deploymentStage of restApi otherwise stage needs to pass in URL)

The Deployment stage of API [disable-awslint:ref-via-interface].