1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. actiontrail
  5. Trail
Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi

alicloud.actiontrail.Trail

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi

    Provides a Actiontrail Trail resource.

    Trail of ActionTrail. After creating a trail, you need to enable the trail through StartLogging.

    For information about Actiontrail Trail and how to use it, see What is Trail.

    NOTE: Available since v1.95.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    import * as random from "@pulumi/random";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = alicloud.getRegions({
        current: true,
    });
    const defaultGetAccount = alicloud.getAccount({});
    const defaultInteger = new random.index.Integer("default", {
        min: 10000,
        max: 99999,
    });
    const defaultProject = new alicloud.log.Project("default", {
        projectName: `${name}-${defaultInteger.result}`,
        description: "tf actiontrail example",
    });
    const defaultGetRoles = alicloud.ram.getRoles({
        nameRegex: "AliyunServiceRoleForActionTrail",
    });
    const defaultTrail = new alicloud.actiontrail.Trail("default", {
        trailName: name,
        slsWriteRoleArn: defaultGetRoles.then(defaultGetRoles => defaultGetRoles.roles?.[0]?.arn),
        slsProjectArn: pulumi.all([_default, defaultGetAccount, defaultProject.projectName]).apply(([_default, defaultGetAccount, projectName]) => `acs:log:${_default.regions?.[0]?.id}:${defaultGetAccount.id}:project/${projectName}`),
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_random as random
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.get_regions(current=True)
    default_get_account = alicloud.get_account()
    default_integer = random.index.Integer("default",
        min=10000,
        max=99999)
    default_project = alicloud.log.Project("default",
        project_name=f"{name}-{default_integer['result']}",
        description="tf actiontrail example")
    default_get_roles = alicloud.ram.get_roles(name_regex="AliyunServiceRoleForActionTrail")
    default_trail = alicloud.actiontrail.Trail("default",
        trail_name=name,
        sls_write_role_arn=default_get_roles.roles[0].arn,
        sls_project_arn=default_project.project_name.apply(lambda project_name: f"acs:log:{default.regions[0].id}:{default_get_account.id}:project/{project_name}"))
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/actiontrail"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ram"
    	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := alicloud.GetRegions(ctx, &alicloud.GetRegionsArgs{
    			Current: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultGetAccount, err := alicloud.GetAccount(ctx, map[string]interface{}{}, nil)
    		if err != nil {
    			return err
    		}
    		defaultInteger, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
    			Min: 10000,
    			Max: 99999,
    		})
    		if err != nil {
    			return err
    		}
    		defaultProject, err := log.NewProject(ctx, "default", &log.ProjectArgs{
    			ProjectName: pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
    			Description: pulumi.String("tf actiontrail example"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultGetRoles, err := ram.GetRoles(ctx, &ram.GetRolesArgs{
    			NameRegex: pulumi.StringRef("AliyunServiceRoleForActionTrail"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = actiontrail.NewTrail(ctx, "default", &actiontrail.TrailArgs{
    			TrailName:       pulumi.String(name),
    			SlsWriteRoleArn: pulumi.String(defaultGetRoles.Roles[0].Arn),
    			SlsProjectArn: defaultProject.ProjectName.ApplyT(func(projectName string) (string, error) {
    				return fmt.Sprintf("acs:log:%v:%v:project/%v", _default.Regions[0].Id, defaultGetAccount.Id, projectName), nil
    			}).(pulumi.StringOutput),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    using Random = Pulumi.Random;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = AliCloud.GetRegions.Invoke(new()
        {
            Current = true,
        });
    
        var defaultGetAccount = AliCloud.GetAccount.Invoke();
    
        var defaultInteger = new Random.Index.Integer("default", new()
        {
            Min = 10000,
            Max = 99999,
        });
    
        var defaultProject = new AliCloud.Log.Project("default", new()
        {
            ProjectName = $"{name}-{defaultInteger.Result}",
            Description = "tf actiontrail example",
        });
    
        var defaultGetRoles = AliCloud.Ram.GetRoles.Invoke(new()
        {
            NameRegex = "AliyunServiceRoleForActionTrail",
        });
    
        var defaultTrail = new AliCloud.ActionTrail.Trail("default", new()
        {
            TrailName = name,
            SlsWriteRoleArn = defaultGetRoles.Apply(getRolesResult => getRolesResult.Roles[0]?.Arn),
            SlsProjectArn = Output.Tuple(@default, defaultGetAccount, defaultProject.ProjectName).Apply(values =>
            {
                var @default = values.Item1;
                var defaultGetAccount = values.Item2;
                var projectName = values.Item3;
                return $"acs:log:{@default.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)}:{defaultGetAccount.Apply(getAccountResult => getAccountResult.Id)}:project/{projectName}";
            }),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetRegionsArgs;
    import com.pulumi.random.Integer;
    import com.pulumi.random.IntegerArgs;
    import com.pulumi.alicloud.log.Project;
    import com.pulumi.alicloud.log.ProjectArgs;
    import com.pulumi.alicloud.ram.RamFunctions;
    import com.pulumi.alicloud.ram.inputs.GetRolesArgs;
    import com.pulumi.alicloud.actiontrail.Trail;
    import com.pulumi.alicloud.actiontrail.TrailArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            final var default = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
                .current(true)
                .build());
    
            final var defaultGetAccount = AlicloudFunctions.getAccount(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference);
    
            var defaultInteger = new Integer("defaultInteger", IntegerArgs.builder()
                .min(10000)
                .max(99999)
                .build());
    
            var defaultProject = new Project("defaultProject", ProjectArgs.builder()
                .projectName(String.format("%s-%s", name,defaultInteger.result()))
                .description("tf actiontrail example")
                .build());
    
            final var defaultGetRoles = RamFunctions.getRoles(GetRolesArgs.builder()
                .nameRegex("AliyunServiceRoleForActionTrail")
                .build());
    
            var defaultTrail = new Trail("defaultTrail", TrailArgs.builder()
                .trailName(name)
                .slsWriteRoleArn(defaultGetRoles.roles()[0].arn())
                .slsProjectArn(defaultProject.projectName().applyValue(_projectName -> String.format("acs:log:%s:%s:project/%s", default_.regions()[0].id(),defaultGetAccount.id(),_projectName)))
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultInteger:
        type: random:Integer
        name: default
        properties:
          min: 10000
          max: 99999
      defaultProject:
        type: alicloud:log:Project
        name: default
        properties:
          projectName: ${name}-${defaultInteger.result}
          description: tf actiontrail example
      defaultTrail:
        type: alicloud:actiontrail:Trail
        name: default
        properties:
          trailName: ${name}
          slsWriteRoleArn: ${defaultGetRoles.roles[0].arn}
          slsProjectArn: acs:log:${default.regions[0].id}:${defaultGetAccount.id}:project/${defaultProject.projectName}
    variables:
      default:
        fn::invoke:
          function: alicloud:getRegions
          arguments:
            current: true
      defaultGetAccount:
        fn::invoke:
          function: alicloud:getAccount
          arguments: {}
      defaultGetRoles:
        fn::invoke:
          function: alicloud:ram:getRoles
          arguments:
            nameRegex: AliyunServiceRoleForActionTrail
    

    Create Trail Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Trail(name: string, args?: TrailArgs, opts?: CustomResourceOptions);
    @overload
    def Trail(resource_name: str,
              args: Optional[TrailArgs] = None,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Trail(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              event_rw: Optional[str] = None,
              is_organization_trail: Optional[bool] = None,
              max_compute_project_arn: Optional[str] = None,
              max_compute_write_role_arn: Optional[str] = None,
              mns_topic_arn: Optional[str] = None,
              name: Optional[str] = None,
              oss_bucket_name: Optional[str] = None,
              oss_key_prefix: Optional[str] = None,
              oss_write_role_arn: Optional[str] = None,
              role_name: Optional[str] = None,
              sls_project_arn: Optional[str] = None,
              sls_write_role_arn: Optional[str] = None,
              status: Optional[str] = None,
              trail_name: Optional[str] = None,
              trail_region: Optional[str] = None)
    func NewTrail(ctx *Context, name string, args *TrailArgs, opts ...ResourceOption) (*Trail, error)
    public Trail(string name, TrailArgs? args = null, CustomResourceOptions? opts = null)
    public Trail(String name, TrailArgs args)
    public Trail(String name, TrailArgs args, CustomResourceOptions options)
    
    type: alicloud:actiontrail:Trail
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args TrailArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args TrailArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args TrailArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TrailArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TrailArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var trailResource = new AliCloud.ActionTrail.Trail("trailResource", new()
    {
        EventRw = "string",
        IsOrganizationTrail = false,
        MaxComputeProjectArn = "string",
        MaxComputeWriteRoleArn = "string",
        OssBucketName = "string",
        OssKeyPrefix = "string",
        OssWriteRoleArn = "string",
        SlsProjectArn = "string",
        SlsWriteRoleArn = "string",
        Status = "string",
        TrailName = "string",
        TrailRegion = "string",
    });
    
    example, err := actiontrail.NewTrail(ctx, "trailResource", &actiontrail.TrailArgs{
    	EventRw:                pulumi.String("string"),
    	IsOrganizationTrail:    pulumi.Bool(false),
    	MaxComputeProjectArn:   pulumi.String("string"),
    	MaxComputeWriteRoleArn: pulumi.String("string"),
    	OssBucketName:          pulumi.String("string"),
    	OssKeyPrefix:           pulumi.String("string"),
    	OssWriteRoleArn:        pulumi.String("string"),
    	SlsProjectArn:          pulumi.String("string"),
    	SlsWriteRoleArn:        pulumi.String("string"),
    	Status:                 pulumi.String("string"),
    	TrailName:              pulumi.String("string"),
    	TrailRegion:            pulumi.String("string"),
    })
    
    var trailResource = new Trail("trailResource", TrailArgs.builder()
        .eventRw("string")
        .isOrganizationTrail(false)
        .maxComputeProjectArn("string")
        .maxComputeWriteRoleArn("string")
        .ossBucketName("string")
        .ossKeyPrefix("string")
        .ossWriteRoleArn("string")
        .slsProjectArn("string")
        .slsWriteRoleArn("string")
        .status("string")
        .trailName("string")
        .trailRegion("string")
        .build());
    
    trail_resource = alicloud.actiontrail.Trail("trailResource",
        event_rw="string",
        is_organization_trail=False,
        max_compute_project_arn="string",
        max_compute_write_role_arn="string",
        oss_bucket_name="string",
        oss_key_prefix="string",
        oss_write_role_arn="string",
        sls_project_arn="string",
        sls_write_role_arn="string",
        status="string",
        trail_name="string",
        trail_region="string")
    
    const trailResource = new alicloud.actiontrail.Trail("trailResource", {
        eventRw: "string",
        isOrganizationTrail: false,
        maxComputeProjectArn: "string",
        maxComputeWriteRoleArn: "string",
        ossBucketName: "string",
        ossKeyPrefix: "string",
        ossWriteRoleArn: "string",
        slsProjectArn: "string",
        slsWriteRoleArn: "string",
        status: "string",
        trailName: "string",
        trailRegion: "string",
    });
    
    type: alicloud:actiontrail:Trail
    properties:
        eventRw: string
        isOrganizationTrail: false
        maxComputeProjectArn: string
        maxComputeWriteRoleArn: string
        ossBucketName: string
        ossKeyPrefix: string
        ossWriteRoleArn: string
        slsProjectArn: string
        slsWriteRoleArn: string
        status: string
        trailName: string
        trailRegion: string
    

    Trail Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Trail resource accepts the following input properties:

    EventRw string
    The read/write type of the events to be delivered. Default value: All. Valid values: Read, Write, All.
    IsOrganizationTrail bool
    Specifies whether to create a multi-account trail. Default value: false. Valid values:
    MaxComputeProjectArn string
    The ARN of the MaxCompute project to which you want to deliver events.
    MaxComputeWriteRoleArn string
    The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
    MnsTopicArn string
    Field mns_topic_arn has been deprecated from provider version 1.118.0.

    Deprecated: Field mns_topic_arn has been deprecated from version 1.118.0

    Name string
    Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    Deprecated: Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    OssBucketName string
    The OSS bucket to which the trail delivers logs.
    OssKeyPrefix string
    The prefix of the file name in the OSS bucket to which the trail delivers logs.
    OssWriteRoleArn string
    The name of the RAM role that the user allows ActionTrail to access OSS service.
    RoleName string
    Field role_name has been deprecated from provider version 1.118.0.

    Deprecated: Field role_name has been deprecated from version 1.118.0

    SlsProjectArn string
    The ARN of the Simple Log Service project to which the trail delivers logs.
    SlsWriteRoleArn string
    The ARN of the role that ActionTrail assumes to deliver operation events to the Simple Log Service project.
    Status string
    The status of the trail. Default value: Enable. Valid values: Enable, Disable.
    TrailName string
    The name of the trail to be created.
    TrailRegion string
    The region of the trail.
    EventRw string
    The read/write type of the events to be delivered. Default value: All. Valid values: Read, Write, All.
    IsOrganizationTrail bool
    Specifies whether to create a multi-account trail. Default value: false. Valid values:
    MaxComputeProjectArn string
    The ARN of the MaxCompute project to which you want to deliver events.
    MaxComputeWriteRoleArn string
    The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
    MnsTopicArn string
    Field mns_topic_arn has been deprecated from provider version 1.118.0.

    Deprecated: Field mns_topic_arn has been deprecated from version 1.118.0

    Name string
    Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    Deprecated: Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    OssBucketName string
    The OSS bucket to which the trail delivers logs.
    OssKeyPrefix string
    The prefix of the file name in the OSS bucket to which the trail delivers logs.
    OssWriteRoleArn string
    The name of the RAM role that the user allows ActionTrail to access OSS service.
    RoleName string
    Field role_name has been deprecated from provider version 1.118.0.

    Deprecated: Field role_name has been deprecated from version 1.118.0

    SlsProjectArn string
    The ARN of the Simple Log Service project to which the trail delivers logs.
    SlsWriteRoleArn string
    The ARN of the role that ActionTrail assumes to deliver operation events to the Simple Log Service project.
    Status string
    The status of the trail. Default value: Enable. Valid values: Enable, Disable.
    TrailName string
    The name of the trail to be created.
    TrailRegion string
    The region of the trail.
    eventRw String
    The read/write type of the events to be delivered. Default value: All. Valid values: Read, Write, All.
    isOrganizationTrail Boolean
    Specifies whether to create a multi-account trail. Default value: false. Valid values:
    maxComputeProjectArn String
    The ARN of the MaxCompute project to which you want to deliver events.
    maxComputeWriteRoleArn String
    The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
    mnsTopicArn String
    Field mns_topic_arn has been deprecated from provider version 1.118.0.

    Deprecated: Field mns_topic_arn has been deprecated from version 1.118.0

    name String
    Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    Deprecated: Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    ossBucketName String
    The OSS bucket to which the trail delivers logs.
    ossKeyPrefix String
    The prefix of the file name in the OSS bucket to which the trail delivers logs.
    ossWriteRoleArn String
    The name of the RAM role that the user allows ActionTrail to access OSS service.
    roleName String
    Field role_name has been deprecated from provider version 1.118.0.

    Deprecated: Field role_name has been deprecated from version 1.118.0

    slsProjectArn String
    The ARN of the Simple Log Service project to which the trail delivers logs.
    slsWriteRoleArn String
    The ARN of the role that ActionTrail assumes to deliver operation events to the Simple Log Service project.
    status String
    The status of the trail. Default value: Enable. Valid values: Enable, Disable.
    trailName String
    The name of the trail to be created.
    trailRegion String
    The region of the trail.
    eventRw string
    The read/write type of the events to be delivered. Default value: All. Valid values: Read, Write, All.
    isOrganizationTrail boolean
    Specifies whether to create a multi-account trail. Default value: false. Valid values:
    maxComputeProjectArn string
    The ARN of the MaxCompute project to which you want to deliver events.
    maxComputeWriteRoleArn string
    The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
    mnsTopicArn string
    Field mns_topic_arn has been deprecated from provider version 1.118.0.

    Deprecated: Field mns_topic_arn has been deprecated from version 1.118.0

    name string
    Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    Deprecated: Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    ossBucketName string
    The OSS bucket to which the trail delivers logs.
    ossKeyPrefix string
    The prefix of the file name in the OSS bucket to which the trail delivers logs.
    ossWriteRoleArn string
    The name of the RAM role that the user allows ActionTrail to access OSS service.
    roleName string
    Field role_name has been deprecated from provider version 1.118.0.

    Deprecated: Field role_name has been deprecated from version 1.118.0

    slsProjectArn string
    The ARN of the Simple Log Service project to which the trail delivers logs.
    slsWriteRoleArn string
    The ARN of the role that ActionTrail assumes to deliver operation events to the Simple Log Service project.
    status string
    The status of the trail. Default value: Enable. Valid values: Enable, Disable.
    trailName string
    The name of the trail to be created.
    trailRegion string
    The region of the trail.
    event_rw str
    The read/write type of the events to be delivered. Default value: All. Valid values: Read, Write, All.
    is_organization_trail bool
    Specifies whether to create a multi-account trail. Default value: false. Valid values:
    max_compute_project_arn str
    The ARN of the MaxCompute project to which you want to deliver events.
    max_compute_write_role_arn str
    The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
    mns_topic_arn str
    Field mns_topic_arn has been deprecated from provider version 1.118.0.

    Deprecated: Field mns_topic_arn has been deprecated from version 1.118.0

    name str
    Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    Deprecated: Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    oss_bucket_name str
    The OSS bucket to which the trail delivers logs.
    oss_key_prefix str
    The prefix of the file name in the OSS bucket to which the trail delivers logs.
    oss_write_role_arn str
    The name of the RAM role that the user allows ActionTrail to access OSS service.
    role_name str
    Field role_name has been deprecated from provider version 1.118.0.

    Deprecated: Field role_name has been deprecated from version 1.118.0

    sls_project_arn str
    The ARN of the Simple Log Service project to which the trail delivers logs.
    sls_write_role_arn str
    The ARN of the role that ActionTrail assumes to deliver operation events to the Simple Log Service project.
    status str
    The status of the trail. Default value: Enable. Valid values: Enable, Disable.
    trail_name str
    The name of the trail to be created.
    trail_region str
    The region of the trail.
    eventRw String
    The read/write type of the events to be delivered. Default value: All. Valid values: Read, Write, All.
    isOrganizationTrail Boolean
    Specifies whether to create a multi-account trail. Default value: false. Valid values:
    maxComputeProjectArn String
    The ARN of the MaxCompute project to which you want to deliver events.
    maxComputeWriteRoleArn String
    The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
    mnsTopicArn String
    Field mns_topic_arn has been deprecated from provider version 1.118.0.

    Deprecated: Field mns_topic_arn has been deprecated from version 1.118.0

    name String
    Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    Deprecated: Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    ossBucketName String
    The OSS bucket to which the trail delivers logs.
    ossKeyPrefix String
    The prefix of the file name in the OSS bucket to which the trail delivers logs.
    ossWriteRoleArn String
    The name of the RAM role that the user allows ActionTrail to access OSS service.
    roleName String
    Field role_name has been deprecated from provider version 1.118.0.

    Deprecated: Field role_name has been deprecated from version 1.118.0

    slsProjectArn String
    The ARN of the Simple Log Service project to which the trail delivers logs.
    slsWriteRoleArn String
    The ARN of the role that ActionTrail assumes to deliver operation events to the Simple Log Service project.
    status String
    The status of the trail. Default value: Enable. Valid values: Enable, Disable.
    trailName String
    The name of the trail to be created.
    trailRegion String
    The region of the trail.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Trail resource produces the following output properties:

    CreateTime string
    (Available since v1.256.0) The time when the trail was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionId string
    (Available since v1.256.0) The home region of the trail.
    CreateTime string
    (Available since v1.256.0) The time when the trail was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionId string
    (Available since v1.256.0) The home region of the trail.
    createTime String
    (Available since v1.256.0) The time when the trail was created.
    id String
    The provider-assigned unique ID for this managed resource.
    regionId String
    (Available since v1.256.0) The home region of the trail.
    createTime string
    (Available since v1.256.0) The time when the trail was created.
    id string
    The provider-assigned unique ID for this managed resource.
    regionId string
    (Available since v1.256.0) The home region of the trail.
    create_time str
    (Available since v1.256.0) The time when the trail was created.
    id str
    The provider-assigned unique ID for this managed resource.
    region_id str
    (Available since v1.256.0) The home region of the trail.
    createTime String
    (Available since v1.256.0) The time when the trail was created.
    id String
    The provider-assigned unique ID for this managed resource.
    regionId String
    (Available since v1.256.0) The home region of the trail.

    Look up Existing Trail Resource

    Get an existing Trail resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: TrailState, opts?: CustomResourceOptions): Trail
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            event_rw: Optional[str] = None,
            is_organization_trail: Optional[bool] = None,
            max_compute_project_arn: Optional[str] = None,
            max_compute_write_role_arn: Optional[str] = None,
            mns_topic_arn: Optional[str] = None,
            name: Optional[str] = None,
            oss_bucket_name: Optional[str] = None,
            oss_key_prefix: Optional[str] = None,
            oss_write_role_arn: Optional[str] = None,
            region_id: Optional[str] = None,
            role_name: Optional[str] = None,
            sls_project_arn: Optional[str] = None,
            sls_write_role_arn: Optional[str] = None,
            status: Optional[str] = None,
            trail_name: Optional[str] = None,
            trail_region: Optional[str] = None) -> Trail
    func GetTrail(ctx *Context, name string, id IDInput, state *TrailState, opts ...ResourceOption) (*Trail, error)
    public static Trail Get(string name, Input<string> id, TrailState? state, CustomResourceOptions? opts = null)
    public static Trail get(String name, Output<String> id, TrailState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:actiontrail:Trail    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CreateTime string
    (Available since v1.256.0) The time when the trail was created.
    EventRw string
    The read/write type of the events to be delivered. Default value: All. Valid values: Read, Write, All.
    IsOrganizationTrail bool
    Specifies whether to create a multi-account trail. Default value: false. Valid values:
    MaxComputeProjectArn string
    The ARN of the MaxCompute project to which you want to deliver events.
    MaxComputeWriteRoleArn string
    The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
    MnsTopicArn string
    Field mns_topic_arn has been deprecated from provider version 1.118.0.

    Deprecated: Field mns_topic_arn has been deprecated from version 1.118.0

    Name string
    Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    Deprecated: Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    OssBucketName string
    The OSS bucket to which the trail delivers logs.
    OssKeyPrefix string
    The prefix of the file name in the OSS bucket to which the trail delivers logs.
    OssWriteRoleArn string
    The name of the RAM role that the user allows ActionTrail to access OSS service.
    RegionId string
    (Available since v1.256.0) The home region of the trail.
    RoleName string
    Field role_name has been deprecated from provider version 1.118.0.

    Deprecated: Field role_name has been deprecated from version 1.118.0

    SlsProjectArn string
    The ARN of the Simple Log Service project to which the trail delivers logs.
    SlsWriteRoleArn string
    The ARN of the role that ActionTrail assumes to deliver operation events to the Simple Log Service project.
    Status string
    The status of the trail. Default value: Enable. Valid values: Enable, Disable.
    TrailName string
    The name of the trail to be created.
    TrailRegion string
    The region of the trail.
    CreateTime string
    (Available since v1.256.0) The time when the trail was created.
    EventRw string
    The read/write type of the events to be delivered. Default value: All. Valid values: Read, Write, All.
    IsOrganizationTrail bool
    Specifies whether to create a multi-account trail. Default value: false. Valid values:
    MaxComputeProjectArn string
    The ARN of the MaxCompute project to which you want to deliver events.
    MaxComputeWriteRoleArn string
    The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
    MnsTopicArn string
    Field mns_topic_arn has been deprecated from provider version 1.118.0.

    Deprecated: Field mns_topic_arn has been deprecated from version 1.118.0

    Name string
    Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    Deprecated: Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    OssBucketName string
    The OSS bucket to which the trail delivers logs.
    OssKeyPrefix string
    The prefix of the file name in the OSS bucket to which the trail delivers logs.
    OssWriteRoleArn string
    The name of the RAM role that the user allows ActionTrail to access OSS service.
    RegionId string
    (Available since v1.256.0) The home region of the trail.
    RoleName string
    Field role_name has been deprecated from provider version 1.118.0.

    Deprecated: Field role_name has been deprecated from version 1.118.0

    SlsProjectArn string
    The ARN of the Simple Log Service project to which the trail delivers logs.
    SlsWriteRoleArn string
    The ARN of the role that ActionTrail assumes to deliver operation events to the Simple Log Service project.
    Status string
    The status of the trail. Default value: Enable. Valid values: Enable, Disable.
    TrailName string
    The name of the trail to be created.
    TrailRegion string
    The region of the trail.
    createTime String
    (Available since v1.256.0) The time when the trail was created.
    eventRw String
    The read/write type of the events to be delivered. Default value: All. Valid values: Read, Write, All.
    isOrganizationTrail Boolean
    Specifies whether to create a multi-account trail. Default value: false. Valid values:
    maxComputeProjectArn String
    The ARN of the MaxCompute project to which you want to deliver events.
    maxComputeWriteRoleArn String
    The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
    mnsTopicArn String
    Field mns_topic_arn has been deprecated from provider version 1.118.0.

    Deprecated: Field mns_topic_arn has been deprecated from version 1.118.0

    name String
    Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    Deprecated: Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    ossBucketName String
    The OSS bucket to which the trail delivers logs.
    ossKeyPrefix String
    The prefix of the file name in the OSS bucket to which the trail delivers logs.
    ossWriteRoleArn String
    The name of the RAM role that the user allows ActionTrail to access OSS service.
    regionId String
    (Available since v1.256.0) The home region of the trail.
    roleName String
    Field role_name has been deprecated from provider version 1.118.0.

    Deprecated: Field role_name has been deprecated from version 1.118.0

    slsProjectArn String
    The ARN of the Simple Log Service project to which the trail delivers logs.
    slsWriteRoleArn String
    The ARN of the role that ActionTrail assumes to deliver operation events to the Simple Log Service project.
    status String
    The status of the trail. Default value: Enable. Valid values: Enable, Disable.
    trailName String
    The name of the trail to be created.
    trailRegion String
    The region of the trail.
    createTime string
    (Available since v1.256.0) The time when the trail was created.
    eventRw string
    The read/write type of the events to be delivered. Default value: All. Valid values: Read, Write, All.
    isOrganizationTrail boolean
    Specifies whether to create a multi-account trail. Default value: false. Valid values:
    maxComputeProjectArn string
    The ARN of the MaxCompute project to which you want to deliver events.
    maxComputeWriteRoleArn string
    The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
    mnsTopicArn string
    Field mns_topic_arn has been deprecated from provider version 1.118.0.

    Deprecated: Field mns_topic_arn has been deprecated from version 1.118.0

    name string
    Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    Deprecated: Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    ossBucketName string
    The OSS bucket to which the trail delivers logs.
    ossKeyPrefix string
    The prefix of the file name in the OSS bucket to which the trail delivers logs.
    ossWriteRoleArn string
    The name of the RAM role that the user allows ActionTrail to access OSS service.
    regionId string
    (Available since v1.256.0) The home region of the trail.
    roleName string
    Field role_name has been deprecated from provider version 1.118.0.

    Deprecated: Field role_name has been deprecated from version 1.118.0

    slsProjectArn string
    The ARN of the Simple Log Service project to which the trail delivers logs.
    slsWriteRoleArn string
    The ARN of the role that ActionTrail assumes to deliver operation events to the Simple Log Service project.
    status string
    The status of the trail. Default value: Enable. Valid values: Enable, Disable.
    trailName string
    The name of the trail to be created.
    trailRegion string
    The region of the trail.
    create_time str
    (Available since v1.256.0) The time when the trail was created.
    event_rw str
    The read/write type of the events to be delivered. Default value: All. Valid values: Read, Write, All.
    is_organization_trail bool
    Specifies whether to create a multi-account trail. Default value: false. Valid values:
    max_compute_project_arn str
    The ARN of the MaxCompute project to which you want to deliver events.
    max_compute_write_role_arn str
    The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
    mns_topic_arn str
    Field mns_topic_arn has been deprecated from provider version 1.118.0.

    Deprecated: Field mns_topic_arn has been deprecated from version 1.118.0

    name str
    Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    Deprecated: Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    oss_bucket_name str
    The OSS bucket to which the trail delivers logs.
    oss_key_prefix str
    The prefix of the file name in the OSS bucket to which the trail delivers logs.
    oss_write_role_arn str
    The name of the RAM role that the user allows ActionTrail to access OSS service.
    region_id str
    (Available since v1.256.0) The home region of the trail.
    role_name str
    Field role_name has been deprecated from provider version 1.118.0.

    Deprecated: Field role_name has been deprecated from version 1.118.0

    sls_project_arn str
    The ARN of the Simple Log Service project to which the trail delivers logs.
    sls_write_role_arn str
    The ARN of the role that ActionTrail assumes to deliver operation events to the Simple Log Service project.
    status str
    The status of the trail. Default value: Enable. Valid values: Enable, Disable.
    trail_name str
    The name of the trail to be created.
    trail_region str
    The region of the trail.
    createTime String
    (Available since v1.256.0) The time when the trail was created.
    eventRw String
    The read/write type of the events to be delivered. Default value: All. Valid values: Read, Write, All.
    isOrganizationTrail Boolean
    Specifies whether to create a multi-account trail. Default value: false. Valid values:
    maxComputeProjectArn String
    The ARN of the MaxCompute project to which you want to deliver events.
    maxComputeWriteRoleArn String
    The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
    mnsTopicArn String
    Field mns_topic_arn has been deprecated from provider version 1.118.0.

    Deprecated: Field mns_topic_arn has been deprecated from version 1.118.0

    name String
    Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    Deprecated: Field name has been deprecated from provider version 1.95.0. New field trail_name instead.

    ossBucketName String
    The OSS bucket to which the trail delivers logs.
    ossKeyPrefix String
    The prefix of the file name in the OSS bucket to which the trail delivers logs.
    ossWriteRoleArn String
    The name of the RAM role that the user allows ActionTrail to access OSS service.
    regionId String
    (Available since v1.256.0) The home region of the trail.
    roleName String
    Field role_name has been deprecated from provider version 1.118.0.

    Deprecated: Field role_name has been deprecated from version 1.118.0

    slsProjectArn String
    The ARN of the Simple Log Service project to which the trail delivers logs.
    slsWriteRoleArn String
    The ARN of the role that ActionTrail assumes to deliver operation events to the Simple Log Service project.
    status String
    The status of the trail. Default value: Enable. Valid values: Enable, Disable.
    trailName String
    The name of the trail to be created.
    trailRegion String
    The region of the trail.

    Import

    Actiontrail Trail can be imported using the id, e.g.

    $ pulumi import alicloud:actiontrail/trail:Trail example <id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi