1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. simpleapplicationserver
  5. getInstances
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.simpleapplicationserver.getInstances

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

This data source provides the Simple Application Server Instances of the current Alibaba Cloud user.

NOTE: Available in v1.135.0+.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.simpleapplicationserver.getInstances({
    ids: ["example_id"],
});
export const simpleApplicationServerInstanceId1 = ids.then(ids => ids.instances?.[0]?.id);
const nameRegex = alicloud.simpleapplicationserver.getInstances({
    nameRegex: "^my-Instance",
});
export const simpleApplicationServerInstanceId2 = nameRegex.then(nameRegex => nameRegex.instances?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.simpleapplicationserver.get_instances(ids=["example_id"])
pulumi.export("simpleApplicationServerInstanceId1", ids.instances[0].id)
name_regex = alicloud.simpleapplicationserver.get_instances(name_regex="^my-Instance")
pulumi.export("simpleApplicationServerInstanceId2", name_regex.instances[0].id)
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/simpleapplicationserver"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := simpleapplicationserver.GetInstances(ctx, &simpleapplicationserver.GetInstancesArgs{
			Ids: []string{
				"example_id",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("simpleApplicationServerInstanceId1", ids.Instances[0].Id)
		nameRegex, err := simpleapplicationserver.GetInstances(ctx, &simpleapplicationserver.GetInstancesArgs{
			NameRegex: pulumi.StringRef("^my-Instance"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("simpleApplicationServerInstanceId2", nameRegex.Instances[0].Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var ids = AliCloud.SimpleApplicationServer.GetInstances.Invoke(new()
    {
        Ids = new[]
        {
            "example_id",
        },
    });

    var nameRegex = AliCloud.SimpleApplicationServer.GetInstances.Invoke(new()
    {
        NameRegex = "^my-Instance",
    });

    return new Dictionary<string, object?>
    {
        ["simpleApplicationServerInstanceId1"] = ids.Apply(getInstancesResult => getInstancesResult.Instances[0]?.Id),
        ["simpleApplicationServerInstanceId2"] = nameRegex.Apply(getInstancesResult => getInstancesResult.Instances[0]?.Id),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.simpleapplicationserver.SimpleapplicationserverFunctions;
import com.pulumi.alicloud.simpleapplicationserver.inputs.GetInstancesArgs;
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 = SimpleapplicationserverFunctions.getInstances(GetInstancesArgs.builder()
            .ids("example_id")
            .build());

        ctx.export("simpleApplicationServerInstanceId1", ids.applyValue(getInstancesResult -> getInstancesResult.instances()[0].id()));
        final var nameRegex = SimpleapplicationserverFunctions.getInstances(GetInstancesArgs.builder()
            .nameRegex("^my-Instance")
            .build());

        ctx.export("simpleApplicationServerInstanceId2", nameRegex.applyValue(getInstancesResult -> getInstancesResult.instances()[0].id()));
    }
}
Copy
variables:
  ids:
    fn::invoke:
      function: alicloud:simpleapplicationserver:getInstances
      arguments:
        ids:
          - example_id
  nameRegex:
    fn::invoke:
      function: alicloud:simpleapplicationserver:getInstances
      arguments:
        nameRegex: ^my-Instance
outputs:
  simpleApplicationServerInstanceId1: ${ids.instances[0].id}
  simpleApplicationServerInstanceId2: ${nameRegex.instances[0].id}
Copy

Using getInstances

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 getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>
function getInstancesOutput(args: GetInstancesOutputArgs, opts?: InvokeOptions): Output<GetInstancesResult>
Copy
def get_instances(ids: Optional[Sequence[str]] = None,
                  name_regex: Optional[str] = None,
                  output_file: Optional[str] = None,
                  payment_type: Optional[str] = None,
                  status: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetInstancesResult
def get_instances_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                  name_regex: Optional[pulumi.Input[str]] = None,
                  output_file: Optional[pulumi.Input[str]] = None,
                  payment_type: Optional[pulumi.Input[str]] = None,
                  status: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetInstancesResult]
Copy
func GetInstances(ctx *Context, args *GetInstancesArgs, opts ...InvokeOption) (*GetInstancesResult, error)
func GetInstancesOutput(ctx *Context, args *GetInstancesOutputArgs, opts ...InvokeOption) GetInstancesResultOutput
Copy

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

public static class GetInstances 
{
    public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs args, InvokeOptions? opts = null)
    public static Output<GetInstancesResult> Invoke(GetInstancesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
public static Output<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:simpleapplicationserver/getInstances:getInstances
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids Changes to this property will trigger replacement. List<string>
A list of Instance IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Instance name.
OutputFile string
File name where to save data source results (after running pulumi preview).
PaymentType Changes to this property will trigger replacement. string
The paymen type of the resource. Valid values: Subscription.
Status Changes to this property will trigger replacement. string
The status of the resource. Valid values: Resetting, Running, Stopped, Upgrading.
Ids Changes to this property will trigger replacement. []string
A list of Instance IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Instance name.
OutputFile string
File name where to save data source results (after running pulumi preview).
PaymentType Changes to this property will trigger replacement. string
The paymen type of the resource. Valid values: Subscription.
Status Changes to this property will trigger replacement. string
The status of the resource. Valid values: Resetting, Running, Stopped, Upgrading.
ids Changes to this property will trigger replacement. List<String>
A list of Instance IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Instance name.
outputFile String
File name where to save data source results (after running pulumi preview).
paymentType Changes to this property will trigger replacement. String
The paymen type of the resource. Valid values: Subscription.
status Changes to this property will trigger replacement. String
The status of the resource. Valid values: Resetting, Running, Stopped, Upgrading.
ids Changes to this property will trigger replacement. string[]
A list of Instance IDs.
nameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Instance name.
outputFile string
File name where to save data source results (after running pulumi preview).
paymentType Changes to this property will trigger replacement. string
The paymen type of the resource. Valid values: Subscription.
status Changes to this property will trigger replacement. string
The status of the resource. Valid values: Resetting, Running, Stopped, Upgrading.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Instance IDs.
name_regex Changes to this property will trigger replacement. str
A regex string to filter results by Instance name.
output_file str
File name where to save data source results (after running pulumi preview).
payment_type Changes to this property will trigger replacement. str
The paymen type of the resource. Valid values: Subscription.
status Changes to this property will trigger replacement. str
The status of the resource. Valid values: Resetting, Running, Stopped, Upgrading.
ids Changes to this property will trigger replacement. List<String>
A list of Instance IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Instance name.
outputFile String
File name where to save data source results (after running pulumi preview).
paymentType Changes to this property will trigger replacement. String
The paymen type of the resource. Valid values: Subscription.
status Changes to this property will trigger replacement. String
The status of the resource. Valid values: Resetting, Running, Stopped, Upgrading.

getInstances Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
Instances List<Pulumi.AliCloud.SimpleApplicationServer.Outputs.GetInstancesInstance>
Names List<string>
NameRegex string
OutputFile string
PaymentType string
Status string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Instances []GetInstancesInstance
Names []string
NameRegex string
OutputFile string
PaymentType string
Status string
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
instances List<GetInstancesInstance>
names List<String>
nameRegex String
outputFile String
paymentType String
status String
id string
The provider-assigned unique ID for this managed resource.
ids string[]
instances GetInstancesInstance[]
names string[]
nameRegex string
outputFile string
paymentType string
status string
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
instances Sequence[GetInstancesInstance]
names Sequence[str]
name_regex str
output_file str
payment_type str
status str
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
instances List<Property Map>
names List<String>
nameRegex String
outputFile String
paymentType String
status String

Supporting Types

GetInstancesInstance

BusinessStatus This property is required. string
The billing status of the simple application server. Valid values: Normal, Expired and Overdue.
CreateTime This property is required. string
The time when the simple application server was created.
DdosStatus This property is required. string
The DDoS protection status. Valid values: Normal, BlackHole, and Defense.
ExpiredTime This property is required. string
The time when the simple application server expires.
Id This property is required. string
The ID of the Instance.
ImageId This property is required. string
The ID of the simple application server Image.
InnerIpAddress This property is required. string
The internal IP address of the simple application server.
InstanceId This property is required. string
The ID of the simple application server.
InstanceName This property is required. string
The name of the resource.
PaymentType This property is required. string
The billing method of the simple application server.
PlanId This property is required. string
The ID of the simple application server plan.
PublicIpAddress This property is required. string
The public IP address of the simple application server.
Status This property is required. string
The status of the resource.
BusinessStatus This property is required. string
The billing status of the simple application server. Valid values: Normal, Expired and Overdue.
CreateTime This property is required. string
The time when the simple application server was created.
DdosStatus This property is required. string
The DDoS protection status. Valid values: Normal, BlackHole, and Defense.
ExpiredTime This property is required. string
The time when the simple application server expires.
Id This property is required. string
The ID of the Instance.
ImageId This property is required. string
The ID of the simple application server Image.
InnerIpAddress This property is required. string
The internal IP address of the simple application server.
InstanceId This property is required. string
The ID of the simple application server.
InstanceName This property is required. string
The name of the resource.
PaymentType This property is required. string
The billing method of the simple application server.
PlanId This property is required. string
The ID of the simple application server plan.
PublicIpAddress This property is required. string
The public IP address of the simple application server.
Status This property is required. string
The status of the resource.
businessStatus This property is required. String
The billing status of the simple application server. Valid values: Normal, Expired and Overdue.
createTime This property is required. String
The time when the simple application server was created.
ddosStatus This property is required. String
The DDoS protection status. Valid values: Normal, BlackHole, and Defense.
expiredTime This property is required. String
The time when the simple application server expires.
id This property is required. String
The ID of the Instance.
imageId This property is required. String
The ID of the simple application server Image.
innerIpAddress This property is required. String
The internal IP address of the simple application server.
instanceId This property is required. String
The ID of the simple application server.
instanceName This property is required. String
The name of the resource.
paymentType This property is required. String
The billing method of the simple application server.
planId This property is required. String
The ID of the simple application server plan.
publicIpAddress This property is required. String
The public IP address of the simple application server.
status This property is required. String
The status of the resource.
businessStatus This property is required. string
The billing status of the simple application server. Valid values: Normal, Expired and Overdue.
createTime This property is required. string
The time when the simple application server was created.
ddosStatus This property is required. string
The DDoS protection status. Valid values: Normal, BlackHole, and Defense.
expiredTime This property is required. string
The time when the simple application server expires.
id This property is required. string
The ID of the Instance.
imageId This property is required. string
The ID of the simple application server Image.
innerIpAddress This property is required. string
The internal IP address of the simple application server.
instanceId This property is required. string
The ID of the simple application server.
instanceName This property is required. string
The name of the resource.
paymentType This property is required. string
The billing method of the simple application server.
planId This property is required. string
The ID of the simple application server plan.
publicIpAddress This property is required. string
The public IP address of the simple application server.
status This property is required. string
The status of the resource.
business_status This property is required. str
The billing status of the simple application server. Valid values: Normal, Expired and Overdue.
create_time This property is required. str
The time when the simple application server was created.
ddos_status This property is required. str
The DDoS protection status. Valid values: Normal, BlackHole, and Defense.
expired_time This property is required. str
The time when the simple application server expires.
id This property is required. str
The ID of the Instance.
image_id This property is required. str
The ID of the simple application server Image.
inner_ip_address This property is required. str
The internal IP address of the simple application server.
instance_id This property is required. str
The ID of the simple application server.
instance_name This property is required. str
The name of the resource.
payment_type This property is required. str
The billing method of the simple application server.
plan_id This property is required. str
The ID of the simple application server plan.
public_ip_address This property is required. str
The public IP address of the simple application server.
status This property is required. str
The status of the resource.
businessStatus This property is required. String
The billing status of the simple application server. Valid values: Normal, Expired and Overdue.
createTime This property is required. String
The time when the simple application server was created.
ddosStatus This property is required. String
The DDoS protection status. Valid values: Normal, BlackHole, and Defense.
expiredTime This property is required. String
The time when the simple application server expires.
id This property is required. String
The ID of the Instance.
imageId This property is required. String
The ID of the simple application server Image.
innerIpAddress This property is required. String
The internal IP address of the simple application server.
instanceId This property is required. String
The ID of the simple application server.
instanceName This property is required. String
The name of the resource.
paymentType This property is required. String
The billing method of the simple application server.
planId This property is required. String
The ID of the simple application server plan.
publicIpAddress This property is required. String
The public IP address of the simple application server.
status This property is required. String
The status of the resource.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi