java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.apigatewayv2.HttpStage
All Implemented Interfaces:
IStageRef, IEnvironmentAware, IResource, IHttpStage, IHttpStageRef, IStage, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-03-02T12:05:01.307Z") @Stability(Stable) public class HttpStage extends Resource implements IHttpStage, IStage
Represents a stage where an instance of the API is deployed.

Example:

 import software.amazon.awscdk.services.apigateway.*;
 import software.amazon.awscdk.services.logs.*;
 HttpApi api;
 LogGroup logGroup;
 HttpStage stage = HttpStage.Builder.create(this, "Stage")
         .httpApi(api)
         .accessLogSettings(Map.of(
                 "destination", new LogGroupLogDestination(logGroup),
                 "format", AccessLogFormat.clf()))
         .build();
 
  • Field Details

    • PROPERTY_INJECTION_ID

      @Stability(Stable) public static final String PROPERTY_INJECTION_ID
      Uniquely identifies this class.
  • Constructor Details

    • HttpStage

      protected HttpStage(software.amazon.jsii.JsiiObjectRef objRef)
    • HttpStage

      protected HttpStage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • HttpStage

      @Stability(Stable) public HttpStage(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull HttpStageProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromHttpStageAttributes

      @Stability(Stable) @NotNull public static IHttpStage fromHttpStageAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull HttpStageAttributes attrs)
      Import an existing stage into this CDK app.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      attrs - This parameter is required.
    • addStageVariable

      @Stability(Stable) public void addStageVariable(@NotNull String name, @NotNull String value)
      Adds a stage variable to this stage.

      Specified by:
      addStageVariable in interface IStage
      Parameters:
      name - This parameter is required.
      value - This parameter is required.
    • defaultAccessLogFormat

      @Stability(Stable) @NotNull public AccessLogFormat defaultAccessLogFormat()
      CLF Log format for HTTP API Stage.

      See Also:
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
      Return the given named metric for this HTTP Api Gateway Stage.

      Specified by:
      metric in interface IStage
      Parameters:
      metricName - This parameter is required.
      props -
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName)
      Return the given named metric for this HTTP Api Gateway Stage.

      Specified by:
      metric in interface IStage
      Parameters:
      metricName - This parameter is required.
    • metricClientError

      @Stability(Stable) @NotNull public Metric metricClientError(@Nullable MetricOptions props)
      Metric for the number of client-side errors captured in a given period.

      Specified by:
      metricClientError in interface IHttpStage
      Parameters:
      props -
    • metricClientError

      @Stability(Stable) @NotNull public Metric metricClientError()
      Metric for the number of client-side errors captured in a given period.
      Specified by:
      metricClientError in interface IHttpStage
    • metricCount

      @Stability(Stable) @NotNull public Metric metricCount(@Nullable MetricOptions props)
      Metric for the total number API requests in a given period.

      Specified by:
      metricCount in interface IHttpStage
      Parameters:
      props -
    • metricCount

      @Stability(Stable) @NotNull public Metric metricCount()
      Metric for the total number API requests in a given period.
      Specified by:
      metricCount in interface IHttpStage
    • metricDataProcessed

      @Stability(Stable) @NotNull public Metric metricDataProcessed(@Nullable MetricOptions props)
      Metric for the amount of data processed in bytes.

      Specified by:
      metricDataProcessed in interface IHttpStage
      Parameters:
      props -
    • metricDataProcessed

      @Stability(Stable) @NotNull public Metric metricDataProcessed()
      Metric for the amount of data processed in bytes.
      Specified by:
      metricDataProcessed in interface IHttpStage
    • metricIntegrationLatency

      @Stability(Stable) @NotNull public Metric metricIntegrationLatency(@Nullable MetricOptions props)
      Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend.

      Specified by:
      metricIntegrationLatency in interface IHttpStage
      Parameters:
      props -
    • metricIntegrationLatency

      @Stability(Stable) @NotNull public Metric metricIntegrationLatency()
      Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend.
      Specified by:
      metricIntegrationLatency in interface IHttpStage
    • metricLatency

      @Stability(Stable) @NotNull public Metric metricLatency(@Nullable MetricOptions props)
      The time between when API Gateway receives a request from a client and when it returns a response to the client.

      The latency includes the integration latency and other API Gateway overhead.

      Specified by:
      metricLatency in interface IHttpStage
      Parameters:
      props -
    • metricLatency

      @Stability(Stable) @NotNull public Metric metricLatency()
      The time between when API Gateway receives a request from a client and when it returns a response to the client.

      The latency includes the integration latency and other API Gateway overhead.

      Specified by:
      metricLatency in interface IHttpStage
    • metricServerError

      @Stability(Stable) @NotNull public Metric metricServerError(@Nullable MetricOptions props)
      Metric for the number of server-side errors captured in a given period.

      Specified by:
      metricServerError in interface IHttpStage
      Parameters:
      props -
    • metricServerError

      @Stability(Stable) @NotNull public Metric metricServerError()
      Metric for the number of server-side errors captured in a given period.
      Specified by:
      metricServerError in interface IHttpStage
    • getApi

      @Stability(Stable) @NotNull public IHttpApi getApi()
      The API this stage is associated to.
      Specified by:
      getApi in interface IHttpStage
    • getBaseApi

      @Stability(Stable) @NotNull protected IApi getBaseApi()
    • getDomainUrl

      @Stability(Stable) @NotNull public String getDomainUrl()
      The custom domain URL to this stage.
      Specified by:
      getDomainUrl in interface IHttpStage
    • getIsHttpStage

      @Stability(Stable) @NotNull public Boolean getIsHttpStage()
      Indicates that this is an HTTP Stage.

      Will always return true, but is necessary to prevent accidental structural equality in TypeScript.

      Specified by:
      getIsHttpStage in interface IHttpStageRef
    • getStageName

      @Stability(Stable) @NotNull public String getStageName()
      The name of the stage;

      its primary identifier.

      Specified by:
      getStageName in interface IStage
    • getStageRef

      @Stability(Stable) @NotNull public StageReference getStageRef()
      A reference to a Stage resource.
      Specified by:
      getStageRef in interface IStageRef
    • getUrl

      @Stability(Stable) @NotNull public String getUrl()
      The URL to this stage.
      Specified by:
      getUrl in interface IStage