Class DomainName
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.apigateway.DomainName
- All Implemented Interfaces:
IDomainNameRef,IEnvironmentAware,IResource,IDomainName,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-05T22:26:27.734Z")
@Stability(Stable)
public class DomainName
extends Resource
implements IDomainName
Example:
RestApi api;
IDomainName domainName = DomainName.fromDomainNameAttributes(this, "DomainName", DomainNameAttributes.builder()
.domainName("domainName")
.domainNameAliasHostedZoneId("domainNameAliasHostedZoneId")
.domainNameAliasTarget("domainNameAliasTarget")
.build());
BasePathMapping.Builder.create(this, "BasePathMapping")
.domainName(domainName)
.restApi(api)
.build();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.apigateway.IDomainName
IDomainName.Jsii$Default, IDomainName.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDomainName(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedDomainName(software.amazon.jsii.JsiiObjectRef objRef) DomainName(software.constructs.Construct scope, String id, DomainNameProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddApiMapping(IStageRef targetStage) Maps this domain to an API endpoint.voidaddApiMapping(IStageRef targetStage, ApiMappingOptions options) Maps this domain to an API endpoint.addBasePathMapping(IRestApiRef targetApi) Maps this domain to an API endpoint.addBasePathMapping(IRestApiRef targetApi, BasePathMappingOptions options) Maps this domain to an API endpoint.static IDomainNamefromDomainNameAttributes(software.constructs.Construct scope, String id, DomainNameAttributes attrs) Imports an existing domain name.The domain name (e.g.The Route53 alias target to use in order to connect a record set to this domain through an alias.The Route53 hosted zone ID to use in order to connect a record set to this domain through an alias.A reference to a DomainName resource.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awscdk.services.apigateway.IDomainName
getEnv, getNodeMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
Constructor Details
-
DomainName
protected DomainName(software.amazon.jsii.JsiiObjectRef objRef) -
DomainName
protected DomainName(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
DomainName
@Stability(Stable) public DomainName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DomainNameProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromDomainNameAttributes
@Stability(Stable) @NotNull public static IDomainName fromDomainNameAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DomainNameAttributes attrs) Imports an existing domain name.- Parameters:
scope- This parameter is required.id- This parameter is required.attrs- This parameter is required.
-
addApiMapping
@Stability(Stable) public void addApiMapping(@NotNull IStageRef targetStage, @Nullable ApiMappingOptions options) Maps this domain to an API endpoint.This uses the ApiMapping from ApiGatewayV2 which supports multi-level paths, but also only supports:
- SecurityPolicy.TLS_1_2
- EndpointType.REGIONAL
- Parameters:
targetStage- the target API stage. This parameter is required.options- Options for mapping to a stage.
-
addApiMapping
Maps this domain to an API endpoint.This uses the ApiMapping from ApiGatewayV2 which supports multi-level paths, but also only supports:
- SecurityPolicy.TLS_1_2
- EndpointType.REGIONAL
- Parameters:
targetStage- the target API stage. This parameter is required.
-
addBasePathMapping
@Stability(Stable) @NotNull public BasePathMapping addBasePathMapping(@NotNull IRestApiRef targetApi, @Nullable BasePathMappingOptions options) Maps this domain to an API endpoint.This uses the BasePathMapping from ApiGateway v1 which does not support multi-level paths.
If you need to create a mapping for a multi-level path use
addApiMappinginstead.- Parameters:
targetApi- That target API endpoint, requests will be mapped to the deployment stage. This parameter is required.options- Options for mapping to base path with or without a stage.
-
addBasePathMapping
@Stability(Stable) @NotNull public BasePathMapping addBasePathMapping(@NotNull IRestApiRef targetApi) Maps this domain to an API endpoint.This uses the BasePathMapping from ApiGateway v1 which does not support multi-level paths.
If you need to create a mapping for a multi-level path use
addApiMappinginstead.- Parameters:
targetApi- That target API endpoint, requests will be mapped to the deployment stage. This parameter is required.
-
getDomainName
The domain name (e.g.example.com).- Specified by:
getDomainNamein interfaceIDomainName
-
getDomainNameAliasDomainName
The Route53 alias target to use in order to connect a record set to this domain through an alias.- Specified by:
getDomainNameAliasDomainNamein interfaceIDomainName
-
getDomainNameAliasHostedZoneId
The Route53 hosted zone ID to use in order to connect a record set to this domain through an alias.- Specified by:
getDomainNameAliasHostedZoneIdin interfaceIDomainName
-
getDomainNameRef
A reference to a DomainName resource.- Specified by:
getDomainNameRefin interfaceIDomainNameRef
-