Class LogRetention
(deprecated) Creates a custom resource to control the retention policy of a CloudWatch Logs log group.
Inherited Members
Namespace: Amazon.CDK.AWS.Lambda
Assembly: Amazon.CDK.AWS.Lambda.dll
Syntax (csharp)
public class LogRetention : LogRetention, IConstruct, IDependable
Syntax (vb)
Public Class LogRetention
Inherits LogRetention
Implements IConstruct, IDependable
Remarks
The log group is created if it doesn't already exist. The policy
is removed when retentionDays
is undefined
or equal to Infinity
.
Stability: Deprecated
Aws-cdk: /aws-logs' instead
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.Lambda;
using Amazon.CDK.AWS.Logs;
using Amazon.CDK;
Role role;
var logRetention = new LogRetention(this, "MyLogRetention", new LogRetentionProps {
LogGroupName = "logGroupName",
Retention = RetentionDays.ONE_DAY,
// the properties below are optional
LogGroupRegion = "logGroupRegion",
LogRetentionRetryOptions = new LogRetentionRetryOptions {
Base = Duration.Minutes(30),
MaxRetries = 123
},
Role = role
});
Synopsis
Constructors
LogRetention(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
LogRetention(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
LogRetention(Construct, String, ILogRetentionProps) |
Constructors
LogRetention(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected LogRetention(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
LogRetention(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected LogRetention(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
LogRetention(Construct, String, ILogRetentionProps)
public LogRetention(Construct scope, string id, ILogRetentionProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props ILogRetentionProps
Remarks
Stability: Deprecated
Implements
Constructs.IConstruct