1. Registry
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. esa
  6. getRoutineCodeVersions
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
alicloud logo alicloud logo
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi

    This data source provides the ESA Routine Code Versions of the current Alibaba Cloud user.

    For information about ESA Routine Code Versions and how to use it, see ListRoutineCodeVersions.

    NOTE: Available since v1.287.0.

    NOTE: The underlying ListRoutineCodeVersions API caps pagination at 2 pages of up to 20 items each, so at most the 40 most recent code versions are returned.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = alicloud.esa.getRoutineCodeVersions({
        routineName: "terraform-example",
    });
    export const codeVersions = _default.then(_default => _default.versions);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.esa.get_routine_code_versions(routine_name="terraform-example")
    pulumi.export("codeVersions", default.versions)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/esa"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := esa.GetRoutineCodeVersions(ctx, &esa.GetRoutineCodeVersionsArgs{
    			RoutineName: "terraform-example",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("codeVersions", _default.Versions)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.Esa.GetRoutineCodeVersions.Invoke(new()
        {
            RoutineName = "terraform-example",
        });
    
        return new Dictionary<string, object?>
        {
            ["codeVersions"] = @default.Apply(@default => @default.Apply(getRoutineCodeVersionsResult => getRoutineCodeVersionsResult.Versions)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.esa.EsaFunctions;
    import com.pulumi.alicloud.esa.inputs.GetRoutineCodeVersionsArgs;
    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 default = EsaFunctions.getRoutineCodeVersions(GetRoutineCodeVersionsArgs.builder()
                .routineName("terraform-example")
                .build());
    
            ctx.export("codeVersions", default_.versions());
        }
    }
    
    variables:
      default:
        fn::invoke:
          function: alicloud:esa:getRoutineCodeVersions
          arguments:
            routineName: terraform-example
    outputs:
      codeVersions: ${default.versions}
    
    pulumi {
      required_providers {
        alicloud = {
          source = "pulumi/alicloud"
        }
      }
    }
    
    data "alicloud_esa_getroutinecodeversions" "default" {
      routine_name = "terraform-example"
    }
    
    output "codeVersions" {
      value = data.alicloud_esa_getroutinecodeversions.default.versions
    }
    

    Using getRoutineCodeVersions

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getRoutineCodeVersions(args: GetRoutineCodeVersionsArgs, opts?: InvokeOptions): Promise<GetRoutineCodeVersionsResult>
    function getRoutineCodeVersionsOutput(args: GetRoutineCodeVersionsOutputArgs, opts?: InvokeOutputOptions): Output<GetRoutineCodeVersionsResult>
    def get_routine_code_versions(ids: Optional[Sequence[str]] = None,
                                  output_file: Optional[str] = None,
                                  routine_name: Optional[str] = None,
                                  search_key_word: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetRoutineCodeVersionsResult
    def get_routine_code_versions_output(ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
                                  output_file: pulumi.Input[Optional[str]] = None,
                                  routine_name: pulumi.Input[Optional[str]] = None,
                                  search_key_word: pulumi.Input[Optional[str]] = None,
                                  opts: Optional[InvokeOutputOptions] = None) -> Output[GetRoutineCodeVersionsResult]
    func GetRoutineCodeVersions(ctx *Context, args *GetRoutineCodeVersionsArgs, opts ...InvokeOption) (*GetRoutineCodeVersionsResult, error)
    func GetRoutineCodeVersionsOutput(ctx *Context, args *GetRoutineCodeVersionsOutputArgs, opts ...InvokeOption) GetRoutineCodeVersionsResultOutput

    > Note: This function is named GetRoutineCodeVersions in the Go SDK.

    public static class GetRoutineCodeVersions 
    {
        public static Task<GetRoutineCodeVersionsResult> InvokeAsync(GetRoutineCodeVersionsArgs args, InvokeOptions? opts = null)
        public static Output<GetRoutineCodeVersionsResult> Invoke(GetRoutineCodeVersionsInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetRoutineCodeVersionsResult> Invoke(GetRoutineCodeVersionsInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetRoutineCodeVersionsResult> getRoutineCodeVersions(GetRoutineCodeVersionsArgs args, InvokeOptions options)
    public static Output<GetRoutineCodeVersionsResult> getRoutineCodeVersions(GetRoutineCodeVersionsArgs args, InvokeOptions options)
    public static Output<GetRoutineCodeVersionsResult> getRoutineCodeVersions(GetRoutineCodeVersionsArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: alicloud:esa/getRoutineCodeVersions:getRoutineCodeVersions
      arguments:
        # arguments dictionary
    data "alicloud_esa_get_routine_code_versions" "name" {
        # arguments
    }

    The following arguments are supported:

    RoutineName string
    The name of the routine to query code versions for.
    Ids List<string>
    A list of code version IDs (code version numbers) used to filter the result.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    SearchKeyWord string
    A keyword used to fuzzy-match code versions.
    RoutineName string
    The name of the routine to query code versions for.
    Ids []string
    A list of code version IDs (code version numbers) used to filter the result.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    SearchKeyWord string
    A keyword used to fuzzy-match code versions.
    routine_name string
    The name of the routine to query code versions for.
    ids list(string)
    A list of code version IDs (code version numbers) used to filter the result.
    output_file string
    File name where to save data source results (after running pulumi preview).
    search_key_word string
    A keyword used to fuzzy-match code versions.
    routineName String
    The name of the routine to query code versions for.
    ids List<String>
    A list of code version IDs (code version numbers) used to filter the result.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    searchKeyWord String
    A keyword used to fuzzy-match code versions.
    routineName string
    The name of the routine to query code versions for.
    ids string[]
    A list of code version IDs (code version numbers) used to filter the result.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    searchKeyWord string
    A keyword used to fuzzy-match code versions.
    routine_name str
    The name of the routine to query code versions for.
    ids Sequence[str]
    A list of code version IDs (code version numbers) used to filter the result.
    output_file str
    File name where to save data source results (after running pulumi preview).
    search_key_word str
    A keyword used to fuzzy-match code versions.
    routineName String
    The name of the routine to query code versions for.
    ids List<String>
    A list of code version IDs (code version numbers) used to filter the result.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    searchKeyWord String
    A keyword used to fuzzy-match code versions.

    getRoutineCodeVersions Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    RoutineName string
    Versions List<Pulumi.AliCloud.Esa.Outputs.GetRoutineCodeVersionsVersion>
    A list of Routine Code Versions. Each element contains the following attributes:
    OutputFile string
    SearchKeyWord string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    RoutineName string
    Versions []GetRoutineCodeVersionsVersion
    A list of Routine Code Versions. Each element contains the following attributes:
    OutputFile string
    SearchKeyWord string
    id string
    The provider-assigned unique ID for this managed resource.
    ids list(string)
    routine_name string
    versions list(object)
    A list of Routine Code Versions. Each element contains the following attributes:
    output_file string
    search_key_word string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    routineName String
    versions List<GetRoutineCodeVersionsVersion>
    A list of Routine Code Versions. Each element contains the following attributes:
    outputFile String
    searchKeyWord String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    routineName string
    versions GetRoutineCodeVersionsVersion[]
    A list of Routine Code Versions. Each element contains the following attributes:
    outputFile string
    searchKeyWord string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    routine_name str
    versions Sequence[GetRoutineCodeVersionsVersion]
    A list of Routine Code Versions. Each element contains the following attributes:
    output_file str
    search_key_word str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    routineName String
    versions List<Property Map>
    A list of Routine Code Versions. Each element contains the following attributes:
    outputFile String
    searchKeyWord String

    Supporting Types

    GetRoutineCodeVersionsVersion

    BuildId int
    The build ID of the code version.
    CodeDescription string
    The description of the code version.
    CodeVersion string
    The code version number.
    CreateTime string
    The time when the code version was created, in RFC 3339 (UTC) format.
    DeployEnv string
    The environment bundled with the code version. Valid values: staging, production.
    HasEnvVars bool
    Whether the code version bundles environment variables.
    Id string
    The ID of the code version. Same as codeVersion.
    Status string
    The status of the code version.
    BuildId int
    The build ID of the code version.
    CodeDescription string
    The description of the code version.
    CodeVersion string
    The code version number.
    CreateTime string
    The time when the code version was created, in RFC 3339 (UTC) format.
    DeployEnv string
    The environment bundled with the code version. Valid values: staging, production.
    HasEnvVars bool
    Whether the code version bundles environment variables.
    Id string
    The ID of the code version. Same as codeVersion.
    Status string
    The status of the code version.
    build_id number
    The build ID of the code version.
    code_description string
    The description of the code version.
    code_version string
    The code version number.
    create_time string
    The time when the code version was created, in RFC 3339 (UTC) format.
    deploy_env string
    The environment bundled with the code version. Valid values: staging, production.
    has_env_vars bool
    Whether the code version bundles environment variables.
    id string
    The ID of the code version. Same as codeVersion.
    status string
    The status of the code version.
    buildId Integer
    The build ID of the code version.
    codeDescription String
    The description of the code version.
    codeVersion String
    The code version number.
    createTime String
    The time when the code version was created, in RFC 3339 (UTC) format.
    deployEnv String
    The environment bundled with the code version. Valid values: staging, production.
    hasEnvVars Boolean
    Whether the code version bundles environment variables.
    id String
    The ID of the code version. Same as codeVersion.
    status String
    The status of the code version.
    buildId number
    The build ID of the code version.
    codeDescription string
    The description of the code version.
    codeVersion string
    The code version number.
    createTime string
    The time when the code version was created, in RFC 3339 (UTC) format.
    deployEnv string
    The environment bundled with the code version. Valid values: staging, production.
    hasEnvVars boolean
    Whether the code version bundles environment variables.
    id string
    The ID of the code version. Same as codeVersion.
    status string
    The status of the code version.
    build_id int
    The build ID of the code version.
    code_description str
    The description of the code version.
    code_version str
    The code version number.
    create_time str
    The time when the code version was created, in RFC 3339 (UTC) format.
    deploy_env str
    The environment bundled with the code version. Valid values: staging, production.
    has_env_vars bool
    Whether the code version bundles environment variables.
    id str
    The ID of the code version. Same as codeVersion.
    status str
    The status of the code version.
    buildId Number
    The build ID of the code version.
    codeDescription String
    The description of the code version.
    codeVersion String
    The code version number.
    createTime String
    The time when the code version was created, in RFC 3339 (UTC) format.
    deployEnv String
    The environment bundled with the code version. Valid values: staging, production.
    hasEnvVars Boolean
    Whether the code version bundles environment variables.
    id String
    The ID of the code version. Same as codeVersion.
    status String
    The status of the code version.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo alicloud logo
    Viewing docs for Alibaba Cloud v3.108.0
    published on Thursday, Sep 17, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial