Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.apigateway.getBackends
Explore with Pulumi AI
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, &apigateway.GetBackendsArgs{}, 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.
- Name
Regex string - A regex string to filter Api Gateway Backends by name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Page
Number int - Page
Size int
- Ids []string
- A list of Backends IDs.
- Name
Regex string - A regex string to filter Api Gateway Backends by name.
- Output
File string - 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.
- name
Regex String - A regex string to filter Api Gateway Backends by name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - page
Number Integer - page
Size Integer
- ids string[]
- A list of Backends IDs.
- name
Regex string - A regex string to filter Api Gateway Backends by name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - page
Number number - page
Size 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.
- name
Regex String - A regex string to filter Api Gateway Backends by name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - page
Number Number - page
Size Number
getBackends Result
The following output properties are available:
- Backends
List<Pulumi.
Ali Cloud. Api Gateway. Outputs. Get Backends Backend> - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Name
Regex string - Output
File string - Page
Number int - Page
Size int
- Backends
[]Get
Backends Backend - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Name
Regex string - Output
File string - Page
Number int - Page
Size int
- backends
List<Get
Backends Backend> - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- name
Regex String - output
File String - page
Number Integer - page
Size Integer
- backends
Get
Backends Backend[] - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- name
Regex string - output
File string - page
Number number - page
Size number
- backends
Sequence[Get
Backends Backend] - 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>
- name
Regex String - output
File String - page
Number Number - page
Size Number
Supporting Types
GetBackendsBackend
- Backend
Id string - The id of the Backend.
- Backend
Name string - The name of the Backend.
- Backend
Type string - The type of the Backend.
- Create
Time string - The created time of the Backend.
- Description string
- The description of the Backend.
- Id string
- Modified
Time string - The modified time of the Backend.
- Backend
Id string - The id of the Backend.
- Backend
Name string - The name of the Backend.
- Backend
Type string - The type of the Backend.
- Create
Time string - The created time of the Backend.
- Description string
- The description of the Backend.
- Id string
- Modified
Time string - The modified time of the Backend.
- backend
Id String - The id of the Backend.
- backend
Name String - The name of the Backend.
- backend
Type String - The type of the Backend.
- create
Time String - The created time of the Backend.
- description String
- The description of the Backend.
- id String
- modified
Time String - The modified time of the Backend.
- backend
Id string - The id of the Backend.
- backend
Name string - The name of the Backend.
- backend
Type string - The type of the Backend.
- create
Time string - The created time of the Backend.
- description string
- The description of the Backend.
- id string
- modified
Time 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.
- backend
Id String - The id of the Backend.
- backend
Name String - The name of the Backend.
- backend
Type String - The type of the Backend.
- create
Time String - The created time of the Backend.
- description String
- The description of the Backend.
- id String
- modified
Time 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.