Interface Deployment

    • Method Detail

      • getInstance

        static DeploymentInstance getInstance()
        The current running deployment instance. This is only available from inside the function passed to @see runAsync(Supplier) (or its overloads).
        Throws:
        java.lang.IllegalStateException - if called before 'run' was called
      • getStackName

        @Nonnull
        java.lang.String getStackName()
        Returns:
        the current stack name
      • getProjectName

        @Nonnull
        java.lang.String getProjectName()
        Returns:
        the current project name
      • isDryRun

        boolean isDryRun()
        Whether or not the application is currently being previewed or actually applied.
        Returns:
        true if application is being applied
      • invoke

        <T> Output<T> invoke​(java.lang.String token,
                             TypeShape<T> targetType,
                             InvokeArgs args,
                             @Nullable
                             InvokeOptions options)
        Dynamically invokes the function token, which is offered by a provider plugin.

        The result of invoke will be an @see Output<T> resolved to the result value of the provider plugin.

        The args inputs can be a bag of computed values (including, Ts, @see CompletableFutures, @see Outputs, etc.)

      • invokeAsync

        <T> java.util.concurrent.CompletableFuture<T> invokeAsync​(java.lang.String token,
                                                                  TypeShape<T> targetType,
                                                                  InvokeArgs args,
                                                                  InvokeOptions options)
        Dynamically invokes the function token, which is offered by a provider plugin.

        The result of invokeAsync will be a @see CompletableFuture resolved to the result value of the provider plugin.

        The args inputs can be a bag of computed values (including, Ts, @see CompletableFutures, @see Outputs, etc.).

      • call

        <T> Output<T> call​(java.lang.String token,
                           TypeShape<T> targetType,
                           CallArgs args,
                           @Nullable
                           Resource self,
                           @Nullable
                           CallOptions options)
        Dynamically calls the function token, which is offered by a provider plugin.

        The result of call will be an @see Output<T> resolved to the result value of the provider plugin.

        The args inputs can be a bag of computed values (including, Ts, @see CompletableFutures, @see Outputs, etc.).

      • runAsyncRunnable

        static java.util.concurrent.CompletableFuture<java.lang.Integer> runAsyncRunnable​(java.lang.Runnable callback)
        An entry-point to a Pulumi application.
        Parameters:
        callback - Callback that creates stack resources.
        See Also:
        for more details.
      • runAsync

        static java.util.concurrent.CompletableFuture<java.lang.Integer> runAsync​(java.util.function.Supplier<java.util.Map<java.lang.String,​Output<?>>> callback)
        An entry-point to a Pulumi application. Deployment will instantiate a default stack instance based on the callback passed as callback parameter.
        Parameters:
        callback - Callback that creates stack resources.
        Returns:
        A dictionary of stack outputs.
        See Also:
        for more details.
      • runAsyncFuture

        static java.util.concurrent.CompletableFuture<java.lang.Integer> runAsyncFuture​(java.util.function.Supplier<java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,​Output<?>>>> callback)
        An entry-point to a Pulumi application. Deployment will instantiate a default stack instance based on the callback passed as callback parameter.
        Parameters:
        callback - Callback that creates stack resources.
        See Also:
        for more details.
      • runAsyncFuture

        static java.util.concurrent.CompletableFuture<java.lang.Integer> runAsyncFuture​(java.util.function.Supplier<java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,​Output<?>>>> callback,
                                                                                        @Nullable
                                                                                        StackOptions options)
        An entry-point to a Pulumi application. Deployment will instantiate a default stack instance based on the callback passed as callback parameter.
        Parameters:
        callback - Callback that creates stack resources.
        options - Optional Stack options. Java applications should perform all startup logic they need in their main method and then end with:

        public static void main(String[] args) { // program initialization code ... return Deployment.runAsync(() -> { // Code that creates resources. }); }

        Importantly: Cloud resources cannot be created outside of the lambda passed to any of the @see #runAsync overloads.

        Because cloud Resource construction is inherently asynchronous, the result of this function is a @see CompletableFuture which should then be returned or awaited. This will ensure that any problems that are encountered during the running of the program are properly reported. Failure to do this may lead to the program ending early before all resources are properly registered.

        The function passed to @see #runAsyncFuture(Supplier, StackOptions) can optionally return a @see Map. The keys and values in this map will become the outputs for the Pulumi Stack that is created.
        See Also:
        for more information.
      • runAsyncStack

        static <S extends Stack> java.util.concurrent.CompletableFuture<java.lang.Integer> runAsyncStack​(java.util.function.Supplier<S> stackFactory)
        An entry-point to a Pulumi application. Deployment will instantiate a new stack instance using the supplier passed as stackFactory parameter.
        Parameters:
        stackFactory - The stack supplier used to create stack instances Java applications should perform all startup logic they need in their main method and then end with:

        public static void main(String[] args) { // program initialization code ... return Deployment.runAsyncStack(() -> new MyStack())); }

        Importantly: cloud resources cannot be created outside of the @see Stack component.

        Because cloud Resource construction is inherently asynchronous, the result of this function is a @see CompletableFuture which should then be returned or awaited. This will ensure that any problems that are encountered during the running of the program are properly reported. Failure to do this may lead to the program ending early before all resources are properly registered.

        See Also:
        for more information.