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);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:
- Oss
Bucket stringName The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
- Role
Name string The RAM role in ActionTrail permitted by the user.
- Event
Rw 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.
- Oss
Key stringPrefix The prefix of the specified OSS bucket name. This parameter can be left empty.
- Sls
Project stringArn The unique ARN of the Log Service project.
- Sls
Write stringRole Arn The unique ARN of the Log Service role.
- Oss
Bucket stringName The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
- Role
Name string The RAM role in ActionTrail permitted by the user.
- Event
Rw 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.
- Oss
Key stringPrefix The prefix of the specified OSS bucket name. This parameter can be left empty.
- Sls
Project stringArn The unique ARN of the Log Service project.
- Sls
Write stringRole Arn The unique ARN of the Log Service role.
- oss
Bucket stringName The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
- role
Name string The RAM role in ActionTrail permitted by the user.
- event
Rw 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.
- oss
Key stringPrefix The prefix of the specified OSS bucket name. This parameter can be left empty.
- sls
Project stringArn The unique ARN of the Log Service project.
- sls
Write stringRole Arn The unique ARN of the Log Service role.
- oss_
bucket_ strname 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_ strprefix The prefix of the specified OSS bucket name. This parameter can be left empty.
- sls_
project_ strarn The unique ARN of the Log Service project.
- sls_
write_ strrole_ arn 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:
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): Trailstatic 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:
- Event
Rw 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.
- Oss
Bucket stringName The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
- Oss
Key stringPrefix The prefix of the specified OSS bucket name. This parameter can be left empty.
- Role
Name string The RAM role in ActionTrail permitted by the user.
- Sls
Project stringArn The unique ARN of the Log Service project.
- Sls
Write stringRole Arn The unique ARN of the Log Service role.
- Event
Rw 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.
- Oss
Bucket stringName The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
- Oss
Key stringPrefix The prefix of the specified OSS bucket name. This parameter can be left empty.
- Role
Name string The RAM role in ActionTrail permitted by the user.
- Sls
Project stringArn The unique ARN of the Log Service project.
- Sls
Write stringRole Arn The unique ARN of the Log Service role.
- event
Rw 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.
- oss
Bucket stringName The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
- oss
Key stringPrefix The prefix of the specified OSS bucket name. This parameter can be left empty.
- role
Name string The RAM role in ActionTrail permitted by the user.
- sls
Project stringArn The unique ARN of the Log Service project.
- sls
Write stringRole Arn 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_ strname The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
- oss_
key_ strprefix 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_ strarn The unique ARN of the Log Service project.
- sls_
write_ strrole_ arn 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
alicloudTerraform Provider.