1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. actiontrail
  5. Trail
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

alicloud.actiontrail.Trail

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

    Provides a ActionTrail Trail resource. For information about alicloud actiontrail trail and how to use it, see What is Resource Alicloud ActionTrail Trail.

    NOTE: Available since v1.95.0.

    NOTE: You can create a trail to deliver events to Log Service, Object Storage Service (OSS), or both. Before you call this operation to create a trail, make sure that the following requirements are met.

    • Deliver events to Log Service: A project is created in Log Service.
    • Deliver events to OSS: A bucket is created in OSS.

    Example 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") || "tf-example";
    const _default = new random.index.Integer("default", {
        min: 10000,
        max: 99999,
    });
    const example = alicloud.getRegions({
        current: true,
    });
    const exampleGetAccount = alicloud.getAccount({});
    const exampleProject = new alicloud.log.Project("example", {
        projectName: `${name}-${_default.result}`,
        description: "tf actiontrail example",
    });
    const exampleGetRoles = alicloud.ram.getRoles({
        nameRegex: "AliyunServiceRoleForActionTrail",
    });
    const exampleTrail = new alicloud.actiontrail.Trail("example", {
        trailName: name,
        slsWriteRoleArn: exampleGetRoles.then(exampleGetRoles => exampleGetRoles.roles?.[0]?.arn),
        slsProjectArn: pulumi.all([example, exampleGetAccount, exampleProject.name]).apply(([example, exampleGetAccount, name]) => `acs:log:${example.regions?.[0]?.id}:${exampleGetAccount.id}:project/${name}`),
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_random as random
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default = random.index.Integer("default",
        min=10000,
        max=99999)
    example = alicloud.get_regions(current=True)
    example_get_account = alicloud.get_account()
    example_project = alicloud.log.Project("example",
        project_name=f"{name}-{default['result']}",
        description="tf actiontrail example")
    example_get_roles = alicloud.ram.get_roles(name_regex="AliyunServiceRoleForActionTrail")
    example_trail = alicloud.actiontrail.Trail("example",
        trail_name=name,
        sls_write_role_arn=example_get_roles.roles[0].arn,
        sls_project_arn=example_project.name.apply(lambda name: f"acs:log:{example.regions[0].id}:{example_get_account.id}: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 := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
    			Min: 10000,
    			Max: 99999,
    		})
    		if err != nil {
    			return err
    		}
    		example, err := alicloud.GetRegions(ctx, &alicloud.GetRegionsArgs{
    			Current: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleGetAccount, err := alicloud.GetAccount(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		exampleProject, err := log.NewProject(ctx, "example", &log.ProjectArgs{
    			ProjectName: pulumi.String(fmt.Sprintf("%v-%v", name, _default.Result)),
    			Description: pulumi.String("tf actiontrail example"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleGetRoles, err := ram.GetRoles(ctx, &ram.GetRolesArgs{
    			NameRegex: pulumi.StringRef("AliyunServiceRoleForActionTrail"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = actiontrail.NewTrail(ctx, "example", &actiontrail.TrailArgs{
    			TrailName:       pulumi.String(name),
    			SlsWriteRoleArn: pulumi.String(exampleGetRoles.Roles[0].Arn),
    			SlsProjectArn: exampleProject.Name.ApplyT(func(name string) (string, error) {
    				return fmt.Sprintf("acs:log:%v:%v:project/%v", example.Regions[0].Id, exampleGetAccount.Id, name), 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") ?? "tf-example";
        var @default = new Random.Index.Integer("default", new()
        {
            Min = 10000,
            Max = 99999,
        });
    
        var example = AliCloud.GetRegions.Invoke(new()
        {
            Current = true,
        });
    
        var exampleGetAccount = AliCloud.GetAccount.Invoke();
    
        var exampleProject = new AliCloud.Log.Project("example", new()
        {
            ProjectName = $"{name}-{@default.Result}",
            Description = "tf actiontrail example",
        });
    
        var exampleGetRoles = AliCloud.Ram.GetRoles.Invoke(new()
        {
            NameRegex = "AliyunServiceRoleForActionTrail",
        });
    
        var exampleTrail = new AliCloud.ActionTrail.Trail("example", new()
        {
            TrailName = name,
            SlsWriteRoleArn = exampleGetRoles.Apply(getRolesResult => getRolesResult.Roles[0]?.Arn),
            SlsProjectArn = Output.Tuple(example, exampleGetAccount, exampleProject.Name).Apply(values =>
            {
                var example = values.Item1;
                var exampleGetAccount = values.Item2;
                var name = values.Item3;
                return $"acs:log:{example.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)}:{exampleGetAccount.Apply(getAccountResult => getAccountResult.Id)}:project/{name}";
            }),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.random.integer;
    import com.pulumi.random.IntegerArgs;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetRegionsArgs;
    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("tf-example");
            var default_ = new Integer("default", IntegerArgs.builder()        
                .min(10000)
                .max(99999)
                .build());
    
            final var example = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
                .current(true)
                .build());
    
            final var exampleGetAccount = AlicloudFunctions.getAccount();
    
            var exampleProject = new Project("exampleProject", ProjectArgs.builder()        
                .projectName(String.format("%s-%s", name,default_.result()))
                .description("tf actiontrail example")
                .build());
    
            final var exampleGetRoles = RamFunctions.getRoles(GetRolesArgs.builder()
                .nameRegex("AliyunServiceRoleForActionTrail")
                .build());
    
            var exampleTrail = new Trail("exampleTrail", TrailArgs.builder()        
                .trailName(name)
                .slsWriteRoleArn(exampleGetRoles.applyValue(getRolesResult -> getRolesResult.roles()[0].arn()))
                .slsProjectArn(exampleProject.name().applyValue(name -> String.format("acs:log:%s:%s:project/%s", example.applyValue(getRegionsResult -> getRegionsResult.regions()[0].id()),exampleGetAccount.applyValue(getAccountResult -> getAccountResult.id()),name)))
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      default:
        type: random:integer
        properties:
          min: 10000
          max: 99999
      exampleProject:
        type: alicloud:log:Project
        name: example
        properties:
          projectName: ${name}-${default.result}
          description: tf actiontrail example
      exampleTrail:
        type: alicloud:actiontrail:Trail
        name: example
        properties:
          trailName: ${name}
          slsWriteRoleArn: ${exampleGetRoles.roles[0].arn}
          slsProjectArn: acs:log:${example.regions[0].id}:${exampleGetAccount.id}:project/${exampleProject.name}
    variables:
      example:
        fn::invoke:
          Function: alicloud:getRegions
          Arguments:
            current: true
      exampleGetAccount:
        fn::invoke:
          Function: alicloud:getAccount
          Arguments: {}
      exampleGetRoles:
        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,
              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.

    Example

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

    var trailResource = new AliCloud.ActionTrail.Trail("trailResource", new()
    {
        EventRw = "string",
        IsOrganizationTrail = false,
        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),
    	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)
        .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,
        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,
        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
        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

    The Trail resource accepts the following input properties:

    EventRw string
    Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default to Write.
    IsOrganizationTrail bool
    Specifies whether to create a multi-account trail. Valid values:true: Create a multi-account trail.false: Create a single-account trail. It is the default value.
    MnsTopicArn string
    Field mns_topic_arn has been deprecated from 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 version 1.95.0. Use trail_name instead.

    Deprecated: Field 'name' has been deprecated from version 1.95.0. Use 'trail_name' instead.

    OssBucketName string
    The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
    OssKeyPrefix string
    The prefix of the specified OSS bucket name. This parameter can be left empty.
    OssWriteRoleArn string
    The unique ARN of the Oss role.
    RoleName string
    Field name has been deprecated from version 1.118.0.

    Deprecated: Field 'role_name' has been deprecated from version 1.118.0

    SlsProjectArn string
    The unique ARN of the Log Service project. Ensure that sls_project_arn is valid .
    SlsWriteRoleArn string
    The unique ARN of the Log Service role.
    Status string
    The status of ActionTrail Trail. After creation, tracking is turned on by default, and you can set the status value to Disable to turn off tracking. Valid values: Enable, Disable. Default to Enable.
    TrailName string
    The name of the trail to be created, which must be unique for an account.
    TrailRegion string
    The regions to which the trail is applied. Default to All.
    EventRw string
    Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default to Write.
    IsOrganizationTrail bool
    Specifies whether to create a multi-account trail. Valid values:true: Create a multi-account trail.false: Create a single-account trail. It is the default value.
    MnsTopicArn string
    Field mns_topic_arn has been deprecated from 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 version 1.95.0. Use trail_name instead.

    Deprecated: Field 'name' has been deprecated from version 1.95.0. Use 'trail_name' instead.

    OssBucketName string
    The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
    OssKeyPrefix string
    The prefix of the specified OSS bucket name. This parameter can be left empty.
    OssWriteRoleArn string
    The unique ARN of the Oss role.
    RoleName string
    Field name has been deprecated from version 1.118.0.

    Deprecated: Field 'role_name' has been deprecated from version 1.118.0

    SlsProjectArn string
    The unique ARN of the Log Service project. Ensure that sls_project_arn is valid .
    SlsWriteRoleArn string
    The unique ARN of the Log Service role.
    Status string
    The status of ActionTrail Trail. After creation, tracking is turned on by default, and you can set the status value to Disable to turn off tracking. Valid values: Enable, Disable. Default to Enable.
    TrailName string
    The name of the trail to be created, which must be unique for an account.
    TrailRegion string
    The regions to which the trail is applied. Default to All.
    eventRw String
    Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default to Write.
    isOrganizationTrail Boolean
    Specifies whether to create a multi-account trail. Valid values:true: Create a multi-account trail.false: Create a single-account trail. It is the default value.
    mnsTopicArn String
    Field mns_topic_arn has been deprecated from 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 version 1.95.0. Use trail_name instead.

    Deprecated: Field 'name' has been deprecated from version 1.95.0. Use 'trail_name' instead.

    ossBucketName String
    The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
    ossKeyPrefix String
    The prefix of the specified OSS bucket name. This parameter can be left empty.
    ossWriteRoleArn String
    The unique ARN of the Oss role.
    roleName String
    Field name has been deprecated from version 1.118.0.

    Deprecated: Field 'role_name' has been deprecated from version 1.118.0

    slsProjectArn String
    The unique ARN of the Log Service project. Ensure that sls_project_arn is valid .
    slsWriteRoleArn String
    The unique ARN of the Log Service role.
    status String
    The status of ActionTrail Trail. After creation, tracking is turned on by default, and you can set the status value to Disable to turn off tracking. Valid values: Enable, Disable. Default to Enable.
    trailName String
    The name of the trail to be created, which must be unique for an account.
    trailRegion String
    The regions to which the trail is applied. Default to All.
    eventRw string
    Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default to Write.
    isOrganizationTrail boolean
    Specifies whether to create a multi-account trail. Valid values:true: Create a multi-account trail.false: Create a single-account trail. It is the default value.
    mnsTopicArn string
    Field mns_topic_arn has been deprecated from 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 version 1.95.0. Use trail_name instead.

    Deprecated: Field 'name' has been deprecated from version 1.95.0. Use 'trail_name' instead.

    ossBucketName string
    The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
    ossKeyPrefix string
    The prefix of the specified OSS bucket name. This parameter can be left empty.
    ossWriteRoleArn string
    The unique ARN of the Oss role.
    roleName string
    Field name has been deprecated from version 1.118.0.

    Deprecated: Field 'role_name' has been deprecated from version 1.118.0

    slsProjectArn string
    The unique ARN of the Log Service project. Ensure that sls_project_arn is valid .
    slsWriteRoleArn string
    The unique ARN of the Log Service role.
    status string
    The status of ActionTrail Trail. After creation, tracking is turned on by default, and you can set the status value to Disable to turn off tracking. Valid values: Enable, Disable. Default to Enable.
    trailName string
    The name of the trail to be created, which must be unique for an account.
    trailRegion string
    The regions to which the trail is applied. Default to All.
    event_rw str
    Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default to Write.
    is_organization_trail bool
    Specifies whether to create a multi-account trail. Valid values:true: Create a multi-account trail.false: Create a single-account trail. It is the default value.
    mns_topic_arn str
    Field mns_topic_arn has been deprecated from 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 version 1.95.0. Use trail_name instead.

    Deprecated: Field 'name' has been deprecated from version 1.95.0. Use 'trail_name' instead.

    oss_bucket_name str
    The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
    oss_key_prefix str
    The prefix of the specified OSS bucket name. This parameter can be left empty.
    oss_write_role_arn str
    The unique ARN of the Oss role.
    role_name str
    Field name has been deprecated from version 1.118.0.

    Deprecated: Field 'role_name' has been deprecated from version 1.118.0

    sls_project_arn str
    The unique ARN of the Log Service project. Ensure that sls_project_arn is valid .
    sls_write_role_arn str
    The unique ARN of the Log Service role.
    status str
    The status of ActionTrail Trail. After creation, tracking is turned on by default, and you can set the status value to Disable to turn off tracking. Valid values: Enable, Disable. Default to Enable.
    trail_name str
    The name of the trail to be created, which must be unique for an account.
    trail_region str
    The regions to which the trail is applied. Default to All.
    eventRw String
    Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default to Write.
    isOrganizationTrail Boolean
    Specifies whether to create a multi-account trail. Valid values:true: Create a multi-account trail.false: Create a single-account trail. It is the default value.
    mnsTopicArn String
    Field mns_topic_arn has been deprecated from 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 version 1.95.0. Use trail_name instead.

    Deprecated: Field 'name' has been deprecated from version 1.95.0. Use 'trail_name' instead.

    ossBucketName String
    The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
    ossKeyPrefix String
    The prefix of the specified OSS bucket name. This parameter can be left empty.
    ossWriteRoleArn String
    The unique ARN of the Oss role.
    roleName String
    Field name has been deprecated from version 1.118.0.

    Deprecated: Field 'role_name' has been deprecated from version 1.118.0

    slsProjectArn String
    The unique ARN of the Log Service project. Ensure that sls_project_arn is valid .
    slsWriteRoleArn String
    The unique ARN of the Log Service role.
    status String
    The status of ActionTrail Trail. After creation, tracking is turned on by default, and you can set the status value to Disable to turn off tracking. Valid values: Enable, Disable. Default to Enable.
    trailName String
    The name of the trail to be created, which must be unique for an account.
    trailRegion String
    The regions to which the trail is applied. Default to All.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    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,
            event_rw: Optional[str] = None,
            is_organization_trail: Optional[bool] = 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) -> 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)
    Resource lookup is not supported in YAML
    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:
    EventRw string
    Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default to Write.
    IsOrganizationTrail bool
    Specifies whether to create a multi-account trail. Valid values:true: Create a multi-account trail.false: Create a single-account trail. It is the default value.
    MnsTopicArn string
    Field mns_topic_arn has been deprecated from 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 version 1.95.0. Use trail_name instead.

    Deprecated: Field 'name' has been deprecated from version 1.95.0. Use 'trail_name' instead.

    OssBucketName string
    The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
    OssKeyPrefix string
    The prefix of the specified OSS bucket name. This parameter can be left empty.
    OssWriteRoleArn string
    The unique ARN of the Oss role.
    RoleName string
    Field name has been deprecated from version 1.118.0.

    Deprecated: Field 'role_name' has been deprecated from version 1.118.0

    SlsProjectArn string
    The unique ARN of the Log Service project. Ensure that sls_project_arn is valid .
    SlsWriteRoleArn string
    The unique ARN of the Log Service role.
    Status string
    The status of ActionTrail Trail. After creation, tracking is turned on by default, and you can set the status value to Disable to turn off tracking. Valid values: Enable, Disable. Default to Enable.
    TrailName string
    The name of the trail to be created, which must be unique for an account.
    TrailRegion string
    The regions to which the trail is applied. Default to All.
    EventRw string
    Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default to Write.
    IsOrganizationTrail bool
    Specifies whether to create a multi-account trail. Valid values:true: Create a multi-account trail.false: Create a single-account trail. It is the default value.
    MnsTopicArn string
    Field mns_topic_arn has been deprecated from 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 version 1.95.0. Use trail_name instead.

    Deprecated: Field 'name' has been deprecated from version 1.95.0. Use 'trail_name' instead.

    OssBucketName string
    The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
    OssKeyPrefix string
    The prefix of the specified OSS bucket name. This parameter can be left empty.
    OssWriteRoleArn string
    The unique ARN of the Oss role.
    RoleName string
    Field name has been deprecated from version 1.118.0.

    Deprecated: Field 'role_name' has been deprecated from version 1.118.0

    SlsProjectArn string
    The unique ARN of the Log Service project. Ensure that sls_project_arn is valid .
    SlsWriteRoleArn string
    The unique ARN of the Log Service role.
    Status string
    The status of ActionTrail Trail. After creation, tracking is turned on by default, and you can set the status value to Disable to turn off tracking. Valid values: Enable, Disable. Default to Enable.
    TrailName string
    The name of the trail to be created, which must be unique for an account.
    TrailRegion string
    The regions to which the trail is applied. Default to All.
    eventRw String
    Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default to Write.
    isOrganizationTrail Boolean
    Specifies whether to create a multi-account trail. Valid values:true: Create a multi-account trail.false: Create a single-account trail. It is the default value.
    mnsTopicArn String
    Field mns_topic_arn has been deprecated from 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 version 1.95.0. Use trail_name instead.

    Deprecated: Field 'name' has been deprecated from version 1.95.0. Use 'trail_name' instead.

    ossBucketName String
    The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
    ossKeyPrefix String
    The prefix of the specified OSS bucket name. This parameter can be left empty.
    ossWriteRoleArn String
    The unique ARN of the Oss role.
    roleName String
    Field name has been deprecated from version 1.118.0.

    Deprecated: Field 'role_name' has been deprecated from version 1.118.0

    slsProjectArn String
    The unique ARN of the Log Service project. Ensure that sls_project_arn is valid .
    slsWriteRoleArn String
    The unique ARN of the Log Service role.
    status String
    The status of ActionTrail Trail. After creation, tracking is turned on by default, and you can set the status value to Disable to turn off tracking. Valid values: Enable, Disable. Default to Enable.
    trailName String
    The name of the trail to be created, which must be unique for an account.
    trailRegion String
    The regions to which the trail is applied. Default to All.
    eventRw string
    Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default to Write.
    isOrganizationTrail boolean
    Specifies whether to create a multi-account trail. Valid values:true: Create a multi-account trail.false: Create a single-account trail. It is the default value.
    mnsTopicArn string
    Field mns_topic_arn has been deprecated from 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 version 1.95.0. Use trail_name instead.

    Deprecated: Field 'name' has been deprecated from version 1.95.0. Use 'trail_name' instead.

    ossBucketName string
    The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
    ossKeyPrefix string
    The prefix of the specified OSS bucket name. This parameter can be left empty.
    ossWriteRoleArn string
    The unique ARN of the Oss role.
    roleName string
    Field name has been deprecated from version 1.118.0.

    Deprecated: Field 'role_name' has been deprecated from version 1.118.0

    slsProjectArn string
    The unique ARN of the Log Service project. Ensure that sls_project_arn is valid .
    slsWriteRoleArn string
    The unique ARN of the Log Service role.
    status string
    The status of ActionTrail Trail. After creation, tracking is turned on by default, and you can set the status value to Disable to turn off tracking. Valid values: Enable, Disable. Default to Enable.
    trailName string
    The name of the trail to be created, which must be unique for an account.
    trailRegion string
    The regions to which the trail is applied. Default to All.
    event_rw str
    Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default to Write.
    is_organization_trail bool
    Specifies whether to create a multi-account trail. Valid values:true: Create a multi-account trail.false: Create a single-account trail. It is the default value.
    mns_topic_arn str
    Field mns_topic_arn has been deprecated from 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 version 1.95.0. Use trail_name instead.

    Deprecated: Field 'name' has been deprecated from version 1.95.0. Use 'trail_name' instead.

    oss_bucket_name str
    The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
    oss_key_prefix str
    The prefix of the specified OSS bucket name. This parameter can be left empty.
    oss_write_role_arn str
    The unique ARN of the Oss role.
    role_name str
    Field name has been deprecated from version 1.118.0.

    Deprecated: Field 'role_name' has been deprecated from version 1.118.0

    sls_project_arn str
    The unique ARN of the Log Service project. Ensure that sls_project_arn is valid .
    sls_write_role_arn str
    The unique ARN of the Log Service role.
    status str
    The status of ActionTrail Trail. After creation, tracking is turned on by default, and you can set the status value to Disable to turn off tracking. Valid values: Enable, Disable. Default to Enable.
    trail_name str
    The name of the trail to be created, which must be unique for an account.
    trail_region str
    The regions to which the trail is applied. Default to All.
    eventRw String
    Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default to Write.
    isOrganizationTrail Boolean
    Specifies whether to create a multi-account trail. Valid values:true: Create a multi-account trail.false: Create a single-account trail. It is the default value.
    mnsTopicArn String
    Field mns_topic_arn has been deprecated from 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 version 1.95.0. Use trail_name instead.

    Deprecated: Field 'name' has been deprecated from version 1.95.0. Use 'trail_name' instead.

    ossBucketName String
    The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
    ossKeyPrefix String
    The prefix of the specified OSS bucket name. This parameter can be left empty.
    ossWriteRoleArn String
    The unique ARN of the Oss role.
    roleName String
    Field name has been deprecated from version 1.118.0.

    Deprecated: Field 'role_name' has been deprecated from version 1.118.0

    slsProjectArn String
    The unique ARN of the Log Service project. Ensure that sls_project_arn is valid .
    slsWriteRoleArn String
    The unique ARN of the Log Service role.
    status String
    The status of ActionTrail Trail. After creation, tracking is turned on by default, and you can set the status value to Disable to turn off tracking. Valid values: Enable, Disable. Default to Enable.
    trailName String
    The name of the trail to be created, which must be unique for an account.
    trailRegion String
    The regions to which the trail is applied. Default to All.

    Import

    Action trail can be imported using the id or trail_name, e.g.

    $ pulumi import alicloud:actiontrail/trail:Trail default abc12345678
    

    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.54.0 published on Wednesday, Apr 24, 2024 by Pulumi