AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::ApiGatewayV2::ApiMapping

CfnApiMapping

The `AWS::ApiGatewayV2::ApiMapping` resource contains an API mapping. An API mapping relates a path of your custom domain name to a stage of your API. A custom domain name can have multiple API mappings, but the paths can't overlap. A custom domain can map only to APIs of the same protocol type. For more information, see [CreateApiMapping](https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/domainnames-domainname-apimappings.html#CreateApiMapping) in the *Amazon API Gateway V2 API Reference* .

Import

import { CfnApiMapping } from 'aws-cdk-lib/aws-apigatewayv2';

Or use the module namespace:

import * as apigatewayv2 from 'aws-cdk-lib/aws-apigatewayv2';
// apigatewayv2.CfnApiMapping

Properties

Configuration passed to the constructor as CfnApiMappingProps.

apiIdRequired
string | IRestApiRef | IApiRef

The API identifier.

domainNameRequired
string | IDomainNameRef | IDomainNameRef

The domain name.

stageRequired
string

The API stage.

apiMappingKeyOptional
string

The API mapping key.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter