CloudWatchObservabilityAdminService / Client / create_telemetry_rule
create_telemetry_rule¶
- CloudWatchObservabilityAdminService.Client.create_telemetry_rule(**kwargs)¶
Creates a telemetry rule that defines how telemetry should be configured for Amazon Web Services resources in your account. The rule specifies which resources should have telemetry enabled and how that telemetry data should be collected based on resource type, telemetry type, and selection criteria.
See also: AWS API Documentation
Request Syntax
response = client.create_telemetry_rule( RuleName='string', Rule={ 'ResourceType': 'AWS::EC2::Instance'|'AWS::EC2::VPC'|'AWS::Lambda::Function', 'TelemetryType': 'Logs'|'Metrics'|'Traces', 'DestinationConfiguration': { 'DestinationType': 'cloud-watch-logs', 'DestinationPattern': 'string', 'RetentionInDays': 123, 'VPCFlowLogParameters': { 'LogFormat': 'string', 'TrafficType': 'string', 'MaxAggregationInterval': 123 } }, 'Scope': 'string', 'SelectionCriteria': 'string' }, Tags={ 'string': 'string' } )
- Parameters:
RuleName (string) –
[REQUIRED]
A unique name for the telemetry rule being created.
Rule (dict) –
[REQUIRED]
The configuration details for the telemetry rule, including the resource type, telemetry type, destination configuration, and selection criteria for which resources the rule applies to.
ResourceType (string) –
The type of Amazon Web Services resource to configure telemetry for (e.g., “AWS::EC2::VPC”).
TelemetryType (string) – [REQUIRED]
The type of telemetry to collect (Logs, Metrics, or Traces).
DestinationConfiguration (dict) –
Configuration specifying where and how the telemetry data should be delivered.
DestinationType (string) –
The type of destination for the telemetry data (e.g., “Amazon CloudWatch Logs”, “S3”).
DestinationPattern (string) –
The pattern used to generate the destination path or name, supporting macros like <resourceId> and <accountId>.
RetentionInDays (integer) –
The number of days to retain the telemetry data in the destination.
VPCFlowLogParameters (dict) –
Configuration parameters specific to VPC Flow Logs when VPC is the resource type.
LogFormat (string) –
The format in which VPC Flow Log entries should be logged.
TrafficType (string) –
The type of traffic to log (ACCEPT, REJECT, or ALL).
MaxAggregationInterval (integer) –
The maximum interval in seconds between the capture of flow log records.
Scope (string) –
The organizational scope to which the rule applies, specified using accounts or organizational units.
SelectionCriteria (string) –
Criteria for selecting which resources the rule applies to, such as resource tags.
Tags (dict) –
The key-value pairs to associate with the telemetry rule resource for categorization and management purposes.
(string) –
(string) –
- Return type:
dict
- Returns:
Response Syntax
{ 'RuleArn': 'string' }
Response Structure
(dict) –
RuleArn (string) –
The Amazon Resource Name (ARN) of the created telemetry rule.
Exceptions
CloudWatchObservabilityAdminService.Client.exceptions.ServiceQuotaExceededException
CloudWatchObservabilityAdminService.Client.exceptions.ConflictException
CloudWatchObservabilityAdminService.Client.exceptions.AccessDeniedException
CloudWatchObservabilityAdminService.Client.exceptions.InternalServerException
CloudWatchObservabilityAdminService.Client.exceptions.ValidationException
CloudWatchObservabilityAdminService.Client.exceptions.TooManyRequestsException