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

alicloud.threatdetection.getAssets

Explore with Pulumi AI

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

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

NOTE: Available since v1.195.0.

Example Usage

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

const _default = alicloud.threatdetection.getAssets({});
export const alicloudThreatDetectionAssetExampleId = _default.then(_default => _default.assets?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

default = alicloud.threatdetection.get_assets()
pulumi.export("alicloudThreatDetectionAssetExampleId", default.assets[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.GetAssets(ctx, &threatdetection.GetAssetsArgs{}, nil)
		if err != nil {
			return err
		}
		ctx.Export("alicloudThreatDetectionAssetExampleId", _default.Assets[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.GetAssets.Invoke();

    return new Dictionary<string, object?>
    {
        ["alicloudThreatDetectionAssetExampleId"] = @default.Apply(@default => @default.Apply(getAssetsResult => getAssetsResult.Assets[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.GetAssetsArgs;
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.getAssets();

        ctx.export("alicloudThreatDetectionAssetExampleId", default_.assets()[0].id());
    }
}
Copy
variables:
  default:
    fn::invoke:
      function: alicloud:threatdetection:getAssets
      arguments: {}
outputs:
  alicloudThreatDetectionAssetExampleId: ${default.assets[0].id}
Copy

Using getAssets

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 getAssets(args: GetAssetsArgs, opts?: InvokeOptions): Promise<GetAssetsResult>
function getAssetsOutput(args: GetAssetsOutputArgs, opts?: InvokeOptions): Output<GetAssetsResult>
Copy
def get_assets(criteria: Optional[str] = None,
               ids: Optional[Sequence[str]] = None,
               importance: Optional[int] = None,
               logical_exp: Optional[str] = None,
               machine_types: Optional[str] = None,
               no_group_trace: Optional[bool] = None,
               output_file: Optional[str] = None,
               page_number: Optional[int] = None,
               page_size: Optional[int] = None,
               opts: Optional[InvokeOptions] = None) -> GetAssetsResult
def get_assets_output(criteria: Optional[pulumi.Input[str]] = None,
               ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
               importance: Optional[pulumi.Input[int]] = None,
               logical_exp: Optional[pulumi.Input[str]] = None,
               machine_types: Optional[pulumi.Input[str]] = None,
               no_group_trace: Optional[pulumi.Input[bool]] = 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[GetAssetsResult]
Copy
func GetAssets(ctx *Context, args *GetAssetsArgs, opts ...InvokeOption) (*GetAssetsResult, error)
func GetAssetsOutput(ctx *Context, args *GetAssetsOutputArgs, opts ...InvokeOption) GetAssetsResultOutput
Copy

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

public static class GetAssets 
{
    public static Task<GetAssetsResult> InvokeAsync(GetAssetsArgs args, InvokeOptions? opts = null)
    public static Output<GetAssetsResult> Invoke(GetAssetsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAssetsResult> getAssets(GetAssetsArgs args, InvokeOptions options)
public static Output<GetAssetsResult> getAssets(GetAssetsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:threatdetection/getAssets:getAssets
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Criteria Changes to this property will trigger replacement. string
Set the conditions for searching assets. This parameter is in JSON format. Note the case when you enter the parameter. NOTE: You can search for assets by using conditions such as the instance ID, instance name, VPC ID, region, and public IP address of the asset.
Ids List<string>
A list of Asset IDs.
Importance Changes to this property will trigger replacement. int
Set asset importance. Value:

  • 2: Significant assets
  • 1: General assets
  • 0: Test asset
LogicalExp Changes to this property will trigger replacement. string
Set the logical relationship between multiple search conditions. The default value is OR. Valid values:

  • OR: indicates that the relationship between multiple search conditions is OR.
  • AND: indicates that the relationship between multiple search conditions is AND.
MachineTypes Changes to this property will trigger replacement. string
The type of asset to query. Value:

  • ecs: server.
  • cloud_product: Cloud product.
NoGroupTrace Changes to this property will trigger replacement. bool
Specifies whether to internationalize the name of the default group. Default value: false
OutputFile string
File name where to save data source results (after running pulumi preview).
PageNumber int
PageSize int
Criteria Changes to this property will trigger replacement. string
Set the conditions for searching assets. This parameter is in JSON format. Note the case when you enter the parameter. NOTE: You can search for assets by using conditions such as the instance ID, instance name, VPC ID, region, and public IP address of the asset.
Ids []string
A list of Asset IDs.
Importance Changes to this property will trigger replacement. int
Set asset importance. Value:

  • 2: Significant assets
  • 1: General assets
  • 0: Test asset
LogicalExp Changes to this property will trigger replacement. string
Set the logical relationship between multiple search conditions. The default value is OR. Valid values:

  • OR: indicates that the relationship between multiple search conditions is OR.
  • AND: indicates that the relationship between multiple search conditions is AND.
MachineTypes Changes to this property will trigger replacement. string
The type of asset to query. Value:

  • ecs: server.
  • cloud_product: Cloud product.
NoGroupTrace Changes to this property will trigger replacement. bool
Specifies whether to internationalize the name of the default group. Default value: false
OutputFile string
File name where to save data source results (after running pulumi preview).
PageNumber int
PageSize int
criteria Changes to this property will trigger replacement. String
Set the conditions for searching assets. This parameter is in JSON format. Note the case when you enter the parameter. NOTE: You can search for assets by using conditions such as the instance ID, instance name, VPC ID, region, and public IP address of the asset.
ids List<String>
A list of Asset IDs.
importance Changes to this property will trigger replacement. Integer
Set asset importance. Value:

  • 2: Significant assets
  • 1: General assets
  • 0: Test asset
logicalExp Changes to this property will trigger replacement. String
Set the logical relationship between multiple search conditions. The default value is OR. Valid values:

  • OR: indicates that the relationship between multiple search conditions is OR.
  • AND: indicates that the relationship between multiple search conditions is AND.
machineTypes Changes to this property will trigger replacement. String
The type of asset to query. Value:

  • ecs: server.
  • cloud_product: Cloud product.
noGroupTrace Changes to this property will trigger replacement. Boolean
Specifies whether to internationalize the name of the default group. Default value: false
outputFile String
File name where to save data source results (after running pulumi preview).
pageNumber Integer
pageSize Integer
criteria Changes to this property will trigger replacement. string
Set the conditions for searching assets. This parameter is in JSON format. Note the case when you enter the parameter. NOTE: You can search for assets by using conditions such as the instance ID, instance name, VPC ID, region, and public IP address of the asset.
ids string[]
A list of Asset IDs.
importance Changes to this property will trigger replacement. number
Set asset importance. Value:

  • 2: Significant assets
  • 1: General assets
  • 0: Test asset
logicalExp Changes to this property will trigger replacement. string
Set the logical relationship between multiple search conditions. The default value is OR. Valid values:

  • OR: indicates that the relationship between multiple search conditions is OR.
  • AND: indicates that the relationship between multiple search conditions is AND.
machineTypes Changes to this property will trigger replacement. string
The type of asset to query. Value:

  • ecs: server.
  • cloud_product: Cloud product.
noGroupTrace Changes to this property will trigger replacement. boolean
Specifies whether to internationalize the name of the default group. Default value: false
outputFile string
File name where to save data source results (after running pulumi preview).
pageNumber number
pageSize number
criteria Changes to this property will trigger replacement. str
Set the conditions for searching assets. This parameter is in JSON format. Note the case when you enter the parameter. NOTE: You can search for assets by using conditions such as the instance ID, instance name, VPC ID, region, and public IP address of the asset.
ids Sequence[str]
A list of Asset IDs.
importance Changes to this property will trigger replacement. int
Set asset importance. Value:

  • 2: Significant assets
  • 1: General assets
  • 0: Test asset
logical_exp Changes to this property will trigger replacement. str
Set the logical relationship between multiple search conditions. The default value is OR. Valid values:

  • OR: indicates that the relationship between multiple search conditions is OR.
  • AND: indicates that the relationship between multiple search conditions is AND.
machine_types Changes to this property will trigger replacement. str
The type of asset to query. Value:

  • ecs: server.
  • cloud_product: Cloud product.
no_group_trace Changes to this property will trigger replacement. bool
Specifies whether to internationalize the name of the default group. Default value: false
output_file str
File name where to save data source results (after running pulumi preview).
page_number int
page_size int
criteria Changes to this property will trigger replacement. String
Set the conditions for searching assets. This parameter is in JSON format. Note the case when you enter the parameter. NOTE: You can search for assets by using conditions such as the instance ID, instance name, VPC ID, region, and public IP address of the asset.
ids List<String>
A list of Asset IDs.
importance Changes to this property will trigger replacement. Number
Set asset importance. Value:

  • 2: Significant assets
  • 1: General assets
  • 0: Test asset
logicalExp Changes to this property will trigger replacement. String
Set the logical relationship between multiple search conditions. The default value is OR. Valid values:

  • OR: indicates that the relationship between multiple search conditions is OR.
  • AND: indicates that the relationship between multiple search conditions is AND.
machineTypes Changes to this property will trigger replacement. String
The type of asset to query. Value:

  • ecs: server.
  • cloud_product: Cloud product.
noGroupTrace Changes to this property will trigger replacement. Boolean
Specifies whether to internationalize the name of the default group. Default value: false
outputFile String
File name where to save data source results (after running pulumi preview).
pageNumber Number
pageSize Number

getAssets Result

The following output properties are available:

Assets List<Pulumi.AliCloud.ThreatDetection.Outputs.GetAssetsAsset>
A list of Asset Entries. Each element contains the following attributes:
Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
A list of Asset IDs.
Criteria string
Importance int
LogicalExp string
MachineTypes string
NoGroupTrace bool
OutputFile string
PageNumber int
PageSize int
Assets []GetAssetsAsset
A list of Asset Entries. Each element contains the following attributes:
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
A list of Asset IDs.
Criteria string
Importance int
LogicalExp string
MachineTypes string
NoGroupTrace bool
OutputFile string
PageNumber int
PageSize int
assets List<GetAssetsAsset>
A list of Asset Entries. Each element contains the following attributes:
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
A list of Asset IDs.
criteria String
importance Integer
logicalExp String
machineTypes String
noGroupTrace Boolean
outputFile String
pageNumber Integer
pageSize Integer
assets GetAssetsAsset[]
A list of Asset Entries. Each element contains the following attributes:
id string
The provider-assigned unique ID for this managed resource.
ids string[]
A list of Asset IDs.
criteria string
importance number
logicalExp string
machineTypes string
noGroupTrace boolean
outputFile string
pageNumber number
pageSize number
assets Sequence[GetAssetsAsset]
A list of Asset Entries. Each element contains the following attributes:
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
A list of Asset IDs.
criteria str
importance int
logical_exp str
machine_types str
no_group_trace bool
output_file str
page_number int
page_size int
assets List<Property Map>
A list of Asset Entries. Each element contains the following attributes:
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
A list of Asset IDs.
criteria String
importance Number
logicalExp String
machineTypes String
noGroupTrace Boolean
outputFile String
pageNumber Number
pageSize Number

Supporting Types

GetAssetsAsset

CreateTime This property is required. string
The creation time of the resource
Id This property is required. string
The ID of the instance.
Uuid This property is required. string
The UUID of the instance.
CreateTime This property is required. string
The creation time of the resource
Id This property is required. string
The ID of the instance.
Uuid This property is required. string
The UUID of the instance.
createTime This property is required. String
The creation time of the resource
id This property is required. String
The ID of the instance.
uuid This property is required. String
The UUID of the instance.
createTime This property is required. string
The creation time of the resource
id This property is required. string
The ID of the instance.
uuid This property is required. string
The UUID of the instance.
create_time This property is required. str
The creation time of the resource
id This property is required. str
The ID of the instance.
uuid This property is required. str
The UUID of the instance.
createTime This property is required. String
The creation time of the resource
id This property is required. String
The ID of the instance.
uuid This property is required. String
The UUID of the instance.

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