tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack
tencentcloud.getAuditEvents
Explore with Pulumi AI
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack
Use this data source to query the events list supported by the audit.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const events = tencentcloud.getAuditEvents({
endTime: 1727437441,
isReturnLocation: 1,
lookupAttributes: [
{
attributeKey: "ResourceType",
attributeValue: "cvm",
},
{
attributeKey: "OnlyRecordNotSeen",
attributeValue: "0",
},
{
attributeKey: "EventPlatform",
attributeValue: "0",
},
],
maxResults: 50,
startTime: 1727433841,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
events = tencentcloud.get_audit_events(end_time=1727437441,
is_return_location=1,
lookup_attributes=[
{
"attribute_key": "ResourceType",
"attribute_value": "cvm",
},
{
"attribute_key": "OnlyRecordNotSeen",
"attribute_value": "0",
},
{
"attribute_key": "EventPlatform",
"attribute_value": "0",
},
],
max_results=50,
start_time=1727433841)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.GetAuditEvents(ctx, &tencentcloud.GetAuditEventsArgs{
EndTime: 1727437441,
IsReturnLocation: pulumi.Float64Ref(1),
LookupAttributes: []tencentcloud.GetAuditEventsLookupAttribute{
{
AttributeKey: "ResourceType",
AttributeValue: pulumi.StringRef("cvm"),
},
{
AttributeKey: "OnlyRecordNotSeen",
AttributeValue: pulumi.StringRef("0"),
},
{
AttributeKey: "EventPlatform",
AttributeValue: pulumi.StringRef("0"),
},
},
MaxResults: pulumi.Float64Ref(50),
StartTime: 1727433841,
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var events = Tencentcloud.GetAuditEvents.Invoke(new()
{
EndTime = 1727437441,
IsReturnLocation = 1,
LookupAttributes = new[]
{
new Tencentcloud.Inputs.GetAuditEventsLookupAttributeInputArgs
{
AttributeKey = "ResourceType",
AttributeValue = "cvm",
},
new Tencentcloud.Inputs.GetAuditEventsLookupAttributeInputArgs
{
AttributeKey = "OnlyRecordNotSeen",
AttributeValue = "0",
},
new Tencentcloud.Inputs.GetAuditEventsLookupAttributeInputArgs
{
AttributeKey = "EventPlatform",
AttributeValue = "0",
},
},
MaxResults = 50,
StartTime = 1727433841,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetAuditEventsArgs;
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 events = TencentcloudFunctions.getAuditEvents(GetAuditEventsArgs.builder()
.endTime("1727437441")
.isReturnLocation(1)
.lookupAttributes(
GetAuditEventsLookupAttributeArgs.builder()
.attributeKey("ResourceType")
.attributeValue("cvm")
.build(),
GetAuditEventsLookupAttributeArgs.builder()
.attributeKey("OnlyRecordNotSeen")
.attributeValue("0")
.build(),
GetAuditEventsLookupAttributeArgs.builder()
.attributeKey("EventPlatform")
.attributeValue("0")
.build())
.maxResults(50)
.startTime("1727433841")
.build());
}
}
variables:
events:
fn::invoke:
function: tencentcloud:getAuditEvents
arguments:
endTime: '1727437441'
isReturnLocation: 1
lookupAttributes:
- attributeKey: ResourceType
attributeValue: cvm
- attributeKey: OnlyRecordNotSeen
attributeValue: '0'
- attributeKey: EventPlatform
attributeValue: '0'
maxResults: 50
startTime: '1727433841'
Using getAuditEvents
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getAuditEvents(args: GetAuditEventsArgs, opts?: InvokeOptions): Promise<GetAuditEventsResult>
function getAuditEventsOutput(args: GetAuditEventsOutputArgs, opts?: InvokeOptions): Output<GetAuditEventsResult>
def get_audit_events(end_time: Optional[float] = None,
id: Optional[str] = None,
is_return_location: Optional[float] = None,
lookup_attributes: Optional[Sequence[GetAuditEventsLookupAttribute]] = None,
max_results: Optional[float] = None,
result_output_file: Optional[str] = None,
start_time: Optional[float] = None,
opts: Optional[InvokeOptions] = None) -> GetAuditEventsResult
def get_audit_events_output(end_time: Optional[pulumi.Input[float]] = None,
id: Optional[pulumi.Input[str]] = None,
is_return_location: Optional[pulumi.Input[float]] = None,
lookup_attributes: Optional[pulumi.Input[Sequence[pulumi.Input[GetAuditEventsLookupAttributeArgs]]]] = None,
max_results: Optional[pulumi.Input[float]] = None,
result_output_file: Optional[pulumi.Input[str]] = None,
start_time: Optional[pulumi.Input[float]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAuditEventsResult]
func GetAuditEvents(ctx *Context, args *GetAuditEventsArgs, opts ...InvokeOption) (*GetAuditEventsResult, error)
func GetAuditEventsOutput(ctx *Context, args *GetAuditEventsOutputArgs, opts ...InvokeOption) GetAuditEventsResultOutput
> Note: This function is named GetAuditEvents
in the Go SDK.
public static class GetAuditEvents
{
public static Task<GetAuditEventsResult> InvokeAsync(GetAuditEventsArgs args, InvokeOptions? opts = null)
public static Output<GetAuditEventsResult> Invoke(GetAuditEventsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAuditEventsResult> getAuditEvents(GetAuditEventsArgs args, InvokeOptions options)
public static Output<GetAuditEventsResult> getAuditEvents(GetAuditEventsArgs args, InvokeOptions options)
fn::invoke:
function: tencentcloud:index/getAuditEvents:getAuditEvents
arguments:
# arguments dictionary
The following arguments are supported:
- End
Time double - End timestamp in seconds (the time range for query is less than 30 days).
- Start
Time double - Start timestamp in seconds (cannot be 90 days after the current time).
- Id string
- Is
Return doubleLocation - Whether to return the IP location.
1
: yes,0
: no. - Lookup
Attributes List<GetAudit Events Lookup Attribute> - Search condition. Valid values:
RequestId
,EventName
,ActionType
(write/read),PrincipalId
(sub-account),ResourceType
,ResourceName
,AccessKeyId
,SensitiveAction
,ApiErrorCode
,CamErrorCode
, andTags
(Format of AttributeValue: [{"key":"","value":""}]). - Max
Results double - Max number of returned logs (up to 50).
- Result
Output stringFile - Used to save results.
- End
Time float64 - End timestamp in seconds (the time range for query is less than 30 days).
- Start
Time float64 - Start timestamp in seconds (cannot be 90 days after the current time).
- Id string
- Is
Return float64Location - Whether to return the IP location.
1
: yes,0
: no. - Lookup
Attributes []GetAudit Events Lookup Attribute - Search condition. Valid values:
RequestId
,EventName
,ActionType
(write/read),PrincipalId
(sub-account),ResourceType
,ResourceName
,AccessKeyId
,SensitiveAction
,ApiErrorCode
,CamErrorCode
, andTags
(Format of AttributeValue: [{"key":"","value":""}]). - Max
Results float64 - Max number of returned logs (up to 50).
- Result
Output stringFile - Used to save results.
- end
Time Double - End timestamp in seconds (the time range for query is less than 30 days).
- start
Time Double - Start timestamp in seconds (cannot be 90 days after the current time).
- id String
- is
Return DoubleLocation - Whether to return the IP location.
1
: yes,0
: no. - lookup
Attributes List<GetAudit Events Lookup Attribute> - Search condition. Valid values:
RequestId
,EventName
,ActionType
(write/read),PrincipalId
(sub-account),ResourceType
,ResourceName
,AccessKeyId
,SensitiveAction
,ApiErrorCode
,CamErrorCode
, andTags
(Format of AttributeValue: [{"key":"","value":""}]). - max
Results Double - Max number of returned logs (up to 50).
- result
Output StringFile - Used to save results.
- end
Time number - End timestamp in seconds (the time range for query is less than 30 days).
- start
Time number - Start timestamp in seconds (cannot be 90 days after the current time).
- id string
- is
Return numberLocation - Whether to return the IP location.
1
: yes,0
: no. - lookup
Attributes GetAudit Events Lookup Attribute[] - Search condition. Valid values:
RequestId
,EventName
,ActionType
(write/read),PrincipalId
(sub-account),ResourceType
,ResourceName
,AccessKeyId
,SensitiveAction
,ApiErrorCode
,CamErrorCode
, andTags
(Format of AttributeValue: [{"key":"","value":""}]). - max
Results number - Max number of returned logs (up to 50).
- result
Output stringFile - Used to save results.
- end_
time float - End timestamp in seconds (the time range for query is less than 30 days).
- start_
time float - Start timestamp in seconds (cannot be 90 days after the current time).
- id str
- is_
return_ floatlocation - Whether to return the IP location.
1
: yes,0
: no. - lookup_
attributes Sequence[GetAudit Events Lookup Attribute] - Search condition. Valid values:
RequestId
,EventName
,ActionType
(write/read),PrincipalId
(sub-account),ResourceType
,ResourceName
,AccessKeyId
,SensitiveAction
,ApiErrorCode
,CamErrorCode
, andTags
(Format of AttributeValue: [{"key":"","value":""}]). - max_
results float - Max number of returned logs (up to 50).
- result_
output_ strfile - Used to save results.
- end
Time Number - End timestamp in seconds (the time range for query is less than 30 days).
- start
Time Number - Start timestamp in seconds (cannot be 90 days after the current time).
- id String
- is
Return NumberLocation - Whether to return the IP location.
1
: yes,0
: no. - lookup
Attributes List<Property Map> - Search condition. Valid values:
RequestId
,EventName
,ActionType
(write/read),PrincipalId
(sub-account),ResourceType
,ResourceName
,AccessKeyId
,SensitiveAction
,ApiErrorCode
,CamErrorCode
, andTags
(Format of AttributeValue: [{"key":"","value":""}]). - max
Results Number - Max number of returned logs (up to 50).
- result
Output StringFile - Used to save results.
getAuditEvents Result
The following output properties are available:
- End
Time double - Events
List<Get
Audit Events Event> - Logset. Note:
null
may be returned for this field, indicating that no valid values can be obtained. - Id string
- Start
Time double - Is
Return doubleLocation - Lookup
Attributes List<GetAudit Events Lookup Attribute> - Max
Results double - Result
Output stringFile
- End
Time float64 - Events
[]Get
Audit Events Event - Logset. Note:
null
may be returned for this field, indicating that no valid values can be obtained. - Id string
- Start
Time float64 - Is
Return float64Location - Lookup
Attributes []GetAudit Events Lookup Attribute - Max
Results float64 - Result
Output stringFile
- end
Time Double - events
List<Get
Audit Events Event> - Logset. Note:
null
may be returned for this field, indicating that no valid values can be obtained. - id String
- start
Time Double - is
Return DoubleLocation - lookup
Attributes List<GetAudit Events Lookup Attribute> - max
Results Double - result
Output StringFile
- end
Time number - events
Get
Audit Events Event[] - Logset. Note:
null
may be returned for this field, indicating that no valid values can be obtained. - id string
- start
Time number - is
Return numberLocation - lookup
Attributes GetAudit Events Lookup Attribute[] - max
Results number - result
Output stringFile
- end_
time float - events
Sequence[Get
Audit Events Event] - Logset. Note:
null
may be returned for this field, indicating that no valid values can be obtained. - id str
- start_
time float - is_
return_ floatlocation - lookup_
attributes Sequence[GetAudit Events Lookup Attribute] - max_
results float - result_
output_ strfile
- end
Time Number - events List<Property Map>
- Logset. Note:
null
may be returned for this field, indicating that no valid values can be obtained. - id String
- start
Time Number - is
Return NumberLocation - lookup
Attributes List<Property Map> - max
Results Number - result
Output StringFile
Supporting Types
GetAuditEventsEvent
- Account
Id double - Cloud
Audit stringEvent - Error
Code double - Event
Id string - Event
Name string - Event
Name stringCn - Event
Region string - Event
Source string - Event
Time string - Location string
- Request
Id string - Resource
Region string - Resource
Type stringCn - Resources
List<Get
Audit Events Event Resource> - Secret
Id string - Source
Ip stringAddress - Username string
- Account
Id float64 - Cloud
Audit stringEvent - Error
Code float64 - Event
Id string - Event
Name string - Event
Name stringCn - Event
Region string - Event
Source string - Event
Time string - Location string
- Request
Id string - Resource
Region string - Resource
Type stringCn - Resources
[]Get
Audit Events Event Resource - Secret
Id string - Source
Ip stringAddress - Username string
- account
Id Double - cloud
Audit StringEvent - error
Code Double - event
Id String - event
Name String - event
Name StringCn - event
Region String - event
Source String - event
Time String - location String
- request
Id String - resource
Region String - resource
Type StringCn - resources
List<Get
Audit Events Event Resource> - secret
Id String - source
Ip StringAddress - username String
- account
Id number - cloud
Audit stringEvent - error
Code number - event
Id string - event
Name string - event
Name stringCn - event
Region string - event
Source string - event
Time string - location string
- request
Id string - resource
Region string - resource
Type stringCn - resources
Get
Audit Events Event Resource[] - secret
Id string - source
Ip stringAddress - username string
- account_
id float - cloud_
audit_ strevent - error_
code float - event_
id str - event_
name str - event_
name_ strcn - event_
region str - event_
source str - event_
time str - location str
- request_
id str - resource_
region str - resource_
type_ strcn - resources
Sequence[Get
Audit Events Event Resource] - secret_
id str - source_
ip_ straddress - username str
- account
Id Number - cloud
Audit StringEvent - error
Code Number - event
Id String - event
Name String - event
Name StringCn - event
Region String - event
Source String - event
Time String - location String
- request
Id String - resource
Region String - resource
Type StringCn - resources List<Property Map>
- secret
Id String - source
Ip StringAddress - username String
GetAuditEventsEventResource
- Resource
Name string - Resource
Type string
- Resource
Name string - Resource
Type string
- resource
Name String - resource
Type String
- resource
Name string - resource
Type string
- resource_
name str - resource_
type str
- resource
Name String - resource
Type String
GetAuditEventsLookupAttribute
- Attribute
Key string - Valid values: RequestId, EventName, ReadOnly, Username, ResourceType, ResourceName, AccessKeyId, and EventId
Note:
null
may be returned for this field, indicating that no valid values can be obtained. - Attribute
Value string - Value of
AttributeValue
Note:null
may be returned for this field, indicating that no valid values can be obtained.
- Attribute
Key string - Valid values: RequestId, EventName, ReadOnly, Username, ResourceType, ResourceName, AccessKeyId, and EventId
Note:
null
may be returned for this field, indicating that no valid values can be obtained. - Attribute
Value string - Value of
AttributeValue
Note:null
may be returned for this field, indicating that no valid values can be obtained.
- attribute
Key String - Valid values: RequestId, EventName, ReadOnly, Username, ResourceType, ResourceName, AccessKeyId, and EventId
Note:
null
may be returned for this field, indicating that no valid values can be obtained. - attribute
Value String - Value of
AttributeValue
Note:null
may be returned for this field, indicating that no valid values can be obtained.
- attribute
Key string - Valid values: RequestId, EventName, ReadOnly, Username, ResourceType, ResourceName, AccessKeyId, and EventId
Note:
null
may be returned for this field, indicating that no valid values can be obtained. - attribute
Value string - Value of
AttributeValue
Note:null
may be returned for this field, indicating that no valid values can be obtained.
- attribute_
key str - Valid values: RequestId, EventName, ReadOnly, Username, ResourceType, ResourceName, AccessKeyId, and EventId
Note:
null
may be returned for this field, indicating that no valid values can be obtained. - attribute_
value str - Value of
AttributeValue
Note:null
may be returned for this field, indicating that no valid values can be obtained.
- attribute
Key String - Valid values: RequestId, EventName, ReadOnly, Username, ResourceType, ResourceName, AccessKeyId, and EventId
Note:
null
may be returned for this field, indicating that no valid values can be obtained. - attribute
Value String - Value of
AttributeValue
Note:null
may be returned for this field, indicating that no valid values can be obtained.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack