java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.apigateway.Stage
All Implemented Interfaces:
IConstruct, IDependable, IResource, IStage, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:45.093Z") @Stability(Stable) public class Stage extends Resource implements IStage
Example:

 // production stage
 LogGroup prdLogGroup = new LogGroup(this, "PrdLogs");
 RestApi api = RestApi.Builder.create(this, "books")
         .deployOptions(StageOptions.builder()
                 .accessLogDestination(new LogGroupLogDestination(prdLogGroup))
                 .accessLogFormat(AccessLogFormat.jsonWithStandardFields())
                 .build())
         .build();
 Deployment deployment = Deployment.Builder.create(this, "Deployment").api(api).build();
 // development stage
 LogGroup devLogGroup = new LogGroup(this, "DevLogs");
 Stage.Builder.create(this, "dev")
         .deployment(deployment)
         .accessLogDestination(new LogGroupLogDestination(devLogGroup))
         .accessLogFormat(AccessLogFormat.jsonWithStandardFields(JsonWithStandardFieldProps.builder()
                 .caller(false)
                 .httpMethod(true)
                 .ip(true)
                 .protocol(true)
                 .requestTime(true)
                 .resourcePath(true)
                 .responseLength(true)
                 .status(true)
                 .user(true)
                 .build()))
         .build();
 
  • Constructor Details

    • Stage

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

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

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

    • urlForPath

      @Stability(Stable) @NotNull public String urlForPath(@Nullable String path)
      Returns the invoke URL for a certain path.

      Parameters:
      path - The resource path.
    • urlForPath

      @Stability(Stable) @NotNull public String urlForPath()
      Returns the invoke URL for a certain path.
    • getRestApi

      @Stability(Stable) @NotNull public IRestApi getRestApi()
      RestApi to which this stage is associated.
      Specified by:
      getRestApi in interface IStage
    • getStageArn

      @Stability(Stable) @NotNull public String getStageArn()
      Returns the resource ARN for this stage:.

      arn:aws:apigateway:{region}::/restapis/{restApiId}/stages/{stageName}

      Note that this is separate from the execute-api ARN for methods and resources within this stage.

    • getStageName

      @Stability(Stable) @NotNull public String getStageName()
      Name of this stage.
      Specified by:
      getStageName in interface IStage