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:
IResource, IDomainName, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:33:56.751Z") @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();
 
  • 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 IStage 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

      @Stability(Stable) public void addApiMapping(@NotNull IStage targetStage)
      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 IRestApi 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 addApiMapping instead.

      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 IRestApi 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 addApiMapping instead.

      Parameters:
      targetApi - That target API endpoint, requests will be mapped to the deployment stage. This parameter is required.
    • getDomainName

      @Stability(Stable) @NotNull public String getDomainName()
      The domain name (e.g. example.com).
      Specified by:
      getDomainName in interface IDomainName
    • getDomainNameAliasDomainName

      @Stability(Stable) @NotNull public String getDomainNameAliasDomainName()
      The Route53 alias target to use in order to connect a record set to this domain through an alias.
      Specified by:
      getDomainNameAliasDomainName in interface IDomainName
    • getDomainNameAliasHostedZoneId

      @Stability(Stable) @NotNull public String getDomainNameAliasHostedZoneId()
      The Route53 hosted zone ID to use in order to connect a record set to this domain through an alias.
      Specified by:
      getDomainNameAliasHostedZoneId in interface IDomainName