1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. apigateway
  5. getBackends
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.apigateway.getBackends

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    This data source provides the Api Gateway Backends of the current Alibaba Cloud user.

    NOTE: Available in v1.181.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.apigateway.getBackends({});
    export const apiGatewayBackendId1 = ids.then(ids => ids.backends?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.apigateway.get_backends()
    pulumi.export("apiGatewayBackendId1", ids.backends[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/apigateway"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := apigateway.GetBackends(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("apiGatewayBackendId1", ids.Backends[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.ApiGateway.GetBackends.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["apiGatewayBackendId1"] = ids.Apply(getBackendsResult => getBackendsResult.Backends[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.apigateway.ApigatewayFunctions;
    import com.pulumi.alicloud.apigateway.inputs.GetBackendsArgs;
    import java.util.List;
    import java.util.ArrayList;
    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 ids = ApigatewayFunctions.getBackends();
    
            ctx.export("apiGatewayBackendId1", ids.applyValue(getBackendsResult -> getBackendsResult.backends()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:apigateway:getBackends
          Arguments: {}
    outputs:
      apiGatewayBackendId1: ${ids.backends[0].id}
    

    Using getBackends

    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 getBackends(args: GetBackendsArgs, opts?: InvokeOptions): Promise<GetBackendsResult>
    function getBackendsOutput(args: GetBackendsOutputArgs, opts?: InvokeOptions): Output<GetBackendsResult>
    def get_backends(ids: Optional[Sequence[str]] = None,
                     name_regex: Optional[str] = None,
                     output_file: Optional[str] = None,
                     page_number: Optional[int] = None,
                     page_size: Optional[int] = None,
                     opts: Optional[InvokeOptions] = None) -> GetBackendsResult
    def get_backends_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                     name_regex: Optional[pulumi.Input[str]] = None,
                     output_file: Optional[pulumi.Input[str]] = None,
                     page_number: Optional[pulumi.Input[int]] = None,
                     page_size: Optional[pulumi.Input[int]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetBackendsResult]
    func GetBackends(ctx *Context, args *GetBackendsArgs, opts ...InvokeOption) (*GetBackendsResult, error)
    func GetBackendsOutput(ctx *Context, args *GetBackendsOutputArgs, opts ...InvokeOption) GetBackendsResultOutput

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

    public static class GetBackends 
    {
        public static Task<GetBackendsResult> InvokeAsync(GetBackendsArgs args, InvokeOptions? opts = null)
        public static Output<GetBackendsResult> Invoke(GetBackendsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetBackendsResult> getBackends(GetBackendsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:apigateway/getBackends:getBackends
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Backends IDs.
    NameRegex string
    A regex string to filter Api Gateway Backends by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    Ids []string
    A list of Backends IDs.
    NameRegex string
    A regex string to filter Api Gateway Backends by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    ids List<String>
    A list of Backends IDs.
    nameRegex String
    A regex string to filter Api Gateway Backends by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Integer
    pageSize Integer
    ids string[]
    A list of Backends IDs.
    nameRegex string
    A regex string to filter Api Gateway Backends by name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    pageNumber number
    pageSize number
    ids Sequence[str]
    A list of Backends IDs.
    name_regex str
    A regex string to filter Api Gateway Backends by name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    page_number int
    page_size int
    ids List<String>
    A list of Backends IDs.
    nameRegex String
    A regex string to filter Api Gateway Backends by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Number
    pageSize Number

    getBackends Result

    The following output properties are available:

    Backends List<Pulumi.AliCloud.ApiGateway.Outputs.GetBackendsBackend>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    Backends []GetBackendsBackend
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    backends List<GetBackendsBackend>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    nameRegex String
    outputFile String
    pageNumber Integer
    pageSize Integer
    backends GetBackendsBackend[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    nameRegex string
    outputFile string
    pageNumber number
    pageSize number
    backends Sequence[GetBackendsBackend]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    name_regex str
    output_file str
    page_number int
    page_size int
    backends List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    nameRegex String
    outputFile String
    pageNumber Number
    pageSize Number

    Supporting Types

    GetBackendsBackend

    BackendId string
    The id of the Backend.
    BackendName string
    The name of the Backend.
    BackendType string
    The type of the Backend.
    CreateTime string
    The created time of the Backend.
    Description string
    The description of the Backend.
    Id string
    ModifiedTime string
    The modified time of the Backend.
    BackendId string
    The id of the Backend.
    BackendName string
    The name of the Backend.
    BackendType string
    The type of the Backend.
    CreateTime string
    The created time of the Backend.
    Description string
    The description of the Backend.
    Id string
    ModifiedTime string
    The modified time of the Backend.
    backendId String
    The id of the Backend.
    backendName String
    The name of the Backend.
    backendType String
    The type of the Backend.
    createTime String
    The created time of the Backend.
    description String
    The description of the Backend.
    id String
    modifiedTime String
    The modified time of the Backend.
    backendId string
    The id of the Backend.
    backendName string
    The name of the Backend.
    backendType string
    The type of the Backend.
    createTime string
    The created time of the Backend.
    description string
    The description of the Backend.
    id string
    modifiedTime string
    The modified time of the Backend.
    backend_id str
    The id of the Backend.
    backend_name str
    The name of the Backend.
    backend_type str
    The type of the Backend.
    create_time str
    The created time of the Backend.
    description str
    The description of the Backend.
    id str
    modified_time str
    The modified time of the Backend.
    backendId String
    The id of the Backend.
    backendName String
    The name of the Backend.
    backendType String
    The type of the Backend.
    createTime String
    The created time of the Backend.
    description String
    The description of the Backend.
    id String
    modifiedTime String
    The modified time of the Backend.

    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
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi