1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. threatdetection
  5. getInstances
Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi

alicloud.threatdetection.getInstances

Explore with Pulumi AI

Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi

This data source provides Threat Detection Instance available to the user.What is Instance

NOTE: Available in 1.199.0+

Example Usage

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

const _default = alicloud.threatdetection.getInstances({
    ids: [defaultAlicloudThreatDetectionInstance.id],
});
export const alicloudThreatDetectionInstanceExampleId = _default.then(_default => _default.instances?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

default = alicloud.threatdetection.get_instances(ids=[default_alicloud_threat_detection_instance["id"]])
pulumi.export("alicloudThreatDetectionInstanceExampleId", default.instances[0].id)
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/threatdetection"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := threatdetection.GetInstances(ctx, &threatdetection.GetInstancesArgs{
Ids: interface{}{
defaultAlicloudThreatDetectionInstance.Id,
},
}, nil);
if err != nil {
return err
}
ctx.Export("alicloudThreatDetectionInstanceExampleId", _default.Instances[0].Id)
return nil
})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var @default = AliCloud.ThreatDetection.GetInstances.Invoke(new()
    {
        Ids = new[]
        {
            defaultAlicloudThreatDetectionInstance.Id,
        },
    });

    return new Dictionary<string, object?>
    {
        ["alicloudThreatDetectionInstanceExampleId"] = @default.Apply(@default => @default.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.threatdetection.ThreatdetectionFunctions;
import com.pulumi.alicloud.threatdetection.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 default = ThreatdetectionFunctions.getInstances(GetInstancesArgs.builder()
            .ids(defaultAlicloudThreatDetectionInstance.id())
            .build());

        ctx.export("alicloudThreatDetectionInstanceExampleId", default_.instances()[0].id());
    }
}
Copy
variables:
  default:
    fn::invoke:
      function: alicloud:threatdetection:getInstances
      arguments:
        ids:
          - ${defaultAlicloudThreatDetectionInstance.id}
outputs:
  alicloudThreatDetectionInstanceExampleId: ${default.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,
                  instance_id: Optional[str] = None,
                  output_file: Optional[str] = None,
                  page_number: Optional[int] = None,
                  page_size: Optional[int] = None,
                  renew_status: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetInstancesResult
def get_instances_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                  instance_id: 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,
                  renew_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:threatdetection/getInstances:getInstances
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids List<string>
A list of Instance IDs.
InstanceId Changes to this property will trigger replacement. string
The first ID of the resource
OutputFile string
File name where to save data source results (after running pulumi preview).
PageNumber int
PageSize int
RenewStatus Changes to this property will trigger replacement. string
The renewal status of the specified instance. Valid values: AutoRenewal, ManualRenewal, NotRenewal.
Ids []string
A list of Instance IDs.
InstanceId Changes to this property will trigger replacement. string
The first ID of the resource
OutputFile string
File name where to save data source results (after running pulumi preview).
PageNumber int
PageSize int
RenewStatus Changes to this property will trigger replacement. string
The renewal status of the specified instance. Valid values: AutoRenewal, ManualRenewal, NotRenewal.
ids List<String>
A list of Instance IDs.
instanceId Changes to this property will trigger replacement. String
The first ID of the resource
outputFile String
File name where to save data source results (after running pulumi preview).
pageNumber Integer
pageSize Integer
renewStatus Changes to this property will trigger replacement. String
The renewal status of the specified instance. Valid values: AutoRenewal, ManualRenewal, NotRenewal.
ids string[]
A list of Instance IDs.
instanceId Changes to this property will trigger replacement. string
The first ID of the resource
outputFile string
File name where to save data source results (after running pulumi preview).
pageNumber number
pageSize number
renewStatus Changes to this property will trigger replacement. string
The renewal status of the specified instance. Valid values: AutoRenewal, ManualRenewal, NotRenewal.
ids Sequence[str]
A list of Instance IDs.
instance_id Changes to this property will trigger replacement. str
The first ID of the resource
output_file str
File name where to save data source results (after running pulumi preview).
page_number int
page_size int
renew_status Changes to this property will trigger replacement. str
The renewal status of the specified instance. Valid values: AutoRenewal, ManualRenewal, NotRenewal.
ids List<String>
A list of Instance IDs.
instanceId Changes to this property will trigger replacement. String
The first ID of the resource
outputFile String
File name where to save data source results (after running pulumi preview).
pageNumber Number
pageSize Number
renewStatus Changes to this property will trigger replacement. String
The renewal status of the specified instance. Valid values: AutoRenewal, ManualRenewal, NotRenewal.

getInstances Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
A list of Instance IDs.
Instances List<Pulumi.AliCloud.ThreatDetection.Outputs.GetInstancesInstance>
A list of Instance Entries. Each element contains the following attributes:
InstanceId string
The first ID of the resource
OutputFile string
PageNumber int
PageSize int
RenewStatus string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
A list of Instance IDs.
Instances []GetInstancesInstance
A list of Instance Entries. Each element contains the following attributes:
InstanceId string
The first ID of the resource
OutputFile string
PageNumber int
PageSize int
RenewStatus string
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
A list of Instance IDs.
instances List<GetInstancesInstance>
A list of Instance Entries. Each element contains the following attributes:
instanceId String
The first ID of the resource
outputFile String
pageNumber Integer
pageSize Integer
renewStatus String
id string
The provider-assigned unique ID for this managed resource.
ids string[]
A list of Instance IDs.
instances GetInstancesInstance[]
A list of Instance Entries. Each element contains the following attributes:
instanceId string
The first ID of the resource
outputFile string
pageNumber number
pageSize number
renewStatus string
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
A list of Instance IDs.
instances Sequence[GetInstancesInstance]
A list of Instance Entries. Each element contains the following attributes:
instance_id str
The first ID of the resource
output_file str
page_number int
page_size int
renew_status str
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
A list of Instance IDs.
instances List<Property Map>
A list of Instance Entries. Each element contains the following attributes:
instanceId String
The first ID of the resource
outputFile String
pageNumber Number
pageSize Number
renewStatus String

Supporting Types

GetInstancesInstance

CreateTime This property is required. string
The creation time of the resource
Id This property is required. string
ID of the instance.
InstanceId This property is required. string
The first ID of the resource
PaymentType This property is required. string
The payment type of the resource.
Status This property is required. string
The status of the resource.
CreateTime This property is required. string
The creation time of the resource
Id This property is required. string
ID of the instance.
InstanceId This property is required. string
The first ID of the resource
PaymentType This property is required. string
The payment type of the resource.
Status This property is required. string
The status of the resource.
createTime This property is required. String
The creation time of the resource
id This property is required. String
ID of the instance.
instanceId This property is required. String
The first ID of the resource
paymentType This property is required. String
The payment type of the resource.
status This property is required. String
The status of the resource.
createTime This property is required. string
The creation time of the resource
id This property is required. string
ID of the instance.
instanceId This property is required. string
The first ID of the resource
paymentType This property is required. string
The payment type of the resource.
status This property is required. string
The status of the resource.
create_time This property is required. str
The creation time of the resource
id This property is required. str
ID of the instance.
instance_id This property is required. str
The first ID of the resource
payment_type This property is required. str
The payment type of the resource.
status This property is required. str
The status of the resource.
createTime This property is required. String
The creation time of the resource
id This property is required. String
ID of the instance.
instanceId This property is required. String
The first ID of the resource
paymentType This property is required. String
The payment type of the resource.
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.75.0 published on Friday, Mar 7, 2025 by Pulumi