Class Stage


  • public class Stage
    extends com.pulumi.resources.CustomResource
    Manages an API Gateway Stage. A stage is a named reference to a deployment, which can be done via the `aws.apigateway.Deployment` resource. Stages can be optionally managed further with the `aws.apigateway.BasePathMapping` resource, `aws.apigateway.DomainName` resource, and `aws.apigateway.MethodSettings` resource. For more information, see the [API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-stages.html). ### Managing the API Logging CloudWatch Log Group API Gateway provides the ability to [enable CloudWatch API logging](https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html). To manage the CloudWatch Log Group when this feature is enabled, the `aws.cloudwatch.LogGroup` resource can be used where the name matches the API Gateway naming convention. If the CloudWatch Log Group previously exists, import the `aws.cloudwatch.LogGroup` resource into Pulumi as a one time operation. You can recreate the environment without import.
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.apigateway.RestApi;
     import com.pulumi.aws.cloudwatch.LogGroup;
     import com.pulumi.aws.cloudwatch.LogGroupArgs;
     import com.pulumi.aws.apigateway.Stage;
     import com.pulumi.aws.apigateway.StageArgs;
     import com.pulumi.resources.CustomResourceOptions;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             final var config = ctx.config();
             final var stageName = config.get("stageName").orElse("example");
             var example = new RestApi("example");
     
             var exampleLogGroup = new LogGroup("exampleLogGroup", LogGroupArgs.builder()
                 .name(example.id().applyValue(_id -> String.format("API-Gateway-Execution-Logs_%s/%s", _id,stageName)))
                 .retentionInDays(7)
                 .build());
     
             var exampleStage = new Stage("exampleStage", StageArgs.builder()
                 .stageName(stageName)
                 .build(), CustomResourceOptions.builder()
                     .dependsOn(exampleLogGroup)
                     .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import `aws.apigateway.Stage` using `REST-API-ID/STAGE-NAME`. For example: ```sh $ pulumi import aws:apigateway/stage:Stage example 12345abcde/example ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Stage​(java.lang.String name)  
      Stage​(java.lang.String name, StageArgs args)  
      Stage​(java.lang.String name, StageArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.util.Optional<StageAccessLogSettings>> accessLogSettings()  
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> cacheClusterEnabled()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> cacheClusterSize()  
      com.pulumi.core.Output<java.util.Optional<StageCanarySettings>> canarySettings()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> clientCertificateId()  
      com.pulumi.core.Output<java.lang.String> deployment()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> documentationVersion()  
      com.pulumi.core.Output<java.lang.String> executionArn()  
      static Stage get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, StageState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> invokeUrl()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.lang.String> restApi()  
      com.pulumi.core.Output<java.lang.String> stageName()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> variables()  
      com.pulumi.core.Output<java.lang.String> webAclArn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> xrayTracingEnabled()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Stage

        public Stage​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Stage

        public Stage​(java.lang.String name,
                     StageArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Stage

        public Stage​(java.lang.String name,
                     StageArgs args,
                     @Nullable
                     com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • accessLogSettings

        public com.pulumi.core.Output<java.util.Optional<StageAccessLogSettings>> accessLogSettings()
        Returns:
        Enables access logs for the API stage. See `accessLogSettings` Block below.
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN
      • cacheClusterEnabled

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> cacheClusterEnabled()
        Returns:
        Whether a cache cluster is enabled for the stage
      • cacheClusterSize

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> cacheClusterSize()
        Returns:
        Size of the cache cluster for the stage, if enabled. Allowed values include `0.5`, `1.6`, `6.1`, `13.5`, `28.4`, `58.2`, `118` and `237`.
      • canarySettings

        public com.pulumi.core.Output<java.util.Optional<StageCanarySettings>> canarySettings()
        Returns:
        Configuration settings of a canary deployment. See `canarySettings` Block below.
      • clientCertificateId

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> clientCertificateId()
        Returns:
        Identifier of a client certificate for the stage.
      • deployment

        public com.pulumi.core.Output<java.lang.String> deployment()
        Returns:
        ID of the deployment that the stage points to
      • description

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
        Returns:
        Description of the stage.
      • documentationVersion

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> documentationVersion()
        Returns:
        Version of the associated API documentation.
      • executionArn

        public com.pulumi.core.Output<java.lang.String> executionArn()
        Returns:
        Execution ARN to be used in `lambdaPermission`'s `sourceArn` when allowing API Gateway to invoke a Lambda function, e.g., `arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod`
      • invokeUrl

        public com.pulumi.core.Output<java.lang.String> invokeUrl()
        Returns:
        URL to invoke the API pointing to the stage, e.g., `https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod`
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • restApi

        public com.pulumi.core.Output<java.lang.String> restApi()
        Returns:
        ID of the associated REST API
      • stageName

        public com.pulumi.core.Output<java.lang.String> stageName()
        Returns:
        Name of the stage
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • variables

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> variables()
        Returns:
        Map that defines the stage variables.
      • webAclArn

        public com.pulumi.core.Output<java.lang.String> webAclArn()
        Returns:
        ARN of the WebAcl associated with the Stage.
      • xrayTracingEnabled

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> xrayTracingEnabled()
        Returns:
        Whether active tracing with X-ray is enabled. Defaults to `false`.
      • get

        public static Stage get​(java.lang.String name,
                                com.pulumi.core.Output<java.lang.String> id,
                                @Nullable
                                StageState state,
                                @Nullable
                                com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.