alicloud.actiontrail.Trail
Explore with Pulumi AI
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)
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:
- Event
Rw string - The read/write type of the events to be delivered. Default value:
All
. Valid values:Read
,Write
,All
. - Is
Organization boolTrail - Specifies whether to create a multi-account trail. Default value:
false
. Valid values: - Max
Compute stringProject Arn - The ARN of the MaxCompute project to which you want to deliver events.
- Max
Compute stringWrite Role Arn - The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
- Mns
Topic stringArn - Field
mns_topic_arn
has been deprecated from provider version 1.118.0. - Name string
- Field
name
has been deprecated from provider version 1.95.0. New fieldtrail_name
instead. - Oss
Bucket stringName - The OSS bucket to which the trail delivers logs.
- Oss
Key stringPrefix - The prefix of the file name in the OSS bucket to which the trail delivers logs.
- Oss
Write stringRole Arn - The name of the RAM role that the user allows ActionTrail to access OSS service.
- Role
Name string - Field
role_name
has been deprecated from provider version 1.118.0. - Sls
Project stringArn - The ARN of the Simple Log Service project to which the trail delivers logs.
- Sls
Write stringRole Arn - 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
. - Trail
Name string - The name of the trail to be created.
- Trail
Region string - The region of the trail.
- Event
Rw string - The read/write type of the events to be delivered. Default value:
All
. Valid values:Read
,Write
,All
. - Is
Organization boolTrail - Specifies whether to create a multi-account trail. Default value:
false
. Valid values: - Max
Compute stringProject Arn - The ARN of the MaxCompute project to which you want to deliver events.
- Max
Compute stringWrite Role Arn - The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
- Mns
Topic stringArn - Field
mns_topic_arn
has been deprecated from provider version 1.118.0. - Name string
- Field
name
has been deprecated from provider version 1.95.0. New fieldtrail_name
instead. - Oss
Bucket stringName - The OSS bucket to which the trail delivers logs.
- Oss
Key stringPrefix - The prefix of the file name in the OSS bucket to which the trail delivers logs.
- Oss
Write stringRole Arn - The name of the RAM role that the user allows ActionTrail to access OSS service.
- Role
Name string - Field
role_name
has been deprecated from provider version 1.118.0. - Sls
Project stringArn - The ARN of the Simple Log Service project to which the trail delivers logs.
- Sls
Write stringRole Arn - 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
. - Trail
Name string - The name of the trail to be created.
- Trail
Region string - The region of the trail.
- event
Rw String - The read/write type of the events to be delivered. Default value:
All
. Valid values:Read
,Write
,All
. - is
Organization BooleanTrail - Specifies whether to create a multi-account trail. Default value:
false
. Valid values: - max
Compute StringProject Arn - The ARN of the MaxCompute project to which you want to deliver events.
- max
Compute StringWrite Role Arn - The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
- mns
Topic StringArn - Field
mns_topic_arn
has been deprecated from provider version 1.118.0. - name String
- Field
name
has been deprecated from provider version 1.95.0. New fieldtrail_name
instead. - oss
Bucket StringName - The OSS bucket to which the trail delivers logs.
- oss
Key StringPrefix - The prefix of the file name in the OSS bucket to which the trail delivers logs.
- oss
Write StringRole Arn - The name of the RAM role that the user allows ActionTrail to access OSS service.
- role
Name String - Field
role_name
has been deprecated from provider version 1.118.0. - sls
Project StringArn - The ARN of the Simple Log Service project to which the trail delivers logs.
- sls
Write StringRole Arn - 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
. - trail
Name String - The name of the trail to be created.
- trail
Region String - The region of the trail.
- event
Rw string - The read/write type of the events to be delivered. Default value:
All
. Valid values:Read
,Write
,All
. - is
Organization booleanTrail - Specifies whether to create a multi-account trail. Default value:
false
. Valid values: - max
Compute stringProject Arn - The ARN of the MaxCompute project to which you want to deliver events.
- max
Compute stringWrite Role Arn - The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
- mns
Topic stringArn - Field
mns_topic_arn
has been deprecated from provider version 1.118.0. - name string
- Field
name
has been deprecated from provider version 1.95.0. New fieldtrail_name
instead. - oss
Bucket stringName - The OSS bucket to which the trail delivers logs.
- oss
Key stringPrefix - The prefix of the file name in the OSS bucket to which the trail delivers logs.
- oss
Write stringRole Arn - The name of the RAM role that the user allows ActionTrail to access OSS service.
- role
Name string - Field
role_name
has been deprecated from provider version 1.118.0. - sls
Project stringArn - The ARN of the Simple Log Service project to which the trail delivers logs.
- sls
Write stringRole Arn - 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
. - trail
Name string - The name of the trail to be created.
- trail
Region 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_ booltrail - Specifies whether to create a multi-account trail. Default value:
false
. Valid values: - max_
compute_ strproject_ arn - The ARN of the MaxCompute project to which you want to deliver events.
- max_
compute_ strwrite_ role_ arn - The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
- mns_
topic_ strarn - Field
mns_topic_arn
has been deprecated from provider version 1.118.0. - name str
- Field
name
has been deprecated from provider version 1.95.0. New fieldtrail_name
instead. - oss_
bucket_ strname - The OSS bucket to which the trail delivers logs.
- oss_
key_ strprefix - The prefix of the file name in the OSS bucket to which the trail delivers logs.
- oss_
write_ strrole_ arn - 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. - sls_
project_ strarn - The ARN of the Simple Log Service project to which the trail delivers logs.
- sls_
write_ strrole_ arn - 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.
- event
Rw String - The read/write type of the events to be delivered. Default value:
All
. Valid values:Read
,Write
,All
. - is
Organization BooleanTrail - Specifies whether to create a multi-account trail. Default value:
false
. Valid values: - max
Compute StringProject Arn - The ARN of the MaxCompute project to which you want to deliver events.
- max
Compute StringWrite Role Arn - The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
- mns
Topic StringArn - Field
mns_topic_arn
has been deprecated from provider version 1.118.0. - name String
- Field
name
has been deprecated from provider version 1.95.0. New fieldtrail_name
instead. - oss
Bucket StringName - The OSS bucket to which the trail delivers logs.
- oss
Key StringPrefix - The prefix of the file name in the OSS bucket to which the trail delivers logs.
- oss
Write StringRole Arn - The name of the RAM role that the user allows ActionTrail to access OSS service.
- role
Name String - Field
role_name
has been deprecated from provider version 1.118.0. - sls
Project StringArn - The ARN of the Simple Log Service project to which the trail delivers logs.
- sls
Write StringRole Arn - 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
. - trail
Name String - The name of the trail to be created.
- trail
Region 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:
- Create
Time string - (Available since v1.256.0) The time when the trail was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Region
Id string - (Available since v1.256.0) The home region of the trail.
- Create
Time string - (Available since v1.256.0) The time when the trail was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Region
Id string - (Available since v1.256.0) The home region of the trail.
- create
Time String - (Available since v1.256.0) The time when the trail was created.
- id String
- The provider-assigned unique ID for this managed resource.
- region
Id String - (Available since v1.256.0) The home region of the trail.
- create
Time string - (Available since v1.256.0) The time when the trail was created.
- id string
- The provider-assigned unique ID for this managed resource.
- region
Id 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.
- create
Time String - (Available since v1.256.0) The time when the trail was created.
- id String
- The provider-assigned unique ID for this managed resource.
- region
Id 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.
- Create
Time string - (Available since v1.256.0) The time when the trail was created.
- Event
Rw string - The read/write type of the events to be delivered. Default value:
All
. Valid values:Read
,Write
,All
. - Is
Organization boolTrail - Specifies whether to create a multi-account trail. Default value:
false
. Valid values: - Max
Compute stringProject Arn - The ARN of the MaxCompute project to which you want to deliver events.
- Max
Compute stringWrite Role Arn - The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
- Mns
Topic stringArn - Field
mns_topic_arn
has been deprecated from provider version 1.118.0. - Name string
- Field
name
has been deprecated from provider version 1.95.0. New fieldtrail_name
instead. - Oss
Bucket stringName - The OSS bucket to which the trail delivers logs.
- Oss
Key stringPrefix - The prefix of the file name in the OSS bucket to which the trail delivers logs.
- Oss
Write stringRole Arn - The name of the RAM role that the user allows ActionTrail to access OSS service.
- Region
Id string - (Available since v1.256.0) The home region of the trail.
- Role
Name string - Field
role_name
has been deprecated from provider version 1.118.0. - Sls
Project stringArn - The ARN of the Simple Log Service project to which the trail delivers logs.
- Sls
Write stringRole Arn - 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
. - Trail
Name string - The name of the trail to be created.
- Trail
Region string - The region of the trail.
- Create
Time string - (Available since v1.256.0) The time when the trail was created.
- Event
Rw string - The read/write type of the events to be delivered. Default value:
All
. Valid values:Read
,Write
,All
. - Is
Organization boolTrail - Specifies whether to create a multi-account trail. Default value:
false
. Valid values: - Max
Compute stringProject Arn - The ARN of the MaxCompute project to which you want to deliver events.
- Max
Compute stringWrite Role Arn - The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
- Mns
Topic stringArn - Field
mns_topic_arn
has been deprecated from provider version 1.118.0. - Name string
- Field
name
has been deprecated from provider version 1.95.0. New fieldtrail_name
instead. - Oss
Bucket stringName - The OSS bucket to which the trail delivers logs.
- Oss
Key stringPrefix - The prefix of the file name in the OSS bucket to which the trail delivers logs.
- Oss
Write stringRole Arn - The name of the RAM role that the user allows ActionTrail to access OSS service.
- Region
Id string - (Available since v1.256.0) The home region of the trail.
- Role
Name string - Field
role_name
has been deprecated from provider version 1.118.0. - Sls
Project stringArn - The ARN of the Simple Log Service project to which the trail delivers logs.
- Sls
Write stringRole Arn - 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
. - Trail
Name string - The name of the trail to be created.
- Trail
Region string - The region of the trail.
- create
Time String - (Available since v1.256.0) The time when the trail was created.
- event
Rw String - The read/write type of the events to be delivered. Default value:
All
. Valid values:Read
,Write
,All
. - is
Organization BooleanTrail - Specifies whether to create a multi-account trail. Default value:
false
. Valid values: - max
Compute StringProject Arn - The ARN of the MaxCompute project to which you want to deliver events.
- max
Compute StringWrite Role Arn - The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
- mns
Topic StringArn - Field
mns_topic_arn
has been deprecated from provider version 1.118.0. - name String
- Field
name
has been deprecated from provider version 1.95.0. New fieldtrail_name
instead. - oss
Bucket StringName - The OSS bucket to which the trail delivers logs.
- oss
Key StringPrefix - The prefix of the file name in the OSS bucket to which the trail delivers logs.
- oss
Write StringRole Arn - The name of the RAM role that the user allows ActionTrail to access OSS service.
- region
Id String - (Available since v1.256.0) The home region of the trail.
- role
Name String - Field
role_name
has been deprecated from provider version 1.118.0. - sls
Project StringArn - The ARN of the Simple Log Service project to which the trail delivers logs.
- sls
Write StringRole Arn - 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
. - trail
Name String - The name of the trail to be created.
- trail
Region String - The region of the trail.
- create
Time string - (Available since v1.256.0) The time when the trail was created.
- event
Rw string - The read/write type of the events to be delivered. Default value:
All
. Valid values:Read
,Write
,All
. - is
Organization booleanTrail - Specifies whether to create a multi-account trail. Default value:
false
. Valid values: - max
Compute stringProject Arn - The ARN of the MaxCompute project to which you want to deliver events.
- max
Compute stringWrite Role Arn - The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
- mns
Topic stringArn - Field
mns_topic_arn
has been deprecated from provider version 1.118.0. - name string
- Field
name
has been deprecated from provider version 1.95.0. New fieldtrail_name
instead. - oss
Bucket stringName - The OSS bucket to which the trail delivers logs.
- oss
Key stringPrefix - The prefix of the file name in the OSS bucket to which the trail delivers logs.
- oss
Write stringRole Arn - The name of the RAM role that the user allows ActionTrail to access OSS service.
- region
Id string - (Available since v1.256.0) The home region of the trail.
- role
Name string - Field
role_name
has been deprecated from provider version 1.118.0. - sls
Project stringArn - The ARN of the Simple Log Service project to which the trail delivers logs.
- sls
Write stringRole Arn - 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
. - trail
Name string - The name of the trail to be created.
- trail
Region 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_ booltrail - Specifies whether to create a multi-account trail. Default value:
false
. Valid values: - max_
compute_ strproject_ arn - The ARN of the MaxCompute project to which you want to deliver events.
- max_
compute_ strwrite_ role_ arn - The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
- mns_
topic_ strarn - Field
mns_topic_arn
has been deprecated from provider version 1.118.0. - name str
- Field
name
has been deprecated from provider version 1.95.0. New fieldtrail_name
instead. - oss_
bucket_ strname - The OSS bucket to which the trail delivers logs.
- oss_
key_ strprefix - The prefix of the file name in the OSS bucket to which the trail delivers logs.
- oss_
write_ strrole_ arn - 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. - sls_
project_ strarn - The ARN of the Simple Log Service project to which the trail delivers logs.
- sls_
write_ strrole_ arn - 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.
- create
Time String - (Available since v1.256.0) The time when the trail was created.
- event
Rw String - The read/write type of the events to be delivered. Default value:
All
. Valid values:Read
,Write
,All
. - is
Organization BooleanTrail - Specifies whether to create a multi-account trail. Default value:
false
. Valid values: - max
Compute StringProject Arn - The ARN of the MaxCompute project to which you want to deliver events.
- max
Compute StringWrite Role Arn - The ARN of the role that is assumed by ActionTrail to deliver events to the MaxCompute project.
- mns
Topic StringArn - Field
mns_topic_arn
has been deprecated from provider version 1.118.0. - name String
- Field
name
has been deprecated from provider version 1.95.0. New fieldtrail_name
instead. - oss
Bucket StringName - The OSS bucket to which the trail delivers logs.
- oss
Key StringPrefix - The prefix of the file name in the OSS bucket to which the trail delivers logs.
- oss
Write StringRole Arn - The name of the RAM role that the user allows ActionTrail to access OSS service.
- region
Id String - (Available since v1.256.0) The home region of the trail.
- role
Name String - Field
role_name
has been deprecated from provider version 1.118.0. - sls
Project StringArn - The ARN of the Simple Log Service project to which the trail delivers logs.
- sls
Write StringRole Arn - 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
. - trail
Name String - The name of the trail to be created.
- trail
Region 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.