Trail

Provides a new resource to manage Action Trail.

NOTE: Available in 1.35.0+

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        // Create a new action trail.
        var foo = new AliCloud.ActionTrail.Trail("foo", new AliCloud.ActionTrail.TrailArgs
        {
            EventRw = "Write-test",
            OssBucketName = alicloud_oss_bucket.Bucket.Id,
            OssKeyPrefix = "at-product-account-audit-B",
            RoleName = alicloud_ram_role_policy_attachment.Attach.Role_name,
        });
    }

}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

# Create a new action trail.
foo = alicloud.actiontrail.Trail("foo",
    event_rw="Write-test",
    oss_bucket_name=alicloud_oss_bucket["bucket"]["id"],
    oss_key_prefix="at-product-account-audit-B",
    role_name=alicloud_ram_role_policy_attachment["attach"]["role_name"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

// Create a new action trail.
const foo = new alicloud.actiontrail.Trail("foo", {
    eventRw: "Write-test",
    ossBucketName: alicloud_oss_bucket_bucket.id,
    ossKeyPrefix: "at-product-account-audit-B",
    roleName: alicloud_ram_role_policy_attachment_attach.roleName,
});

Create a Trail Resource

new Trail(name: string, args: TrailArgs, opts?: CustomResourceOptions);
def Trail(resource_name, opts=None, event_rw=None, name=None, oss_bucket_name=None, oss_key_prefix=None, role_name=None, sls_project_arn=None, sls_write_role_arn=None, __props__=None);
func NewTrail(ctx *Context, name string, args TrailArgs, opts ...ResourceOption) (*Trail, error)
public Trail(string name, TrailArgs args, CustomResourceOptions? opts = null)
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.
opts ResourceOptions
A bag of options that control this 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.

Trail Resource Properties

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

Inputs

The Trail resource accepts the following input properties:

OssBucketName string

The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.

RoleName string

The RAM role in ActionTrail permitted by the user.

EventRw string

Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default value: Write.

Name string

The name of the trail to be created, which must be unique for an account.

OssKeyPrefix string

The prefix of the specified OSS bucket name. This parameter can be left empty.

SlsProjectArn string

The unique ARN of the Log Service project.

SlsWriteRoleArn string

The unique ARN of the Log Service role.

OssBucketName string

The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.

RoleName string

The RAM role in ActionTrail permitted by the user.

EventRw string

Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default value: Write.

Name string

The name of the trail to be created, which must be unique for an account.

OssKeyPrefix string

The prefix of the specified OSS bucket name. This parameter can be left empty.

SlsProjectArn string

The unique ARN of the Log Service project.

SlsWriteRoleArn string

The unique ARN of the Log Service role.

ossBucketName string

The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.

roleName string

The RAM role in ActionTrail permitted by the user.

eventRw string

Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default value: Write.

name string

The name of the trail to be created, which must be unique for an account.

ossKeyPrefix string

The prefix of the specified OSS bucket name. This parameter can be left empty.

slsProjectArn string

The unique ARN of the Log Service project.

slsWriteRoleArn string

The unique ARN of the Log Service role.

oss_bucket_name str

The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.

role_name str

The RAM role in ActionTrail permitted by the user.

event_rw str

Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default value: Write.

name str

The name of the trail to be created, which must be unique for an account.

oss_key_prefix str

The prefix of the specified OSS bucket name. This parameter can be left empty.

sls_project_arn str

The unique ARN of the Log Service project.

sls_write_role_arn str

The unique ARN of the Log Service role.

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 str
The provider-assigned unique ID for this managed resource.

Look up an 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
static get(resource_name, id, opts=None, event_rw=None, name=None, oss_bucket_name=None, oss_key_prefix=None, role_name=None, sls_project_arn=None, sls_write_role_arn=None, __props__=None);
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)
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.

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 value: Write.

Name string

The name of the trail to be created, which must be unique for an account.

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.

RoleName string

The RAM role in ActionTrail permitted by the user.

SlsProjectArn string

The unique ARN of the Log Service project.

SlsWriteRoleArn string

The unique ARN of the Log Service role.

EventRw string

Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default value: Write.

Name string

The name of the trail to be created, which must be unique for an account.

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.

RoleName string

The RAM role in ActionTrail permitted by the user.

SlsProjectArn string

The unique ARN of the Log Service project.

SlsWriteRoleArn string

The unique ARN of the Log Service role.

eventRw string

Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default value: Write.

name string

The name of the trail to be created, which must be unique for an account.

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.

roleName string

The RAM role in ActionTrail permitted by the user.

slsProjectArn string

The unique ARN of the Log Service project.

slsWriteRoleArn string

The unique ARN of the Log Service role.

event_rw str

Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default value: Write.

name str

The name of the trail to be created, which must be unique for an account.

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.

role_name str

The RAM role in ActionTrail permitted by the user.

sls_project_arn str

The unique ARN of the Log Service project.

sls_write_role_arn str

The unique ARN of the Log Service role.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.