Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi
alicloud.actiontrail.getTrails
Explore with Pulumi AI
This data source provides a list of ActionTrail Trails in an Alibaba Cloud account according to the specified filters.
NOTE: Available in 1.95.0+
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const _default = alicloud.actiontrail.getTrails({
    nameRegex: "tf-testacc-actiontrail",
});
export const trailName = _default.then(_default => _default.trails?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.actiontrail.get_trails(name_regex="tf-testacc-actiontrail")
pulumi.export("trailName", default.trails[0].id)
package main
import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/actiontrail"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_default, err := actiontrail.GetTrails(ctx, &actiontrail.GetTrailsArgs{
			NameRegex: pulumi.StringRef("tf-testacc-actiontrail"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("trailName", _default.Trails[0].Id)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() => 
{
    var @default = AliCloud.ActionTrail.GetTrails.Invoke(new()
    {
        NameRegex = "tf-testacc-actiontrail",
    });
    return new Dictionary<string, object?>
    {
        ["trailName"] = @default.Apply(@default => @default.Apply(getTrailsResult => getTrailsResult.Trails[0]?.Id)),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.actiontrail.ActiontrailFunctions;
import com.pulumi.alicloud.actiontrail.inputs.GetTrailsArgs;
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 = ActiontrailFunctions.getTrails(GetTrailsArgs.builder()
            .nameRegex("tf-testacc-actiontrail")
            .build());
        ctx.export("trailName", default_.trails()[0].id());
    }
}
variables:
  default:
    fn::invoke:
      function: alicloud:actiontrail:getTrails
      arguments:
        nameRegex: tf-testacc-actiontrail
outputs:
  trailName: ${default.trails[0].id}
Using getTrails
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 getTrails(args: GetTrailsArgs, opts?: InvokeOptions): Promise<GetTrailsResult>
function getTrailsOutput(args: GetTrailsOutputArgs, opts?: InvokeOptions): Output<GetTrailsResult>def get_trails(ids: Optional[Sequence[str]] = None,
               include_organization_trail: Optional[bool] = None,
               include_shadow_trails: Optional[bool] = None,
               name_regex: Optional[str] = None,
               output_file: Optional[str] = None,
               status: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetTrailsResult
def get_trails_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
               include_organization_trail: Optional[pulumi.Input[bool]] = None,
               include_shadow_trails: Optional[pulumi.Input[bool]] = None,
               name_regex: Optional[pulumi.Input[str]] = None,
               output_file: Optional[pulumi.Input[str]] = None,
               status: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetTrailsResult]func GetTrails(ctx *Context, args *GetTrailsArgs, opts ...InvokeOption) (*GetTrailsResult, error)
func GetTrailsOutput(ctx *Context, args *GetTrailsOutputArgs, opts ...InvokeOption) GetTrailsResultOutput> Note: This function is named GetTrails in the Go SDK.
public static class GetTrails 
{
    public static Task<GetTrailsResult> InvokeAsync(GetTrailsArgs args, InvokeOptions? opts = null)
    public static Output<GetTrailsResult> Invoke(GetTrailsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetTrailsResult> getTrails(GetTrailsArgs args, InvokeOptions options)
public static Output<GetTrailsResult> getTrails(GetTrailsArgs args, InvokeOptions options)
fn::invoke:
  function: alicloud:actiontrail/getTrails:getTrails
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Ids List<string>
- A list of ActionTrail Trail IDs. It is the same as trail name.
- IncludeOrganization boolTrail 
- Whether to show organization tracking. Default to false.
- IncludeShadow boolTrails 
- Whether to show shadow tracking. Default to false.
- NameRegex string
- A regex string to filter results by trail name.
- OutputFile string
- File name where to save data source results (after running pulumi preview).
- Status string
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- Ids []string
- A list of ActionTrail Trail IDs. It is the same as trail name.
- IncludeOrganization boolTrail 
- Whether to show organization tracking. Default to false.
- IncludeShadow boolTrails 
- Whether to show shadow tracking. Default to false.
- NameRegex string
- A regex string to filter results by trail name.
- OutputFile string
- File name where to save data source results (after running pulumi preview).
- Status string
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- ids List<String>
- A list of ActionTrail Trail IDs. It is the same as trail name.
- includeOrganization BooleanTrail 
- Whether to show organization tracking. Default to false.
- includeShadow BooleanTrails 
- Whether to show shadow tracking. Default to false.
- nameRegex String
- A regex string to filter results by trail name.
- outputFile String
- File name where to save data source results (after running pulumi preview).
- status String
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- ids string[]
- A list of ActionTrail Trail IDs. It is the same as trail name.
- includeOrganization booleanTrail 
- Whether to show organization tracking. Default to false.
- includeShadow booleanTrails 
- Whether to show shadow tracking. Default to false.
- nameRegex string
- A regex string to filter results by trail name.
- outputFile string
- File name where to save data source results (after running pulumi preview).
- status string
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- ids Sequence[str]
- A list of ActionTrail Trail IDs. It is the same as trail name.
- include_organization_ booltrail 
- Whether to show organization tracking. Default to false.
- include_shadow_ booltrails 
- Whether to show shadow tracking. Default to false.
- name_regex str
- A regex string to filter results by trail name.
- output_file str
- File name where to save data source results (after running pulumi preview).
- status str
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- ids List<String>
- A list of ActionTrail Trail IDs. It is the same as trail name.
- includeOrganization BooleanTrail 
- Whether to show organization tracking. Default to false.
- includeShadow BooleanTrails 
- Whether to show shadow tracking. Default to false.
- nameRegex String
- A regex string to filter results by trail name.
- outputFile String
- File name where to save data source results (after running pulumi preview).
- status String
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
getTrails Result
The following output properties are available:
- Actiontrails
List<Pulumi.Ali Cloud. Action Trail. Outputs. Get Trails Actiontrail> 
- Field actiontrailshas been deprecated from version 1.95.0. Usetrailsinstead."
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of ActionTrail Trail ids. It is the same as trail name.
- Names List<string>
- A list of trail names.
- Trails
List<Pulumi.Ali Cloud. Action Trail. Outputs. Get Trails Trail> 
- A list of ActionTrail Trails. Each element contains the following attributes:
- IncludeOrganization boolTrail 
- IncludeShadow boolTrails 
- NameRegex string
- OutputFile string
- Status string
- The status of the ActionTrail Trail.
- Actiontrails
[]GetTrails Actiontrail 
- Field actiontrailshas been deprecated from version 1.95.0. Usetrailsinstead."
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of ActionTrail Trail ids. It is the same as trail name.
- Names []string
- A list of trail names.
- Trails
[]GetTrails Trail 
- A list of ActionTrail Trails. Each element contains the following attributes:
- IncludeOrganization boolTrail 
- IncludeShadow boolTrails 
- NameRegex string
- OutputFile string
- Status string
- The status of the ActionTrail Trail.
- actiontrails
List<GetTrails Actiontrail> 
- Field actiontrailshas been deprecated from version 1.95.0. Usetrailsinstead."
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of ActionTrail Trail ids. It is the same as trail name.
- names List<String>
- A list of trail names.
- trails
List<GetTrails Trail> 
- A list of ActionTrail Trails. Each element contains the following attributes:
- includeOrganization BooleanTrail 
- includeShadow BooleanTrails 
- nameRegex String
- outputFile String
- status String
- The status of the ActionTrail Trail.
- actiontrails
GetTrails Actiontrail[] 
- Field actiontrailshas been deprecated from version 1.95.0. Usetrailsinstead."
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of ActionTrail Trail ids. It is the same as trail name.
- names string[]
- A list of trail names.
- trails
GetTrails Trail[] 
- A list of ActionTrail Trails. Each element contains the following attributes:
- includeOrganization booleanTrail 
- includeShadow booleanTrails 
- nameRegex string
- outputFile string
- status string
- The status of the ActionTrail Trail.
- actiontrails
Sequence[GetTrails Actiontrail] 
- Field actiontrailshas been deprecated from version 1.95.0. Usetrailsinstead."
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of ActionTrail Trail ids. It is the same as trail name.
- names Sequence[str]
- A list of trail names.
- trails
Sequence[GetTrails Trail] 
- A list of ActionTrail Trails. Each element contains the following attributes:
- include_organization_ booltrail 
- include_shadow_ booltrails 
- name_regex str
- output_file str
- status str
- The status of the ActionTrail Trail.
- actiontrails List<Property Map>
- Field actiontrailshas been deprecated from version 1.95.0. Usetrailsinstead."
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of ActionTrail Trail ids. It is the same as trail name.
- names List<String>
- A list of trail names.
- trails List<Property Map>
- A list of ActionTrail Trails. Each element contains the following attributes:
- includeOrganization BooleanTrail 
- includeShadow BooleanTrails 
- nameRegex String
- outputFile String
- status String
- The status of the ActionTrail Trail.
Supporting Types
GetTrailsActiontrail  
- EventRw string
- Indicates whether the event is a read or a write event.
- Id string
- The id of the ActionTrail Trail. It is the same as trail name.
- IsOrganization boolTrail 
- OssBucket stringName 
- The name of the specified OSS bucket.
- OssKey stringPrefix 
- The prefix of the specified OSS bucket name.
- OssWrite stringRole Arn 
- SlsProject stringArn 
- The unique ARN of the Log Service project.
- SlsWrite stringRole Arn 
- The unique ARN of the Log Service role.
- Status string
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- TrailName string
- The name of the ActionTrail Trail.
- TrailRegion string
- The regions to which the trail is applied.
- EventRw string
- Indicates whether the event is a read or a write event.
- Id string
- The id of the ActionTrail Trail. It is the same as trail name.
- IsOrganization boolTrail 
- OssBucket stringName 
- The name of the specified OSS bucket.
- OssKey stringPrefix 
- The prefix of the specified OSS bucket name.
- OssWrite stringRole Arn 
- SlsProject stringArn 
- The unique ARN of the Log Service project.
- SlsWrite stringRole Arn 
- The unique ARN of the Log Service role.
- Status string
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- TrailName string
- The name of the ActionTrail Trail.
- TrailRegion string
- The regions to which the trail is applied.
- eventRw String
- Indicates whether the event is a read or a write event.
- id String
- The id of the ActionTrail Trail. It is the same as trail name.
- isOrganization BooleanTrail 
- ossBucket StringName 
- The name of the specified OSS bucket.
- ossKey StringPrefix 
- The prefix of the specified OSS bucket name.
- ossWrite StringRole Arn 
- slsProject StringArn 
- The unique ARN of the Log Service project.
- slsWrite StringRole Arn 
- The unique ARN of the Log Service role.
- status String
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- trailName String
- The name of the ActionTrail Trail.
- trailRegion String
- The regions to which the trail is applied.
- eventRw string
- Indicates whether the event is a read or a write event.
- id string
- The id of the ActionTrail Trail. It is the same as trail name.
- isOrganization booleanTrail 
- ossBucket stringName 
- The name of the specified OSS bucket.
- ossKey stringPrefix 
- The prefix of the specified OSS bucket name.
- ossWrite stringRole Arn 
- slsProject stringArn 
- The unique ARN of the Log Service project.
- slsWrite stringRole Arn 
- The unique ARN of the Log Service role.
- status string
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- trailName string
- The name of the ActionTrail Trail.
- trailRegion string
- The regions to which the trail is applied.
- event_rw str
- Indicates whether the event is a read or a write event.
- id str
- The id of the ActionTrail Trail. It is the same as trail name.
- is_organization_ booltrail 
- oss_bucket_ strname 
- The name of the specified OSS bucket.
- oss_key_ strprefix 
- The prefix of the specified OSS bucket name.
- oss_write_ strrole_ arn 
- sls_project_ strarn 
- The unique ARN of the Log Service project.
- sls_write_ strrole_ arn 
- The unique ARN of the Log Service role.
- status str
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- trail_name str
- The name of the ActionTrail Trail.
- trail_region str
- The regions to which the trail is applied.
- eventRw String
- Indicates whether the event is a read or a write event.
- id String
- The id of the ActionTrail Trail. It is the same as trail name.
- isOrganization BooleanTrail 
- ossBucket StringName 
- The name of the specified OSS bucket.
- ossKey StringPrefix 
- The prefix of the specified OSS bucket name.
- ossWrite StringRole Arn 
- slsProject StringArn 
- The unique ARN of the Log Service project.
- slsWrite StringRole Arn 
- The unique ARN of the Log Service role.
- status String
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- trailName String
- The name of the ActionTrail Trail.
- trailRegion String
- The regions to which the trail is applied.
GetTrailsTrail  
- EventRw string
- Indicates whether the event is a read or a write event.
- Id string
- The id of the ActionTrail Trail. It is the same as trail name.
- IsOrganization boolTrail 
- OssBucket stringName 
- The name of the specified OSS bucket.
- OssKey stringPrefix 
- The prefix of the specified OSS bucket name.
- OssWrite stringRole Arn 
- SlsProject stringArn 
- The unique ARN of the Log Service project.
- SlsWrite stringRole Arn 
- The unique ARN of the Log Service role.
- Status string
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- TrailName string
- The name of the ActionTrail Trail.
- TrailRegion string
- The regions to which the trail is applied.
- EventRw string
- Indicates whether the event is a read or a write event.
- Id string
- The id of the ActionTrail Trail. It is the same as trail name.
- IsOrganization boolTrail 
- OssBucket stringName 
- The name of the specified OSS bucket.
- OssKey stringPrefix 
- The prefix of the specified OSS bucket name.
- OssWrite stringRole Arn 
- SlsProject stringArn 
- The unique ARN of the Log Service project.
- SlsWrite stringRole Arn 
- The unique ARN of the Log Service role.
- Status string
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- TrailName string
- The name of the ActionTrail Trail.
- TrailRegion string
- The regions to which the trail is applied.
- eventRw String
- Indicates whether the event is a read or a write event.
- id String
- The id of the ActionTrail Trail. It is the same as trail name.
- isOrganization BooleanTrail 
- ossBucket StringName 
- The name of the specified OSS bucket.
- ossKey StringPrefix 
- The prefix of the specified OSS bucket name.
- ossWrite StringRole Arn 
- slsProject StringArn 
- The unique ARN of the Log Service project.
- slsWrite StringRole Arn 
- The unique ARN of the Log Service role.
- status String
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- trailName String
- The name of the ActionTrail Trail.
- trailRegion String
- The regions to which the trail is applied.
- eventRw string
- Indicates whether the event is a read or a write event.
- id string
- The id of the ActionTrail Trail. It is the same as trail name.
- isOrganization booleanTrail 
- ossBucket stringName 
- The name of the specified OSS bucket.
- ossKey stringPrefix 
- The prefix of the specified OSS bucket name.
- ossWrite stringRole Arn 
- slsProject stringArn 
- The unique ARN of the Log Service project.
- slsWrite stringRole Arn 
- The unique ARN of the Log Service role.
- status string
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- trailName string
- The name of the ActionTrail Trail.
- trailRegion string
- The regions to which the trail is applied.
- event_rw str
- Indicates whether the event is a read or a write event.
- id str
- The id of the ActionTrail Trail. It is the same as trail name.
- is_organization_ booltrail 
- oss_bucket_ strname 
- The name of the specified OSS bucket.
- oss_key_ strprefix 
- The prefix of the specified OSS bucket name.
- oss_write_ strrole_ arn 
- sls_project_ strarn 
- The unique ARN of the Log Service project.
- sls_write_ strrole_ arn 
- The unique ARN of the Log Service role.
- status str
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- trail_name str
- The name of the ActionTrail Trail.
- trail_region str
- The regions to which the trail is applied.
- eventRw String
- Indicates whether the event is a read or a write event.
- id String
- The id of the ActionTrail Trail. It is the same as trail name.
- isOrganization BooleanTrail 
- ossBucket StringName 
- The name of the specified OSS bucket.
- ossKey StringPrefix 
- The prefix of the specified OSS bucket name.
- ossWrite StringRole Arn 
- slsProject StringArn 
- The unique ARN of the Log Service project.
- slsWrite StringRole Arn 
- The unique ARN of the Log Service role.
- status String
- Filter the results by status of the ActionTrail Trail. Valid values: Disable,Enable,Fresh.
- trailName String
- The name of the ActionTrail Trail.
- trailRegion String
- The regions to which the trail is applied.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the alicloudTerraform Provider.