@aws-cdk_aws-apigatewayv2-alpha.ApiMapping

class ApiMapping (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Apigatewayv2.Alpha.ApiMapping
Gogithub.com/aws/aws-cdk-go/awscdkapigatewayv2alpha/v2#ApiMapping
Javasoftware.amazon.awscdk.services.apigatewayv2.alpha.ApiMapping
Pythonaws_cdk.aws_apigatewayv2_alpha.ApiMapping
TypeScript (source)@aws-cdk/aws-apigatewayv2-alpha ยป ApiMapping

Implements IConstruct, IDependable, IResource, IApiMapping

Create a new API mapping for API Gateway API endpoint.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as apigatewayv2_alpha from '@aws-cdk/aws-apigatewayv2-alpha';

declare const api: apigatewayv2_alpha.IApi;
declare const domainName: apigatewayv2_alpha.DomainName;
declare const stage: apigatewayv2_alpha.IStage;
const apiMapping = new apigatewayv2_alpha.ApiMapping(this, 'MyApiMapping', {
  api: api,
  domainName: domainName,

  // the properties below are optional
  apiMappingKey: 'apiMappingKey',
  stage: stage,
});

Initializer

new ApiMapping(scope: Construct, id: string, props: ApiMappingProps)

Parameters

  • scope Construct
  • id string
  • props ApiMappingProps

Construct Props

NameTypeDescription
api๐Ÿ”นIApiThe Api to which this mapping is applied.
domainName๐Ÿ”นIDomainNamecustom domain name of the mapping target.
apiMappingKey?๐Ÿ”นstringApi mapping key.
stage?๐Ÿ”นIStagestage for the ApiMapping resource required for WebSocket API defaults to default stage of an HTTP API.

api๐Ÿ”น

Type: IApi

The Api to which this mapping is applied.


domainName๐Ÿ”น

Type: IDomainName

custom domain name of the mapping target.


apiMappingKey?๐Ÿ”น

Type: string (optional, default: undefined for the root path mapping.)

Api mapping key.

The path where this stage should be mapped to on the domain


stage?๐Ÿ”น

Type: IStage (optional, default: Default stage of the passed API for HTTP API, required for WebSocket API)

stage for the ApiMapping resource required for WebSocket API defaults to default stage of an HTTP API.

Properties

NameTypeDescription
apiMappingId๐Ÿ”นstringID of the API Mapping.
domainName๐Ÿ”นIDomainNameAPI domain name.
env๐Ÿ”นResourceEnvironmentThe environment this resource belongs to.
node๐Ÿ”นNodeThe tree node.
stack๐Ÿ”นStackThe stack in which this resource is defined.
mappingKey?๐Ÿ”นstringAPI Mapping key.

apiMappingId๐Ÿ”น

Type: string

ID of the API Mapping.


domainName๐Ÿ”น

Type: IDomainName

API domain name.


env๐Ÿ”น

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node๐Ÿ”น

Type: Node

The tree node.


stack๐Ÿ”น

Type: Stack

The stack in which this resource is defined.


mappingKey?๐Ÿ”น

Type: string (optional)

API Mapping key.

Methods

NameDescription
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
toString()๐Ÿ”นReturns a string representation of this construct.
static fromApiMappingAttributes(scope, id, attrs)๐Ÿ”นimport from API ID.

applyRemovalPolicy(policy)๐Ÿ”น

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromApiMappingAttributes(scope, id, attrs)๐Ÿ”น

public static fromApiMappingAttributes(scope: Construct, id: string, attrs: ApiMappingAttributes): IApiMapping

Parameters

  • scope Construct
  • id string
  • attrs ApiMappingAttributes

Returns

  • IApiMapping

import from API ID.