Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 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)
// 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.
- Include
Organization boolTrail - Whether to show organization tracking. Default to
false
. - Include
Shadow boolTrails - Whether to show shadow tracking. Default to
false
. - Name
Regex string - A regex string to filter results by trail name.
- Output
File 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.
- Include
Organization boolTrail - Whether to show organization tracking. Default to
false
. - Include
Shadow boolTrails - Whether to show shadow tracking. Default to
false
. - Name
Regex string - A regex string to filter results by trail name.
- Output
File 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.
- include
Organization BooleanTrail - Whether to show organization tracking. Default to
false
. - include
Shadow BooleanTrails - Whether to show shadow tracking. Default to
false
. - name
Regex String - A regex string to filter results by trail name.
- output
File 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.
- include
Organization booleanTrail - Whether to show organization tracking. Default to
false
. - include
Shadow booleanTrails - Whether to show shadow tracking. Default to
false
. - name
Regex string - A regex string to filter results by trail name.
- output
File 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.
- include
Organization BooleanTrail - Whether to show organization tracking. Default to
false
. - include
Shadow BooleanTrails - Whether to show shadow tracking. Default to
false
. - name
Regex String - A regex string to filter results by trail name.
- output
File 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
actiontrails
has been deprecated from version 1.95.0. Usetrails
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.
Ali Cloud. Action Trail. Outputs. Get Trails Trail> - A list of ActionTrail Trails. Each element contains the following attributes:
- Include
Organization boolTrail - Include
Shadow boolTrails - Name
Regex string - Output
File string - Status string
- The status of the ActionTrail Trail.
- Actiontrails
[]Get
Trails Actiontrail - Field
actiontrails
has been deprecated from version 1.95.0. Usetrails
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
[]Get
Trails Trail - A list of ActionTrail Trails. Each element contains the following attributes:
- Include
Organization boolTrail - Include
Shadow boolTrails - Name
Regex string - Output
File string - Status string
- The status of the ActionTrail Trail.
- actiontrails
List<Get
Trails Actiontrail> - Field
actiontrails
has been deprecated from version 1.95.0. Usetrails
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<Get
Trails Trail> - A list of ActionTrail Trails. Each element contains the following attributes:
- include
Organization BooleanTrail - include
Shadow BooleanTrails - name
Regex String - output
File String - status String
- The status of the ActionTrail Trail.
- actiontrails
Get
Trails Actiontrail[] - Field
actiontrails
has been deprecated from version 1.95.0. Usetrails
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
Get
Trails Trail[] - A list of ActionTrail Trails. Each element contains the following attributes:
- include
Organization booleanTrail - include
Shadow booleanTrails - name
Regex string - output
File string - status string
- The status of the ActionTrail Trail.
- actiontrails
Sequence[Get
Trails Actiontrail] - Field
actiontrails
has been deprecated from version 1.95.0. Usetrails
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[Get
Trails 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
actiontrails
has been deprecated from version 1.95.0. Usetrails
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:
- include
Organization BooleanTrail - include
Shadow BooleanTrails - name
Regex String - output
File String - status String
- The status of the ActionTrail Trail.
Supporting Types
GetTrailsActiontrail
- Event
Rw 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.
- Is
Organization boolTrail - Oss
Bucket stringName - The name of the specified OSS bucket.
- Oss
Key stringPrefix - The prefix of the specified OSS bucket name.
- Oss
Write stringRole Arn - Sls
Project stringArn - The unique ARN of the Log Service project.
- Sls
Write 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
. - Trail
Name string - The name of the ActionTrail Trail.
- Trail
Region string - The regions to which the trail is applied.
- Event
Rw 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.
- Is
Organization boolTrail - Oss
Bucket stringName - The name of the specified OSS bucket.
- Oss
Key stringPrefix - The prefix of the specified OSS bucket name.
- Oss
Write stringRole Arn - Sls
Project stringArn - The unique ARN of the Log Service project.
- Sls
Write 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
. - Trail
Name string - The name of the ActionTrail Trail.
- Trail
Region string - The regions to which the trail is applied.
- event
Rw 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.
- is
Organization BooleanTrail - oss
Bucket StringName - The name of the specified OSS bucket.
- oss
Key StringPrefix - The prefix of the specified OSS bucket name.
- oss
Write StringRole Arn - sls
Project StringArn - The unique ARN of the Log Service project.
- sls
Write 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
. - trail
Name String - The name of the ActionTrail Trail.
- trail
Region String - The regions to which the trail is applied.
- event
Rw 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.
- is
Organization booleanTrail - oss
Bucket stringName - The name of the specified OSS bucket.
- oss
Key stringPrefix - The prefix of the specified OSS bucket name.
- oss
Write stringRole Arn - sls
Project stringArn - The unique ARN of the Log Service project.
- sls
Write 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
. - trail
Name string - The name of the ActionTrail Trail.
- trail
Region 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.
- event
Rw 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.
- is
Organization BooleanTrail - oss
Bucket StringName - The name of the specified OSS bucket.
- oss
Key StringPrefix - The prefix of the specified OSS bucket name.
- oss
Write StringRole Arn - sls
Project StringArn - The unique ARN of the Log Service project.
- sls
Write 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
. - trail
Name String - The name of the ActionTrail Trail.
- trail
Region String - The regions to which the trail is applied.
GetTrailsTrail
- Event
Rw 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.
- Is
Organization boolTrail - Oss
Bucket stringName - The name of the specified OSS bucket.
- Oss
Key stringPrefix - The prefix of the specified OSS bucket name.
- Oss
Write stringRole Arn - Sls
Project stringArn - The unique ARN of the Log Service project.
- Sls
Write 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
. - Trail
Name string - The name of the ActionTrail Trail.
- Trail
Region string - The regions to which the trail is applied.
- Event
Rw 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.
- Is
Organization boolTrail - Oss
Bucket stringName - The name of the specified OSS bucket.
- Oss
Key stringPrefix - The prefix of the specified OSS bucket name.
- Oss
Write stringRole Arn - Sls
Project stringArn - The unique ARN of the Log Service project.
- Sls
Write 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
. - Trail
Name string - The name of the ActionTrail Trail.
- Trail
Region string - The regions to which the trail is applied.
- event
Rw 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.
- is
Organization BooleanTrail - oss
Bucket StringName - The name of the specified OSS bucket.
- oss
Key StringPrefix - The prefix of the specified OSS bucket name.
- oss
Write StringRole Arn - sls
Project StringArn - The unique ARN of the Log Service project.
- sls
Write 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
. - trail
Name String - The name of the ActionTrail Trail.
- trail
Region String - The regions to which the trail is applied.
- event
Rw 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.
- is
Organization booleanTrail - oss
Bucket stringName - The name of the specified OSS bucket.
- oss
Key stringPrefix - The prefix of the specified OSS bucket name.
- oss
Write stringRole Arn - sls
Project stringArn - The unique ARN of the Log Service project.
- sls
Write 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
. - trail
Name string - The name of the ActionTrail Trail.
- trail
Region 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.
- event
Rw 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.
- is
Organization BooleanTrail - oss
Bucket StringName - The name of the specified OSS bucket.
- oss
Key StringPrefix - The prefix of the specified OSS bucket name.
- oss
Write StringRole Arn - sls
Project StringArn - The unique ARN of the Log Service project.
- sls
Write 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
. - trail
Name String - The name of the ActionTrail Trail.
- trail
Region 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
alicloud
Terraform Provider.