@aws-cdk/aws-logs
- Version 1.204.0
- Published
- 965 kB
- 7 dependencies
- Apache-2.0 license
Install
npm i @aws-cdk/aws-logs
yarn add @aws-cdk/aws-logs
pnpm add @aws-cdk/aws-logs
Overview
The CDK Construct Library for AWS::Logs
Index
Classes
Interfaces
Enums
Type Aliases
Namespaces
Classes
class CfnDestination
class CfnDestination extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::Logs::Destination
The AWS::Logs::Destination resource specifies a CloudWatch Logs destination. A destination encapsulates a physical resource (such as an Amazon Kinesis data stream) and enables you to subscribe that resource to a stream of log events.
AWS::Logs::Destination external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html
constructor
constructor(scope: cdk.Construct, id: string, props: CfnDestinationProps);
Create a new
AWS::Logs::Destination
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property attrArn
readonly attrArn: string;
The ARN of the CloudWatch Logs destination, such as
arn:aws:logs:us-west-1:123456789012:destination:MyDestination
. Arn
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property destinationName
destinationName: string;
The name of the destination.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html#cfn-logs-destination-destinationname
property destinationPolicy
destinationPolicy: string;
An IAM policy document that governs which AWS accounts can create subscription filters against this destination.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html#cfn-logs-destination-destinationpolicy
property roleArn
roleArn: string;
The ARN of an IAM role that permits CloudWatch Logs to send data to the specified AWS resource.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html#cfn-logs-destination-rolearn
property targetArn
targetArn: string;
The Amazon Resource Name (ARN) of the physical target where the log events are delivered (for example, a Kinesis stream).
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html#cfn-logs-destination-targetarn
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnLogGroup
class CfnLogGroup extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::Logs::LogGroup
The
AWS::Logs::LogGroup
resource specifies a log group. A log group defines common properties for log streams, such as their retention and access control rules. Each log stream must belong to one log group.You can create up to 1,000,000 log groups per Region per account. You must use the following guidelines when naming a log group:
- Log group names must be unique within a Region for an AWS account. - Log group names can be between 1 and 512 characters long. - Log group names consist of the following characters: a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), '/' (forward slash), and '.' (period).
AWS::Logs::LogGroup external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html
constructor
constructor(scope: cdk.Construct, id: string, props?: CfnLogGroupProps);
Create a new
AWS::Logs::LogGroup
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property attrArn
readonly attrArn: string;
The ARN of the log group, such as
arn:aws:logs:us-west-1:123456789012:log-group:/mystack-testgroup-12ABC1AB12A1:*
Arn
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property dataProtectionPolicy
dataProtectionPolicy: any;
Creates a data protection policy and assigns it to the log group. A data protection policy can help safeguard sensitive data that's ingested by the log group by auditing and masking the sensitive log data. When a user who does not have permission to view masked data views a log event that includes masked data, the sensitive data is replaced by asterisks.
For more information, including a list of types of data that can be audited and masked, see [Protect sensitive log data with masking](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html) .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html#cfn-logs-loggroup-dataprotectionpolicy
property kmsKeyId
kmsKeyId: string;
The Amazon Resource Name (ARN) of the AWS KMS key to use when encrypting log data.
To associate an AWS KMS key with the log group, specify the ARN of that KMS key here. If you do so, ingested data is encrypted using this key. This association is stored as long as the data encrypted with the KMS key is still within CloudWatch Logs . This enables CloudWatch Logs to decrypt this data whenever it is requested.
If you attempt to associate a KMS key with the log group but the KMS key doesn't exist or is deactivated, you will receive an
InvalidParameterException
error.Log group data is always encrypted in CloudWatch Logs . If you omit this key, the encryption does not use AWS KMS . For more information, see [Encrypt log data in CloudWatch Logs using AWS Key Management Service](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html)
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html#cfn-logs-loggroup-kmskeyid
property logGroupName
logGroupName: string;
The name of the log group. If you don't specify a name, AWS CloudFormation generates a unique ID for the log group.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html#cfn-logs-loggroup-loggroupname
property retentionInDays
retentionInDays: number;
The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, and 3653.
To set a log group so that its log events do not expire, use [DeleteRetentionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html) .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html#cfn-logs-loggroup-retentionindays
property tags
readonly tags: cdk.TagManager;
An array of key-value pairs to apply to the log group.
For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html#cfn-logs-loggroup-tags
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnLogStream
class CfnLogStream extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::Logs::LogStream
The
AWS::Logs::LogStream
resource specifies an Amazon CloudWatch Logs log stream in a specific log group. A log stream represents the sequence of events coming from an application instance or resource that you are monitoring.There is no limit on the number of log streams that you can create for a log group.
You must use the following guidelines when naming a log stream:
- Log stream names must be unique within the log group. - Log stream names can be between 1 and 512 characters long. - The ':' (colon) and '*' (asterisk) characters are not allowed.
AWS::Logs::LogStream external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-logstream.html
constructor
constructor(scope: cdk.Construct, id: string, props: CfnLogStreamProps);
Create a new
AWS::Logs::LogStream
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property logGroupName
logGroupName: string;
The name of the log group where the log stream is created.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-logstream.html#cfn-logs-logstream-loggroupname
property logStreamName
logStreamName: string;
The name of the log stream. The name must be unique within the log group.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-logstream.html#cfn-logs-logstream-logstreamname
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnMetricFilter
class CfnMetricFilter extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::Logs::MetricFilter
The
AWS::Logs::MetricFilter
resource specifies a metric filter that describes how CloudWatch Logs extracts information from logs and transforms it into Amazon CloudWatch metrics. If you have multiple metric filters that are associated with a log group, all the filters are applied to the log streams in that group.The maximum number of metric filters that can be associated with a log group is 100.
AWS::Logs::MetricFilter external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html
constructor
constructor(scope: cdk.Construct, id: string, props: CfnMetricFilterProps);
Create a new
AWS::Logs::MetricFilter
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property filterName
filterName: string;
The name of the metric filter.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html#cfn-logs-metricfilter-filtername
property filterPattern
filterPattern: string;
A filter pattern for extracting metric data out of ingested log events. For more information, see [Filter and Pattern Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html) .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html#cfn-logs-metricfilter-filterpattern
property logGroupName
logGroupName: string;
The name of an existing log group that you want to associate with this metric filter.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html#cfn-logs-metricfilter-loggroupname
property metricTransformations
metricTransformations: any;
The metric transformations.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html#cfn-logs-metricfilter-metrictransformations
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnQueryDefinition
class CfnQueryDefinition extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::Logs::QueryDefinition
Creates a query definition for CloudWatch Logs Insights. For more information, see [Analyzing Log Data with CloudWatch Logs Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html) .
AWS::Logs::QueryDefinition external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-querydefinition.html
constructor
constructor(scope: cdk.Construct, id: string, props: CfnQueryDefinitionProps);
Create a new
AWS::Logs::QueryDefinition
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property attrQueryDefinitionId
readonly attrQueryDefinitionId: string;
The ID of the query definition. QueryDefinitionId
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property logGroupNames
logGroupNames: string[];
Use this parameter if you want the query to query only certain log groups.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-querydefinition.html#cfn-logs-querydefinition-loggroupnames
property name
name: string;
A name for the query definition.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-querydefinition.html#cfn-logs-querydefinition-name
property queryString
queryString: string;
The query string to use for this query definition. For more information, see [CloudWatch Logs Insights Query Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html) .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-querydefinition.html#cfn-logs-querydefinition-querystring
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnResourcePolicy
class CfnResourcePolicy extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::Logs::ResourcePolicy
Creates or updates a resource policy that allows other AWS services to put log events to this account. An account can have up to 10 resource policies per AWS Region.
AWS::Logs::ResourcePolicy external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-resourcepolicy.html
constructor
constructor(scope: cdk.Construct, id: string, props: CfnResourcePolicyProps);
Create a new
AWS::Logs::ResourcePolicy
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property policyDocument
policyDocument: string;
The details of the policy. It must be formatted in JSON, and you must use backslashes to escape characters that need to be escaped in JSON strings, such as double quote marks.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-resourcepolicy.html#cfn-logs-resourcepolicy-policydocument
property policyName
policyName: string;
The name of the resource policy.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-resourcepolicy.html#cfn-logs-resourcepolicy-policyname
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnSubscriptionFilter
class CfnSubscriptionFilter extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::Logs::SubscriptionFilter
The
AWS::Logs::SubscriptionFilter
resource specifies a subscription filter and associates it with the specified log group. Subscription filters allow you to subscribe to a real-time stream of log events and have them delivered to a specific destination. Currently, the supported destinations are:- An Amazon Kinesis data stream belonging to the same account as the subscription filter, for same-account delivery. - A logical destination that belongs to a different account, for cross-account delivery. - An Amazon Kinesis Firehose delivery stream that belongs to the same account as the subscription filter, for same-account delivery. - An AWS Lambda function that belongs to the same account as the subscription filter, for same-account delivery.
There can be as many as two subscription filters associated with a log group.
AWS::Logs::SubscriptionFilter external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html
constructor
constructor(scope: cdk.Construct, id: string, props: CfnSubscriptionFilterProps);
Create a new
AWS::Logs::SubscriptionFilter
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property destinationArn
destinationArn: string;
The Amazon Resource Name (ARN) of the destination.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html#cfn-logs-subscriptionfilter-destinationarn
property distribution
distribution: string;
The method used to distribute log data to the destination, which can be either random or grouped by log stream.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html#cfn-logs-subscriptionfilter-distribution
property filterName
filterName: string;
The name of the subscription filter.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html#cfn-logs-subscriptionfilter-filtername
property filterPattern
filterPattern: string;
The filtering expressions that restrict what gets delivered to the destination AWS resource. For more information about the filter pattern syntax, see [Filter and Pattern Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html) .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html#cfn-logs-subscriptionfilter-filterpattern
property logGroupName
logGroupName: string;
The log group to associate with the subscription filter. All log events that are uploaded to this log group are filtered and delivered to the specified AWS resource if the filter pattern matches the log events.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html#cfn-logs-subscriptionfilter-loggroupname
property roleArn
roleArn: string;
The ARN of an IAM role that grants CloudWatch Logs permissions to deliver ingested log events to the destination stream. You don't need to provide the ARN when you are working with a logical destination for cross-account delivery.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html#cfn-logs-subscriptionfilter-rolearn
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CrossAccountDestination
class CrossAccountDestination extends cdk.Resource implements ILogSubscriptionDestination {}
A new CloudWatch Logs Destination for use in cross-account scenarios
CrossAccountDestinations are used to subscribe a Kinesis stream in a different account to a CloudWatch Subscription.
Consumers will hardly ever need to use this class. Instead, directly subscribe a Kinesis stream using the integration class in the
@aws-cdk/aws-logs-destinations
package; if necessary, aCrossAccountDestination
will be created automatically.AWS::Logs::Destination
constructor
constructor(scope: Construct, id: string, props: CrossAccountDestinationProps);
property destinationArn
readonly destinationArn: string;
The ARN of this CrossAccountDestination object
property destinationName
readonly destinationName: string;
The name of this CrossAccountDestination object
property policyDocument
readonly policyDocument: iam.PolicyDocument;
Policy object of this CrossAccountDestination object
method addToPolicy
addToPolicy: (statement: iam.PolicyStatement) => void;
method bind
bind: ( _scope: CoreConstruct, _sourceLogGroup: ILogGroup) => LogSubscriptionDestinationConfig;
class FilterPattern
class FilterPattern {}
A collection of static methods to generate appropriate ILogPatterns
method all
static all: (...patterns: JsonPattern[]) => JsonPattern;
A JSON log pattern that matches if all given JSON log patterns match
method allEvents
static allEvents: () => IFilterPattern;
A log pattern that matches all events.
method allTerms
static allTerms: (...terms: string[]) => IFilterPattern;
A log pattern that matches if all the strings given appear in the event.
Parameter terms
The words to search for. All terms must match.
method any
static any: (...patterns: JsonPattern[]) => JsonPattern;
A JSON log pattern that matches if any of the given JSON log patterns match
method anyTerm
static anyTerm: (...terms: string[]) => IFilterPattern;
A log pattern that matches if any of the strings given appear in the event.
Parameter terms
The words to search for. Any terms must match.
method anyTermGroup
static anyTermGroup: (...termGroups: string[][]) => IFilterPattern;
A log pattern that matches if any of the given term groups matches the event.
A term group matches an event if all the terms in it appear in the event string.
Parameter termGroups
A list of term groups to search for. Any one of the clauses must match.
method booleanValue
static booleanValue: (jsonField: string, value: boolean) => JsonPattern;
A JSON log pattern that matches if the field exists and equals the boolean value.
Parameter jsonField
Field inside JSON. Example: "$.myField"
Parameter value
The value to match
method exists
static exists: (jsonField: string) => JsonPattern;
A JSON log patter that matches if the field exists.
This is a readable convenience wrapper over 'field = *'
Parameter jsonField
Field inside JSON. Example: "$.myField"
method isNull
static isNull: (jsonField: string) => JsonPattern;
A JSON log pattern that matches if the field exists and has the special value 'null'.
Parameter jsonField
Field inside JSON. Example: "$.myField"
method literal
static literal: (logPatternString: string) => IFilterPattern;
Use the given string as log pattern.
See https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html for information on writing log patterns.
Parameter logPatternString
The pattern string to use.
method notExists
static notExists: (jsonField: string) => JsonPattern;
A JSON log pattern that matches if the field does not exist.
Parameter jsonField
Field inside JSON. Example: "$.myField"
method numberValue
static numberValue: ( jsonField: string, comparison: string, value: number) => JsonPattern;
A JSON log pattern that compares numerical values.
This pattern only matches if the event is a JSON event, and the indicated field inside compares with the value in the indicated way.
Use '$' to indicate the root of the JSON structure. The comparison operator can only compare equality or inequality. The '*' wildcard may appear in the value may at the start or at the end.
For more information, see:
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html
Parameter jsonField
Field inside JSON. Example: "$.myField"
Parameter comparison
Comparison to carry out. One of =, !=, <, <=, >, >=.
Parameter value
The numerical value to compare to
method spaceDelimited
static spaceDelimited: (...columns: string[]) => SpaceDelimitedTextPattern;
A space delimited log pattern matcher.
The log event is divided into space-delimited columns (optionally enclosed by "" or [] to capture spaces into column values), and names are given to each column.
'...' may be specified once to match any number of columns.
Afterwards, conditions may be added to individual columns.
Parameter columns
The columns in the space-delimited log stream.
method stringValue
static stringValue: ( jsonField: string, comparison: string, value: string) => JsonPattern;
A JSON log pattern that compares string values.
This pattern only matches if the event is a JSON event, and the indicated field inside compares with the string value.
Use '$' to indicate the root of the JSON structure. The comparison operator can only compare equality or inequality. The '*' wildcard may appear in the value may at the start or at the end.
For more information, see:
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html
Parameter jsonField
Field inside JSON. Example: "$.myField"
Parameter comparison
Comparison to carry out. Either = or !=.
Parameter value
The string value to compare to. May use '*' as wildcard at start or end of string.
class JsonPattern
abstract class JsonPattern implements IFilterPattern {}
Base class for patterns that only match JSON log events.
constructor
constructor(jsonPatternString: string);
property jsonPatternString
readonly jsonPatternString: string;
property logPatternString
readonly logPatternString: string;
class LogGroup
class LogGroup extends LogGroupBase {}
Define a CloudWatch Log Group
constructor
constructor(scope: Construct, id: string, props?: LogGroupProps);
property logGroupArn
readonly logGroupArn: string;
The ARN of this log group
property logGroupName
readonly logGroupName: string;
The name of this log group
method fromLogGroupArn
static fromLogGroupArn: ( scope: Construct, id: string, logGroupArn: string) => ILogGroup;
Import an existing LogGroup given its ARN
method fromLogGroupName
static fromLogGroupName: ( scope: Construct, id: string, logGroupName: string) => ILogGroup;
Import an existing LogGroup given its name
class LogRetention
class LogRetention extends CoreConstruct {}
Creates a custom resource to control the retention policy of a CloudWatch Logs log group. The log group is created if it doesn't already exist. The policy is removed when
retentionDays
isundefined
or equal toInfinity
. Log group can be created in the region that is different from stack region by specifyinglogGroupRegion
constructor
constructor(scope: Construct, id: string, props: LogRetentionProps);
property logGroupArn
readonly logGroupArn: string;
The ARN of the LogGroup.
class LogStream
class LogStream extends Resource implements ILogStream {}
Define a Log Stream in a Log Group
constructor
constructor(scope: Construct, id: string, props: LogStreamProps);
property logStreamName
readonly logStreamName: string;
The name of this log stream
method fromLogStreamName
static fromLogStreamName: ( scope: Construct, id: string, logStreamName: string) => ILogStream;
Import an existing LogGroup
class MetricFilter
class MetricFilter extends Resource {}
A filter that extracts information from CloudWatch Logs and emits to CloudWatch Metrics
constructor
constructor(scope: Construct, id: string, props: MetricFilterProps);
method metric
metric: (props?: MetricOptions) => Metric;
Return the given named metric for this Metric Filter
avg over 5 minutes
class QueryDefinition
class QueryDefinition extends Resource {}
Define a query definition for CloudWatch Logs Insights
constructor
constructor(scope: Construct, id: string, props: QueryDefinitionProps);
property queryDefinitionId
readonly queryDefinitionId: string;
The ID of the query definition.
class QueryString
class QueryString {}
Define a QueryString
constructor
constructor(props?: QueryStringProps);
method toString
toString: () => string;
String representation of this QueryString.
class ResourcePolicy
class ResourcePolicy extends Resource {}
Resource Policy for CloudWatch Log Groups
Policies define the operations that are allowed on this resource.
You almost never need to define this construct directly.
All AWS resources that support resource policies have a method called
addToResourcePolicy()
, which will automatically create a new resource policy if one doesn't exist yet, otherwise it will add to the existing policy.Prefer to use
addToResourcePolicy()
instead.
constructor
constructor(scope: Construct, id: string, props?: ResourcePolicyProps);
property document
readonly document: PolicyDocument;
The IAM policy document for this resource policy.
class SpaceDelimitedTextPattern
class SpaceDelimitedTextPattern implements IFilterPattern {}
Space delimited text pattern
constructor
protected constructor(columns: string[], restrictions: RestrictionMap);
property logPatternString
readonly logPatternString: string;
method construct
static construct: (columns: string[]) => SpaceDelimitedTextPattern;
Construct a new instance of a space delimited text pattern
Since this class must be public, we can't rely on the user only creating it through the
LogPattern.spaceDelimited()
factory function. We must therefore validate the argument in the constructor. Since we're returning a copy on every mutation, and we don't want to re-validate the same things on every construction, we provide a limited set of mutator functions and only validate the new data every time.
method whereNumber
whereNumber: ( columnName: string, comparison: string, value: number) => SpaceDelimitedTextPattern;
Restrict where the pattern applies
method whereString
whereString: ( columnName: string, comparison: string, value: string) => SpaceDelimitedTextPattern;
Restrict where the pattern applies
class SubscriptionFilter
class SubscriptionFilter extends Resource {}
A new Subscription on a CloudWatch log group.
constructor
constructor(scope: Construct, id: string, props: SubscriptionFilterProps);
Interfaces
interface CfnDestinationProps
interface CfnDestinationProps {}
Properties for defining a
CfnDestination
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html
property destinationName
readonly destinationName: string;
The name of the destination.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html#cfn-logs-destination-destinationname
property destinationPolicy
readonly destinationPolicy?: string;
An IAM policy document that governs which AWS accounts can create subscription filters against this destination.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html#cfn-logs-destination-destinationpolicy
property roleArn
readonly roleArn: string;
The ARN of an IAM role that permits CloudWatch Logs to send data to the specified AWS resource.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html#cfn-logs-destination-rolearn
property targetArn
readonly targetArn: string;
The Amazon Resource Name (ARN) of the physical target where the log events are delivered (for example, a Kinesis stream).
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html#cfn-logs-destination-targetarn
interface CfnLogGroupProps
interface CfnLogGroupProps {}
Properties for defining a
CfnLogGroup
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html
property dataProtectionPolicy
readonly dataProtectionPolicy?: any | cdk.IResolvable;
Creates a data protection policy and assigns it to the log group. A data protection policy can help safeguard sensitive data that's ingested by the log group by auditing and masking the sensitive log data. When a user who does not have permission to view masked data views a log event that includes masked data, the sensitive data is replaced by asterisks.
For more information, including a list of types of data that can be audited and masked, see [Protect sensitive log data with masking](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html) .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html#cfn-logs-loggroup-dataprotectionpolicy
property kmsKeyId
readonly kmsKeyId?: string;
The Amazon Resource Name (ARN) of the AWS KMS key to use when encrypting log data.
To associate an AWS KMS key with the log group, specify the ARN of that KMS key here. If you do so, ingested data is encrypted using this key. This association is stored as long as the data encrypted with the KMS key is still within CloudWatch Logs . This enables CloudWatch Logs to decrypt this data whenever it is requested.
If you attempt to associate a KMS key with the log group but the KMS key doesn't exist or is deactivated, you will receive an
InvalidParameterException
error.Log group data is always encrypted in CloudWatch Logs . If you omit this key, the encryption does not use AWS KMS . For more information, see [Encrypt log data in CloudWatch Logs using AWS Key Management Service](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html)
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html#cfn-logs-loggroup-kmskeyid
property logGroupName
readonly logGroupName?: string;
The name of the log group. If you don't specify a name, AWS CloudFormation generates a unique ID for the log group.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html#cfn-logs-loggroup-loggroupname
property retentionInDays
readonly retentionInDays?: number;
The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, and 3653.
To set a log group so that its log events do not expire, use [DeleteRetentionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html) .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html#cfn-logs-loggroup-retentionindays
property tags
readonly tags?: cdk.CfnTag[];
An array of key-value pairs to apply to the log group.
For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html#cfn-logs-loggroup-tags
interface CfnLogStreamProps
interface CfnLogStreamProps {}
Properties for defining a
CfnLogStream
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-logstream.html
property logGroupName
readonly logGroupName: string;
The name of the log group where the log stream is created.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-logstream.html#cfn-logs-logstream-loggroupname
property logStreamName
readonly logStreamName?: string;
The name of the log stream. The name must be unique within the log group.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-logstream.html#cfn-logs-logstream-logstreamname
interface CfnMetricFilterProps
interface CfnMetricFilterProps {}
Properties for defining a
CfnMetricFilter
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html
property filterName
readonly filterName?: string;
The name of the metric filter.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html#cfn-logs-metricfilter-filtername
property filterPattern
readonly filterPattern: string;
A filter pattern for extracting metric data out of ingested log events. For more information, see [Filter and Pattern Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html) .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html#cfn-logs-metricfilter-filterpattern
property logGroupName
readonly logGroupName: string;
The name of an existing log group that you want to associate with this metric filter.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html#cfn-logs-metricfilter-loggroupname
property metricTransformations
readonly metricTransformations: | Array<CfnMetricFilter.MetricTransformationProperty | cdk.IResolvable> | cdk.IResolvable;
The metric transformations.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html#cfn-logs-metricfilter-metrictransformations
interface CfnQueryDefinitionProps
interface CfnQueryDefinitionProps {}
Properties for defining a
CfnQueryDefinition
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-querydefinition.html
property logGroupNames
readonly logGroupNames?: string[];
Use this parameter if you want the query to query only certain log groups.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-querydefinition.html#cfn-logs-querydefinition-loggroupnames
property name
readonly name: string;
A name for the query definition.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-querydefinition.html#cfn-logs-querydefinition-name
property queryString
readonly queryString: string;
The query string to use for this query definition. For more information, see [CloudWatch Logs Insights Query Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html) .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-querydefinition.html#cfn-logs-querydefinition-querystring
interface CfnResourcePolicyProps
interface CfnResourcePolicyProps {}
Properties for defining a
CfnResourcePolicy
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-resourcepolicy.html
property policyDocument
readonly policyDocument: string;
The details of the policy. It must be formatted in JSON, and you must use backslashes to escape characters that need to be escaped in JSON strings, such as double quote marks.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-resourcepolicy.html#cfn-logs-resourcepolicy-policydocument
property policyName
readonly policyName: string;
The name of the resource policy.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-resourcepolicy.html#cfn-logs-resourcepolicy-policyname
interface CfnSubscriptionFilterProps
interface CfnSubscriptionFilterProps {}
Properties for defining a
CfnSubscriptionFilter
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html
property destinationArn
readonly destinationArn: string;
The Amazon Resource Name (ARN) of the destination.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html#cfn-logs-subscriptionfilter-destinationarn
property distribution
readonly distribution?: string;
The method used to distribute log data to the destination, which can be either random or grouped by log stream.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html#cfn-logs-subscriptionfilter-distribution
property filterName
readonly filterName?: string;
The name of the subscription filter.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html#cfn-logs-subscriptionfilter-filtername
property filterPattern
readonly filterPattern: string;
The filtering expressions that restrict what gets delivered to the destination AWS resource. For more information about the filter pattern syntax, see [Filter and Pattern Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html) .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html#cfn-logs-subscriptionfilter-filterpattern
property logGroupName
readonly logGroupName: string;
The log group to associate with the subscription filter. All log events that are uploaded to this log group are filtered and delivered to the specified AWS resource if the filter pattern matches the log events.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html#cfn-logs-subscriptionfilter-loggroupname
property roleArn
readonly roleArn?: string;
The ARN of an IAM role that grants CloudWatch Logs permissions to deliver ingested log events to the destination stream. You don't need to provide the ARN when you are working with a logical destination for cross-account delivery.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html#cfn-logs-subscriptionfilter-rolearn
interface ColumnRestriction
interface ColumnRestriction {}
property comparison
readonly comparison: string;
Comparison operator to use
property numberValue
readonly numberValue?: number;
Number value to compare to
Exactly one of 'stringValue' and 'numberValue' must be set.
property stringValue
readonly stringValue?: string;
String value to compare to
Exactly one of 'stringValue' and 'numberValue' must be set.
interface CrossAccountDestinationProps
interface CrossAccountDestinationProps {}
Properties for a CrossAccountDestination
property destinationName
readonly destinationName?: string;
The name of the log destination.
Automatically generated
property role
readonly role: iam.IRole;
The role to assume that grants permissions to write to 'target'.
The role must be assumable by 'logs.{REGION}.amazonaws.com'.
property targetArn
readonly targetArn: string;
The log destination target's ARN
interface IFilterPattern
interface IFilterPattern {}
Interface for objects that can render themselves to log patterns.
property logPatternString
readonly logPatternString: string;
interface ILogGroup
interface ILogGroup extends iam.IResourceWithPolicy {}
property logGroupArn
readonly logGroupArn: string;
The ARN of this log group, with ':*' appended
property logGroupName
readonly logGroupName: string;
The name of this log group
method addMetricFilter
addMetricFilter: (id: string, props: MetricFilterOptions) => MetricFilter;
Create a new Metric Filter on this Log Group
Parameter id
Unique identifier for the construct in its parent
Parameter props
Properties for creating the MetricFilter
method addStream
addStream: (id: string, props?: StreamOptions) => LogStream;
Create a new Log Stream for this Log Group
Parameter id
Unique identifier for the construct in its parent
Parameter props
Properties for creating the LogStream
method addSubscriptionFilter
addSubscriptionFilter: ( id: string, props: SubscriptionFilterOptions) => SubscriptionFilter;
Create a new Subscription Filter on this Log Group
Parameter id
Unique identifier for the construct in its parent
Parameter props
Properties for creating the SubscriptionFilter
method extractMetric
extractMetric: ( jsonField: string, metricNamespace: string, metricName: string) => cloudwatch.Metric;
Extract a metric from structured log events in the LogGroup
Creates a MetricFilter on this LogGroup that will extract the value of the indicated JSON field in all records where it occurs.
The metric will be available in CloudWatch Metrics under the indicated namespace and name.
Parameter jsonField
JSON field to extract (example: '$.myfield')
Parameter metricNamespace
Namespace to emit the metric under
Parameter metricName
Name to emit the metric under
Returns
A Metric object representing the extracted metric
method grant
grant: (grantee: iam.IGrantable, ...actions: string[]) => iam.Grant;
Give the indicated permissions on this log group and all streams
method grantWrite
grantWrite: (grantee: iam.IGrantable) => iam.Grant;
Give permissions to write to create and write to streams in this log group
method logGroupPhysicalName
logGroupPhysicalName: () => string;
Public method to get the physical name of this log group
interface ILogStream
interface ILogStream extends IResource {}
property logStreamName
readonly logStreamName: string;
The name of this log stream
interface ILogSubscriptionDestination
interface ILogSubscriptionDestination {}
Interface for classes that can be the destination of a log Subscription
method bind
bind: ( scope: CoreConstruct, sourceLogGroup: ILogGroup) => LogSubscriptionDestinationConfig;
Return the properties required to send subscription events to this destination.
If necessary, the destination can use the properties of the SubscriptionFilter object itself to configure its permissions to allow the subscription to write to it.
The destination may reconfigure its own permissions in response to this function call.
interface LogGroupProps
interface LogGroupProps {}
Properties for a LogGroup
property encryptionKey
readonly encryptionKey?: kms.IKey;
The KMS Key to encrypt the log group with.
- log group is encrypted with the default master key
property logGroupName
readonly logGroupName?: string;
Name of the log group.
Automatically generated
property removalPolicy
readonly removalPolicy?: RemovalPolicy;
Determine the removal policy of this log group.
Normally you want to retain the log group so you can diagnose issues from logs even after a deployment that no longer includes the log group. In that case, use the normal date-based retention policy to age out your logs.
RemovalPolicy.Retain
property retention
readonly retention?: RetentionDays;
How long, in days, the log contents will be retained.
To retain all logs, set this value to RetentionDays.INFINITE.
RetentionDays.TWO_YEARS
interface LogRetentionProps
interface LogRetentionProps {}
Construction properties for a LogRetention.
property logGroupName
readonly logGroupName: string;
The log group name.
property logGroupRegion
readonly logGroupRegion?: string;
The region where the log group should be created - same region as the stack
property logRetentionRetryOptions
readonly logRetentionRetryOptions?: LogRetentionRetryOptions;
Retry options for all AWS API calls.
- AWS SDK default retry options
property retention
readonly retention: RetentionDays;
The number of days log events are kept in CloudWatch Logs.
property role
readonly role?: iam.IRole;
The IAM role for the Lambda function associated with the custom resource.
- A new role is created
interface LogRetentionRetryOptions
interface LogRetentionRetryOptions {}
Retry options for all AWS API calls.
property base
readonly base?: cdk.Duration;
The base duration to use in the exponential backoff for operation retries.
Duration.millis(100) (AWS SDK default)
property maxRetries
readonly maxRetries?: number;
The maximum amount of retries.
3 (AWS SDK default)
interface LogStreamProps
interface LogStreamProps {}
Properties for a LogStream
property logGroup
readonly logGroup: ILogGroup;
The log group to create a log stream for.
property logStreamName
readonly logStreamName?: string;
The name of the log stream to create.
The name must be unique within the log group.
Automatically generated
property removalPolicy
readonly removalPolicy?: RemovalPolicy;
Determine what happens when the log stream resource is removed from the app.
Normally you want to retain the log stream so you can diagnose issues from logs even after a deployment that no longer includes the log stream.
The date-based retention policy of your log group will age out the logs after a certain time.
RemovalPolicy.Retain
interface LogSubscriptionDestinationConfig
interface LogSubscriptionDestinationConfig {}
Properties returned by a Subscription destination
interface MetricFilterOptions
interface MetricFilterOptions {}
Properties for a MetricFilter created from a LogGroup
property defaultValue
readonly defaultValue?: number;
The value to emit if the pattern does not match a particular event.
No metric emitted.
property filterPattern
readonly filterPattern: IFilterPattern;
Pattern to search for log events.
property metricName
readonly metricName: string;
The name of the metric to emit.
property metricNamespace
readonly metricNamespace: string;
The namespace of the metric to emit.
property metricValue
readonly metricValue?: string;
The value to emit for the metric.
Can either be a literal number (typically "1"), or the name of a field in the structure to take the value from the matched event. If you are using a field value, the field value must have been matched using the pattern.
If you want to specify a field from a matched JSON structure, use '$.fieldName', and make sure the field is in the pattern (if only as '$.fieldName = *').
If you want to specify a field from a matched space-delimited structure, use '$fieldName'.
"1"
interface MetricFilterProps
interface MetricFilterProps extends MetricFilterOptions {}
Properties for a MetricFilter
property logGroup
readonly logGroup: ILogGroup;
The log group to create the filter on.
interface QueryDefinitionProps
interface QueryDefinitionProps {}
Properties for a QueryDefinition
property logGroups
readonly logGroups?: ILogGroup[];
Specify certain log groups for the query definition.
- no specified log groups
property queryDefinitionName
readonly queryDefinitionName: string;
Name of the query definition.
property queryString
readonly queryString: QueryString;
The query string to use for this query definition.
interface QueryStringProps
interface QueryStringProps {}
Properties for a QueryString
property display
readonly display?: string;
Specifies which fields to display in the query results.
- no display in QueryString
property fields
readonly fields?: string[];
Retrieves the specified fields from log events for display.
- no fields in QueryString
property filter
readonly filter?: string;
Filters the results of a query that's based on one or more conditions.
- no filter in QueryString
property limit
readonly limit?: Number;
Specifies the number of log events returned by the query.
- no limit in QueryString
property parse
readonly parse?: string;
Extracts data from a log field and creates one or more ephemeral fields that you can process further in the query.
- no parse in QueryString
property sort
readonly sort?: string;
Sorts the retrieved log events.
- no sort in QueryString
property stats
readonly stats?: string;
Uses log field values to calculate aggregate statistics.
- no stats in QueryString
interface ResourcePolicyProps
interface ResourcePolicyProps {}
Properties to define Cloudwatch log group resource policy
property policyStatements
readonly policyStatements?: PolicyStatement[];
Initial statements to add to the resource policy
- No statements
property resourcePolicyName
readonly resourcePolicyName?: string;
Name of the log group resource policy - Uses a unique id based on the construct path
interface StreamOptions
interface StreamOptions {}
Properties for a new LogStream created from a LogGroup
property logStreamName
readonly logStreamName?: string;
The name of the log stream to create.
The name must be unique within the log group.
Automatically generated
interface SubscriptionFilterOptions
interface SubscriptionFilterOptions {}
Properties for a new SubscriptionFilter created from a LogGroup
property destination
readonly destination: ILogSubscriptionDestination;
The destination to send the filtered events to.
For example, a Kinesis stream or a Lambda function.
property filterPattern
readonly filterPattern: IFilterPattern;
Log events matching this pattern will be sent to the destination.
interface SubscriptionFilterProps
interface SubscriptionFilterProps extends SubscriptionFilterOptions {}
Properties for a SubscriptionFilter
property logGroup
readonly logGroup: ILogGroup;
The log group to create the subscription on.
Enums
enum RetentionDays
enum RetentionDays { ONE_DAY = 1, THREE_DAYS = 3, FIVE_DAYS = 5, ONE_WEEK = 7, TWO_WEEKS = 14, ONE_MONTH = 30, TWO_MONTHS = 60, THREE_MONTHS = 90, FOUR_MONTHS = 120, FIVE_MONTHS = 150, SIX_MONTHS = 180, ONE_YEAR = 365, THIRTEEN_MONTHS = 400, EIGHTEEN_MONTHS = 545, TWO_YEARS = 731, FIVE_YEARS = 1827, SIX_YEARS = 2192, SEVEN_YEARS = 2557, EIGHT_YEARS = 2922, NINE_YEARS = 3288, TEN_YEARS = 3653, INFINITE = 9999,}
How long, in days, the log contents will be retained.
member EIGHT_YEARS
EIGHT_YEARS = 2922
8 years
member EIGHTEEN_MONTHS
EIGHTEEN_MONTHS = 545
18 months
member FIVE_DAYS
FIVE_DAYS = 5
5 days
member FIVE_MONTHS
FIVE_MONTHS = 150
5 months
member FIVE_YEARS
FIVE_YEARS = 1827
5 years
member FOUR_MONTHS
FOUR_MONTHS = 120
4 months
member INFINITE
INFINITE = 9999
Retain logs forever
member NINE_YEARS
NINE_YEARS = 3288
9 years
member ONE_DAY
ONE_DAY = 1
1 day
member ONE_MONTH
ONE_MONTH = 30
1 month
member ONE_WEEK
ONE_WEEK = 7
1 week
member ONE_YEAR
ONE_YEAR = 365
1 year
member SEVEN_YEARS
SEVEN_YEARS = 2557
7 years
member SIX_MONTHS
SIX_MONTHS = 180
6 months
member SIX_YEARS
SIX_YEARS = 2192
6 years
member TEN_YEARS
TEN_YEARS = 3653
10 years
member THIRTEEN_MONTHS
THIRTEEN_MONTHS = 400
13 months
member THREE_DAYS
THREE_DAYS = 3
3 days
member THREE_MONTHS
THREE_MONTHS = 90
3 months
member TWO_MONTHS
TWO_MONTHS = 60
2 months
member TWO_WEEKS
TWO_WEEKS = 14
2 weeks
member TWO_YEARS
TWO_YEARS = 731
2 years
Type Aliases
type RestrictionMap
type RestrictionMap = { [column: string]: ColumnRestriction[];};
Namespaces
namespace CfnMetricFilter
namespace CfnMetricFilter {}
interface DimensionProperty
interface DimensionProperty {}
Specifies the CloudWatch metric dimensions to publish with this metric.
Because dimensions are part of the unique identifier for a metric, whenever a unique dimension name/value pair is extracted from your logs, you are creating a new variation of that metric.
For more information about publishing dimensions with metrics created by metric filters, see [Publishing dimensions with metrics from values in JSON or space-delimited log events](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html#logs-metric-filters-dimensions) .
> Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not specify high-cardinality fields such as
IPAddress
orrequestID
as dimensions. Each different value found for a dimension is treated as a separate metric and accrues charges as a separate custom metric. > > To help prevent accidental high charges, Amazon disables a metric filter if it generates 1000 different name/value pairs for the dimensions that you have specified within a certain amount of time. > > You can also set up a billing alarm to alert you if your charges are higher than expected. For more information, see [Creating a Billing Alarm to Monitor Your Estimated AWS Charges](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html) .external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-logs-metricfilter-dimension.html
property key
readonly key: string;
The name for the CloudWatch metric dimension that the metric filter creates.
Dimension names must contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon (:).
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-logs-metricfilter-dimension.html#cfn-logs-metricfilter-dimension-key
property value
readonly value: string;
The log event field that will contain the value for this dimension. This dimension will only be published for a metric if the value is found in the log event. For example,
$.eventType
for JSON log events, or$server
for space-delimited log events.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-logs-metricfilter-dimension.html#cfn-logs-metricfilter-dimension-value
interface MetricTransformationProperty
interface MetricTransformationProperty {}
MetricTransformation
is a property of theAWS::Logs::MetricFilter
resource that describes how to transform log streams into a CloudWatch metric.external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-logs-metricfilter-metrictransformation.html
property defaultValue
readonly defaultValue?: number;
(Optional) The value to emit when a filter pattern does not match a log event. This value can be null.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-logs-metricfilter-metrictransformation.html#cfn-logs-metricfilter-metrictransformation-defaultvalue
property dimensions
readonly dimensions?: | Array<CfnMetricFilter.DimensionProperty | cdk.IResolvable> | cdk.IResolvable;
The fields to use as dimensions for the metric. One metric filter can include as many as three dimensions.
> Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not specify high-cardinality fields such as
IPAddress
orrequestID
as dimensions. Each different value found for a dimension is treated as a separate metric and accrues charges as a separate custom metric. > > CloudWatch Logs disables a metric filter if it generates 1000 different name/value pairs for your specified dimensions within a certain amount of time. This helps to prevent accidental high charges. > > You can also set up a billing alarm to alert you if your charges are higher than expected. For more information, see [Creating a Billing Alarm to Monitor Your Estimated AWS Charges](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html) .http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-logs-metricfilter-metrictransformation.html#cfn-logs-metricfilter-metrictransformation-dimensions
property metricName
readonly metricName: string;
The name of the CloudWatch metric.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-logs-metricfilter-metrictransformation.html#cfn-logs-metricfilter-metrictransformation-metricname
property metricNamespace
readonly metricNamespace: string;
A custom namespace to contain your metric in CloudWatch. Use namespaces to group together metrics that are similar. For more information, see [Namespaces](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Namespace) .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-logs-metricfilter-metrictransformation.html#cfn-logs-metricfilter-metrictransformation-metricnamespace
property metricValue
readonly metricValue: string;
The value that is published to the CloudWatch metric. For example, if you're counting the occurrences of a particular term like
Error
, specify 1 for the metric value. If you're counting the number of bytes transferred, reference the value that is in the log event by using $. followed by the name of the field that you specified in the filter pattern, such as$.size
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-logs-metricfilter-metrictransformation.html#cfn-logs-metricfilter-metrictransformation-metricvalue
property unit
readonly unit?: string;
The unit to assign to the metric. If you omit this, the unit is set as
None
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-logs-metricfilter-metrictransformation.html#cfn-logs-metricfilter-metrictransformation-unit
Package Files (11)
Dependencies (7)
Dev Dependencies (13)
Peer Dependencies (7)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@aws-cdk/aws-logs
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@aws-cdk/aws-logs)
- HTML<a href="https://www.jsdocs.io/package/@aws-cdk/aws-logs"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 6309 ms. - Missing or incorrect documentation? Open an issue for this package.