Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getTrails

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

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var @default = Output.Create(AliCloud.ActionTrail.GetTrails.InvokeAsync(new AliCloud.ActionTrail.GetTrailsArgs
        {
            NameRegex = "tf-testacc-actiontrail",
        }));
        this.TrailName = @default.Apply(@default => @default.Trails?[0]?.Id);
    }

    [Output("trailName")]
    public Output<string> TrailName { get; set; }
}
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
	})
}
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());
    }
}
import pulumi
import pulumi_alicloud as alicloud

default = alicloud.actiontrail.get_trails(name_regex="tf-testacc-actiontrail")
pulumi.export("trailName", default.trails[0].id)
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);
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)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: alicloud:actiontrail/getTrails:getTrails
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Ids List<string>

A list of ActionTrail Trail IDs. It is the same as trail name.

IncludeOrganizationTrail bool

Whether to show organization tracking. Default to false.

IncludeShadowTrails bool

Whether to show shadow tracking. Default to false.

NameRegex string

A regex string to filter results by trail name.

OutputFile string
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.

IncludeOrganizationTrail bool

Whether to show organization tracking. Default to false.

IncludeShadowTrails bool

Whether to show shadow tracking. Default to false.

NameRegex string

A regex string to filter results by trail name.

OutputFile string
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.

includeOrganizationTrail Boolean

Whether to show organization tracking. Default to false.

includeShadowTrails Boolean

Whether to show shadow tracking. Default to false.

nameRegex String

A regex string to filter results by trail name.

outputFile String
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.

includeOrganizationTrail boolean

Whether to show organization tracking. Default to false.

includeShadowTrails boolean

Whether to show shadow tracking. Default to false.

nameRegex string

A regex string to filter results by trail name.

outputFile string
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_trail bool

Whether to show organization tracking. Default to false.

include_shadow_trails bool

Whether to show shadow tracking. Default to false.

name_regex str

A regex string to filter results by trail name.

output_file str
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.

includeOrganizationTrail Boolean

Whether to show organization tracking. Default to false.

includeShadowTrails Boolean

Whether to show shadow tracking. Default to false.

nameRegex String

A regex string to filter results by trail name.

outputFile String
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.AliCloud.ActionTrail.Outputs.GetTrailsActiontrail>

Field actiontrails has been deprecated from version 1.95.0. Use trails instead."

Deprecated:

Field 'actiontrails' has been deprecated from version 1.95.0. Use 'trails' instead.

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.AliCloud.ActionTrail.Outputs.GetTrailsTrail>

A list of ActionTrail Trails. Each element contains the following attributes:

IncludeOrganizationTrail bool
IncludeShadowTrails bool
NameRegex string
OutputFile string
Status string

The status of the ActionTrail Trail.

Actiontrails []GetTrailsActiontrail

Field actiontrails has been deprecated from version 1.95.0. Use trails instead."

Deprecated:

Field 'actiontrails' has been deprecated from version 1.95.0. Use 'trails' instead.

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 []GetTrailsTrail

A list of ActionTrail Trails. Each element contains the following attributes:

IncludeOrganizationTrail bool
IncludeShadowTrails bool
NameRegex string
OutputFile string
Status string

The status of the ActionTrail Trail.

actiontrails List<GetTrailsActiontrail>

Field actiontrails has been deprecated from version 1.95.0. Use trails instead."

Deprecated:

Field 'actiontrails' has been deprecated from version 1.95.0. Use 'trails' instead.

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<GetTrailsTrail>

A list of ActionTrail Trails. Each element contains the following attributes:

includeOrganizationTrail Boolean
includeShadowTrails Boolean
nameRegex String
outputFile String
status String

The status of the ActionTrail Trail.

actiontrails GetTrailsActiontrail[]

Field actiontrails has been deprecated from version 1.95.0. Use trails instead."

Deprecated:

Field 'actiontrails' has been deprecated from version 1.95.0. Use 'trails' instead.

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 GetTrailsTrail[]

A list of ActionTrail Trails. Each element contains the following attributes:

includeOrganizationTrail boolean
includeShadowTrails boolean
nameRegex string
outputFile string
status string

The status of the ActionTrail Trail.

actiontrails Sequence[GetTrailsActiontrail]

Field actiontrails has been deprecated from version 1.95.0. Use trails instead."

Deprecated:

Field 'actiontrails' has been deprecated from version 1.95.0. Use 'trails' instead.

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[GetTrailsTrail]

A list of ActionTrail Trails. Each element contains the following attributes:

include_organization_trail bool
include_shadow_trails bool
name_regex str
output_file str
status str

The status of the ActionTrail Trail.

actiontrails List<Property Map>

Field actiontrails has been deprecated from version 1.95.0. Use trails instead."

Deprecated:

Field 'actiontrails' has been deprecated from version 1.95.0. Use 'trails' instead.

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:

includeOrganizationTrail Boolean
includeShadowTrails Boolean
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.

IsOrganizationTrail bool
OssBucketName string

The name of the specified OSS bucket.

OssKeyPrefix string

The prefix of the specified OSS bucket name.

OssWriteRoleArn string
SlsProjectArn string

The unique ARN of the Log Service project.

SlsWriteRoleArn string

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.

IsOrganizationTrail bool
OssBucketName string

The name of the specified OSS bucket.

OssKeyPrefix string

The prefix of the specified OSS bucket name.

OssWriteRoleArn string
SlsProjectArn string

The unique ARN of the Log Service project.

SlsWriteRoleArn string

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.

isOrganizationTrail Boolean
ossBucketName String

The name of the specified OSS bucket.

ossKeyPrefix String

The prefix of the specified OSS bucket name.

ossWriteRoleArn String
slsProjectArn String

The unique ARN of the Log Service project.

slsWriteRoleArn String

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.

isOrganizationTrail boolean
ossBucketName string

The name of the specified OSS bucket.

ossKeyPrefix string

The prefix of the specified OSS bucket name.

ossWriteRoleArn string
slsProjectArn string

The unique ARN of the Log Service project.

slsWriteRoleArn string

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_trail bool
oss_bucket_name str

The name of the specified OSS bucket.

oss_key_prefix str

The prefix of the specified OSS bucket name.

oss_write_role_arn str
sls_project_arn str

The unique ARN of the Log Service project.

sls_write_role_arn str

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.

isOrganizationTrail Boolean
ossBucketName String

The name of the specified OSS bucket.

ossKeyPrefix String

The prefix of the specified OSS bucket name.

ossWriteRoleArn String
slsProjectArn String

The unique ARN of the Log Service project.

slsWriteRoleArn String

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.

IsOrganizationTrail bool
OssBucketName string

The name of the specified OSS bucket.

OssKeyPrefix string

The prefix of the specified OSS bucket name.

OssWriteRoleArn string
SlsProjectArn string

The unique ARN of the Log Service project.

SlsWriteRoleArn string

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.

IsOrganizationTrail bool
OssBucketName string

The name of the specified OSS bucket.

OssKeyPrefix string

The prefix of the specified OSS bucket name.

OssWriteRoleArn string
SlsProjectArn string

The unique ARN of the Log Service project.

SlsWriteRoleArn string

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.

isOrganizationTrail Boolean
ossBucketName String

The name of the specified OSS bucket.

ossKeyPrefix String

The prefix of the specified OSS bucket name.

ossWriteRoleArn String
slsProjectArn String

The unique ARN of the Log Service project.

slsWriteRoleArn String

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.

isOrganizationTrail boolean
ossBucketName string

The name of the specified OSS bucket.

ossKeyPrefix string

The prefix of the specified OSS bucket name.

ossWriteRoleArn string
slsProjectArn string

The unique ARN of the Log Service project.

slsWriteRoleArn string

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_trail bool
oss_bucket_name str

The name of the specified OSS bucket.

oss_key_prefix str

The prefix of the specified OSS bucket name.

oss_write_role_arn str
sls_project_arn str

The unique ARN of the Log Service project.

sls_write_role_arn str

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.

isOrganizationTrail Boolean
ossBucketName String

The name of the specified OSS bucket.

ossKeyPrefix String

The prefix of the specified OSS bucket name.

ossWriteRoleArn String
slsProjectArn String

The unique ARN of the Log Service project.

slsWriteRoleArn String

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
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.