93 lines
2.7 KiB
TypeScript
93 lines
2.7 KiB
TypeScript
import type { Construct } from 'constructs';
|
|
import type { IDomainName } from './domain-name';
|
|
import type { IStage } from './stage';
|
|
import type { IResource } from '../../../core';
|
|
import { Resource } from '../../../core';
|
|
import type { ApiMappingReference, IApiMappingRef, IApiRef, IDomainNameRef } from '../../../interfaces/generated/aws-apigatewayv2-interfaces.generated';
|
|
/**
|
|
* Represents an ApiGatewayV2 ApiMapping resource
|
|
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-apimapping.html
|
|
*/
|
|
export interface IApiMapping extends IResource, IApiMappingRef {
|
|
/**
|
|
* ID of the api mapping
|
|
* @attribute
|
|
*/
|
|
readonly apiMappingId: string;
|
|
}
|
|
/**
|
|
* Properties used to create the ApiMapping resource
|
|
*/
|
|
export interface ApiMappingProps {
|
|
/**
|
|
* Api mapping key. The path where this stage should be mapped to on the domain
|
|
* @default - undefined for the root path mapping.
|
|
*/
|
|
readonly apiMappingKey?: string;
|
|
/**
|
|
* The Api to which this mapping is applied
|
|
*/
|
|
readonly api: IApiRef;
|
|
/**
|
|
* custom domain name of the mapping target
|
|
*/
|
|
readonly domainName: IDomainNameRef;
|
|
/**
|
|
* stage for the ApiMapping resource
|
|
* required for WebSocket API
|
|
* defaults to default stage of an HTTP API
|
|
*
|
|
* @default - Default stage of the passed API for HTTP API, required for WebSocket API
|
|
*/
|
|
readonly stage?: IStage;
|
|
}
|
|
/**
|
|
* The attributes used to import existing ApiMapping
|
|
*/
|
|
export interface ApiMappingAttributes {
|
|
/**
|
|
* The API mapping ID
|
|
*/
|
|
readonly apiMappingId: string;
|
|
/**
|
|
* Domain name
|
|
*
|
|
* @default - Certain operations on the referenced object may fail if not supplied
|
|
*/
|
|
readonly domainName?: string;
|
|
}
|
|
/**
|
|
* Create a new API mapping for API Gateway API endpoint.
|
|
* @resource AWS::ApiGatewayV2::ApiMapping
|
|
*/
|
|
export declare class ApiMapping extends Resource implements IApiMapping {
|
|
/** Uniquely identifies this class. */
|
|
static readonly PROPERTY_INJECTION_ID: string;
|
|
/**
|
|
* import from API ID
|
|
*/
|
|
static fromApiMappingAttributes(scope: Construct, id: string, attrs: ApiMappingAttributes): IApiMapping;
|
|
/**
|
|
* ID of the API Mapping
|
|
*/
|
|
readonly apiMappingId: string;
|
|
/**
|
|
* API Mapping key
|
|
*/
|
|
readonly mappingKey?: string;
|
|
/**
|
|
* API domain name
|
|
*/
|
|
private readonly _domainName;
|
|
constructor(scope: Construct, id: string, props: ApiMappingProps);
|
|
/**
|
|
* API domain name
|
|
*/
|
|
get domainName(): IDomainName;
|
|
get apiMappingRef(): ApiMappingReference;
|
|
/**
|
|
* Return the domain for this API Mapping
|
|
*/
|
|
get domainUrl(): string;
|
|
}
|